Esempio n. 1
0
    private void Awake()
    {
        if (Singleton)
        {
            Destroy(gameObject);
        }
        else
        {
            Singleton = this;


            foreach (Sprite keyboardIcon in Resources.LoadAll <Sprite>(keyboardIcons))
            {
                sprites.Add(keyboardIcon.name, keyboardIcon);
            }

            foreach (Sprite joystickIcon in Resources.LoadAll <Sprite>(joystickIcons))
            {
                sprites.Add(joystickIcon.name, joystickIcon);
            }

            sprites.Add("Keyboard_Black_MouseLeft_Up", mouseLeftIcon);
            sprites.Add("Keyboard_Black_MouseRight_Up", mouseRightIcon);


            foreach (KeyBindingData data in bindingData)
            {
                keyNames.Add(data.ButtonName, new string[2] {
                    string.Format("Keyboard_Black_{0}_Up", data.KeyboardButtonName), string.Format("Xbox_One_Large_{0}_Down", data.JoystickButtonName)
                });
            }
        }
    }
Esempio n. 2
0
    private void Awake()
    {
        if (PlayerPrefs.GetInt("FirstPlay" + tutorialID) == 1)
        {
            PlayerPrefs.SetInt("FirstPlay" + tutorialID, 0);
            PlayerPrefs.Save();

            tutorialInterface = GetComponent <GUITutorial>();
            currentState      = tutState.BIG;

            foreach (GameObject obj in normalObjects)
            {
                obj.SetActive(false);
            }
        }
        else
        {
            foreach (GameObject obj in normalObjects)
            {
                obj.SetActive(true);
            }
            tutorialCanvas.gameObject.SetActive(false);
        }

        Debug.Log(tutorialID);
        Debug.Log(PlayerPrefs.GetInt("FirstPlay" + tutorialID));
        Debug.Log(PlayerPrefs.GetInt("FirstPlay"));
    }