//================================================================================================


    void FunctionBT_Main(Collider other)
    {
        if (!DataMenu.bCreateName && !DataMenu.bMakeAlert)
        {
            if (DataMenu.CheckTriger(other))
            {
                GetComponent <Renderer>().material = DataMenu.mMain[2];
                if (this.gameObject.name.Equals("ButtonCreateName"))
                {
                    MakeKeyBoard();
                }
                else if (this.gameObject.name.Equals("ButtonPlay"))
                {
                    PlayGame();
                }
                else if (this.gameObject.name.Equals("ButtonQuit"))
                {
                    Application.Quit();
                }
                else if (this.gameObject.name.Equals("ButtonHTP"))
                {
                    //Destroy(gPlayer.gameObject);
                    SceneManager.LoadScene("How to play game");
                }
            }
            else
            {
                this.gameObject.GetComponent <Renderer>().material = DataMenu.mMain[1];
            }
        }
    }
Beispiel #2
0
    //================================================================================================


    void FunctionBT_KeyBoard(Collider other)
    {
        if (DataMenu.CheckTriger(other) && fTime <= 0f)
        {
            //Debug.Log(this.gameObject.name);
            fTime = 0.3f;


            if (this.gameObject.name.Length == 1)
            {
                this.GetComponent <Renderer>().material = DataMenu.mKeyBoard[2];
                //Debug.Log("Use SelectChar()");
                SelectChar();
            }
            else if (this.gameObject.name.Equals("Remove"))
            {
                this.GetComponent <Renderer>().material = mRemove[2];
                //Debug.Log("Use RemoveChar()");
                RemoveChar();
            }
            else if (this.gameObject.name.Equals("Select"))
            {
                this.GetComponent <Renderer>().material = DataMenu.mMain[2];
                //Debug.Log("Use SelectName()");
                SelectName();
            }
            else if (this.gameObject.name.Equals("Exit"))
            {
                this.GetComponent <Renderer>().material = DataMenu.mMain[2];
                //Debug.Log("Use ExitKeyBoard()");
                ExitKeyBoard();
            }
        }
        else
        {
            if (this.gameObject.name.Equals("Remove"))
            {
                this.GetComponent <Renderer>().material = mRemove[1];
            }
            else if (this.gameObject.name.Length == 1)
            {
                this.GetComponent <Renderer>().material = DataMenu.mKeyBoard[1];
            }
            else
            {
                this.GetComponent <Renderer>().material = DataMenu.mMain[1];
            }
        }
    }