Beispiel #1
0
        void Update()
        {
            // Using the state settings defined above
            if (Input.GetKeyDown(KeyCode.K))
            {
                puppetMaster.Kill(stateSettings);
            }
            if (Input.GetKeyDown(KeyCode.F))
            {
                puppetMaster.Freeze(stateSettings);
            }
            if (Input.GetKeyDown(KeyCode.R))
            {
                puppetMaster.Resurrect();
            }

            // Using whatever the current state settings of the puppetMaster instance

            /*
             * if (Input.GetKeyDown(KeyCode.K)) puppetMaster.state = PuppetMaster.State.Dead;
             * if (Input.GetKeyDown(KeyCode.F)) puppetMaster.state = PuppetMaster.State.Frozen;
             * if (Input.GetKeyDown(KeyCode.R)) puppetMaster.state = PuppetMaster.State.Alive;
             */

            // Using default state settings

            /*
             * if (Input.GetKeyDown(KeyCode.K)) puppetMaster.Kill(PuppetMaster.StateSettings.Default);
             * if (Input.GetKeyDown(KeyCode.F)) puppetMaster.Freeze(PuppetMaster.StateSettings.Default);
             * if (Input.GetKeyDown(KeyCode.R)) puppetMaster.Resurrect();
             */
        }