Example #1
0
    // Use this for initialization
    void Start()
    {
        patternIndex   = PlayerPrefs.GetInt("SelectedPattern");
        Time.timeScale = 1;

        pointsManager       = PointsManager.instance;
        pointsManager.Score = 0;

        audioManager = AudioManager.instance;

        messageManager = MessageManager.instance;

        hearthManager = HearthManager.instance;
        SetHearths();

        // Initiation
        sequence = new List <int>();
        for (int i = 0; i < buttons.Length; i++)
        {
            buttons[i].ButtonActive(false);
            buttons[i].button.interactable = false;
            buttons[i].index       = i;
            buttons[i].image.color = buttonColors[i];
            buttons[i].normalColor = buttonColors[i];
            buttons[i].AddPattern(patternIndex, patternPack, additionalColors[i]);
            buttons[i].RandomRotatePattern();

            // Assigning components
            if (buttons[i].GameplayController == null)
            {
                buttons[i].GameplayController = this;
            }
            if (buttons[i].AudioManager == null)
            {
                buttons[i].AudioManager = audioManager;
            }

            if (i < buttonsCount)
            {
                buttons[i].ButtonActive(true);
                buttons[i].button.interactable = false;
            }
            else
            {
                buttons[i].ButtonActive(false);
                buttons[i].button.interactable = false;
            }
        }


        StartCoroutine(Gameplay());
    }
Example #2
0
    void Start()
    {
        hearthManager = HearthManager.instance;
        hearthManager.onHearthValueChange = OnHearthValueChange;

        textMesh = GetComponent <TextMeshProUGUI>();
        if (PlayerPrefs.GetString("DifficultyLevel") == "1H")
        {
            textMesh.text = "";
        }
        else if (PlayerPrefs.GetString("DifficultyLevel") == "3H")
        {
            textMesh.text = "3 <sprite=1>";
        }
        else if (PlayerPrefs.GetString("DifficultyLevel") == "RegH")
        {
            textMesh.text = "<sprite=1>";
        }
    }
Example #3
0
 private void Awake()
 {
     instance = this;
 }