Beispiel #1
0
        private void Awake()
        {
            Shader.SetGlobalFloat("_DepthFadeStart", -1f);
            Shader.SetGlobalFloat("_DepthFadeEnd", -5f);
            Shader.SetGlobalVector("_BGColor", Color.black);
            Shader.SetGlobalFloat("_RevealRadius", 1000f);
            Camera.main.backgroundColor = Color.black;

            playBtn            = transform.Find("Play").GetComponent <PhysicalButton>();
            playBtn.onClick   += PlayClicked;
            selectBtn          = transform.Find("LevelSelect").GetComponent <PhysicalButton>();
            selectBtn.onClick += SelectClicked;
            quitBtn            = transform.Find("Quit").GetComponent <PhysicalButton>();
            quitBtn.onClick   += QuitClicked;
            qwertyBtn          = transform.Find("QWERTY").GetComponent <PhysicalButton>();
            qwertyBtn.onClick += QwertyClicked;
            azertyBtn          = transform.Find("AZERTY").GetComponent <PhysicalButton>();
            azertyBtn.onClick += AzertyClicked;
            titleObj           = transform.Find("Title").Find("default").gameObject;

            TransitionManager.I.FadeFromBlack(1.5f, null, .5f);

            if (InputManager.mode == InputManager.Mode.ForceAZERTY)
            {
                azertyBtn.transform.position -= Vector3.up * 0.25f;
            }
            else if (InputManager.mode == InputManager.Mode.ForceQWERTY)
            {
                qwertyBtn.transform.position -= Vector3.up * 0.25f;
            }
        }
Beispiel #2
0
 private void ButtonClicked(PhysicalButton btn)
 {
     if (levelToLoad != "")
     {
         return;
     }
     TransitionManager.I.FadeToBlack(1f, FadeEnded);
     levelToLoad = btn.gameObject.name;
 }
Beispiel #3
0
        private void Awake()
        {
            buttonRoot  = transform.Find("HangingButton");
            hangingUp   = transform.Find("HangingUp");
            hangingDown = transform.Find("HangingDown");
            hangTarget  = transform.Find("HangTarget");

            backToMenu          = buttonRoot.Find("BackToMenu").GetComponent <PhysicalButton>();
            backToMenu.onClick += BackToMenuClicked;
        }
Beispiel #4
0
        private void Awake()
        {
            levelBtns = new PhysicalButton[10];             // unsafe
            foreach (Transform child in transform)
            {
                if (!child.gameObject.name.StartsWith("Level"))
                {
                    continue;
                }
                PhysicalButton btn = child.GetComponent <PhysicalButton>();
                levelBtns[int.Parse(child.gameObject.name.Substring(5)) - 1] = btn;
                btn.onClickRef += ButtonClicked;
            }
            backBtn          = transform.Find("Back").GetComponent <PhysicalButton>();
            backBtn.onClick += BackClicked;

            titleObj = transform.Find("SelectionTitle").Find("default").gameObject;
        }