コード例 #1
0
    //Controls for development.
    public void TestControls()
    {
        //if(Application.isEditor || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.WindowsPlayer)
        if (true)
        {
            //We will just add on a bit of heat as we press the H button
            if (Input.GetKey(KeyCode.H))
            {
                //Bot_01.Damage(55.0f);
                CommandCenter_01.Damage(55.0f);
            }


            if (Input.GetKeyDown(KeyCode.M))
            {
                //GameObjectTracker.instance._PlayerData.GemBank += 1000;

                ActivityManager.Instance.FadeToBlack();
            }

            //We will just add on a bit of heat as we press the H button
            if (Input.GetKey(KeyCode.C))
            {
                Bot_01.Cool(50.0f);
            }

            if (Input.GetKeyDown(KeyCode.P))
            {
                foreach (string s in Input.GetJoystickNames())
                {
                    print(s);
                }
            }

            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                ClearFreeCannons();
            }


            if (Input.GetKeyDown(KeyCode.Alpha0))
            {
                AssignCannonSlotTypes();
            }


            if (Input.GetButtonDown("Shoot"))
            {
                Bot_01.Shoot();
                //AnimateAttack();
            }

            if (Input.GetButtonDown("OverHeat"))
            {
                Bot_01.AddHeat(1000.0f);
            }

            if (Input.GetButtonDown("Shield") || Input.GetKeyDown(KeyCode.B))
            {
                Bot_01.ActivateDefense();
            }

            if (Input.GetButtonUp("Shield") || Input.GetKeyUp(KeyCode.B))
            {
                Bot_01.DeactivateDefense();
            }

            //Absolute Input controls for testing purposes
            if (Input.GetAxis("Horizontal") < 0.0f || Input.GetKeyDown(KeyCode.A))
            {
                movingDirection += -(Vector3.right) * -Input.GetAxis("Horizontal");
            }
            if (Input.GetAxis("Horizontal") > 0.0f || Input.GetKeyDown(KeyCode.D))
            {
                movingDirection += (Vector3.right) * Input.GetAxis("Horizontal");
                ;
            }

            if (Input.GetAxis("Vertical") > 0.0f || Input.GetKeyDown(KeyCode.W))
            {
                movingDirection += (Vector3.forward) * Input.GetAxis("Vertical");
            }

            if (Input.GetAxis("Vertical") < 0.0f || Input.GetKeyDown(KeyCode.S))
            {
                movingDirection += -(Vector3.forward) * -Input.GetAxis("Vertical");
            }
        }

        //movingDirection.Normalize();
    }