Answer the question
In order to leave comments, you need to log in
How to choose a character?
I have a scene in which you can choose a character, they open for records. For example, you have a time record in the game of 25 seconds, and then a character will open that opens at 25 seconds. While the character is not open, it has a black color (like it is not open yet) It happens like this
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class IsEnabled : MonoBehaviour
{
public int NeedToUnlock;
public Color NewColor;
SpriteRenderer SpriteR;
public Sprite Pink_Monster;
public SpriteRenderer PinkMonster;
void Start()
{
if (PlayerPrefs.GetInt("SaveScore") < NeedToUnlock)
{
GetComponent<SpriteRenderer>().color = Color.black;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question