示例#1
0
        void Update()
        {
            //if (EnterNum.Length > ClearNum.Length)
            {
                //	EnterNum = EnterNum.Substring (EnterNum.Length);
                //	NumText.text = EnterNum;
            }

            if (Button1.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "1");
                NumText.text = EnterNum;
            }
            if (Button2.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "2");
                NumText.text = EnterNum;
            }
            if (Button3.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "3");
                NumText.text = EnterNum;
            }
            if (Button4.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "4");
                NumText.text = EnterNum;
            }
            if (Button5.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "5");
                NumText.text = EnterNum;
            }
            if (Button6.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "6");
                NumText.text = EnterNum;
            }
            if (Button6.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "6");
                NumText.text = EnterNum;
            }
            if (Button7.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "7");
                NumText.text = EnterNum;
            }
            if (Button8.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "8");
                NumText.text = EnterNum;
            }
            if (Button9.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "9");
                NumText.text = EnterNum;
            }
            if (Button0.ButtonDown)
            {
                EnterNum     = EnterNum.Insert(EnterNum.Length, "0");
                NumText.text = EnterNum;
            }
            if (ButtonEscape.ButtonDown)
            {
                this.gameObject.SetActive(false);
                EnterNum      = EnterNum.Substring(EnterNum.Length);
                NumText.text  = EnterNum;
                MessText.text = EnterNum;
                ButtonEscape.GetComponent <NVRButton>().ButtonDown     = false;
                ButtonEscape.GetComponent <NVRButton>().ButtonIsPushed = false;
            }


            if (ButtonEnter.ButtonDown)
            {
                //	if (EnterNum.Length == ClearNum.Length)
                {
                    if (ClearNum == EnterNum)
                    {
                        EscapeSuceess();
                        NumText.text = EnterNum;
                    }
                    else
                    {
                        MessText.text = "실패";
                        Invoke("PuzzleRe", 2f);
                        //PuzzleRe();
                        NumText.text = null;
                    }
                }

                //		if (EnterNum.Length != ClearNum.Length)
                {
                    EnterNum     = EnterNum.Substring(EnterNum.Length);
                    NumText.text = null;
                }
            }
            if (ButtonDelete.ButtonDown)
            {
                if (EnterNum.Length > 0)
                {
                    EnterNum     = EnterNum.Substring(0, EnterNum.Length - 1);
                    NumText.text = EnterNum;
                }
            }
        }
示例#2
0
 private void Awake()
 {
     initialColor  = gameButton1.GetComponent <Renderer>().materials[0].color;
     emissionColor = gameButton1.gameObject.GetComponent <Renderer>().materials[0].GetColor("_EmissionColor");
 }