示例#1
0
 protected override void Awake()
 {
     Text               = CreateGameObject.CreateChildGameObject <ControlText>(transform).GetComponent <ControlText>();
     MainMenuButton     = CreateGameObject.CreateChildGameObject <MainMenuButton>(transform).GetComponent <MainMenuButton>();
     RestartLevelButton = CreateGameObject.CreateChildGameObject <RestartLevelButton>(transform).GetComponent <RestartLevelButton>();
     base.Awake();
 }
示例#2
0
 protected override void Awake()
 {
     _continueButton     = CreateGameObject.CreateChildGameObject <ContinueButton>(transform).GetComponent <ContinueButton>();
     _restartLevelButton = CreateGameObject.CreateChildGameObject <RestartLevelButton>(transform).GetComponent <RestartLevelButton>();
     _optionsButton      = CreateGameObject.CreateChildGameObject <OptionsButton>(transform).GetComponent <OptionsButton>();
     _exitButton         = CreateGameObject.CreateChildGameObject <ExitButton>(transform).GetComponent <ExitButton>();
     _exitButton.onClick.AddListener(_exitButton.OnClickInGame);
     base.Awake();
 }
示例#3
0
    void Awake()
    {
        this.levelController = FindObjectOfType <LevelController>();
        this.nextLevelButton = FindObjectOfType <NextLevelButton>();
        this.nextLevelButton.gameObject.SetActive(false);
        this.restartLevelButton = FindObjectOfType <RestartLevelButton>();
        this.restartLevelButton.gameObject.SetActive(false);

        try
        {
            this.completionMessage        = GameObject.FindGameObjectWithTag("CompletionMessage").GetComponent <Text>();
            this.completionMessagePresent = true;
        }
        catch (System.Exception ex)
        {
            Debug.Log("no completion message, and that is fine");
            Debug.Log(ex.ToString());
        }

        try
        {
            this.scrollInstructions        = FindObjectOfType <ScrollInstructions>().GetComponent <Text>();
            this.scrollInstructionsPresent = true;
        }
        catch (System.Exception ex) {
            Debug.Log("no scroll instructions, and that is fine");
            Debug.Log(ex.ToString());
        }

        try
        {
            this.flingInstructions        = FindObjectOfType <FlingInstructions>().GetComponent <Text>();
            this.flingInstructionsPresent = true;
        }
        catch (System.Exception ex)
        {
            Debug.Log("no fling instructions, and that is fine");
            Debug.Log(ex.ToString());
        }
    }