コード例 #1
0
    /*
     *	FUNCTION: Called when user runs out of energy
     *	CALLED BY:	Update()
     */
    private bool DeathScene()
    {
        bInAir = false;
        tPlayerRotation.localEulerAngles = new Vector3(0, 0, 0);

        if (fDeathAnimStartTime == 0)
        {
            hSoundManagerCS.stopSound(SoundManagerCS.CharacterSounds.Footsteps);
            bControlsEnabled = false;

            /*Vector3 v3EffectPosition = this.transform.position;
             * v3EffectPosition.x += 15;
             * v3EffectPosition.y += 5;*/

            if (!mecanimEnabled)            //if legacy animations enabled
            {
                aPlayer.CrossFade("death", 0.1f);
            }
            else            //if mecanim enabled
            {
                aPlayerMecAnim.SetBool("DeathAnim", true);
                aPlayerMecAnim.SetBool("RunAnim", false);
            }
            hEnemyControllerCS.playDeathAnimation();

            if (hInGameScriptCS.isCustomMenuEnabled())
            {
                hMenuScriptCS.hideHUDElements();
            }

            fDeathAnimStartTime = Time.time;
        }
        else if (fDeathAnimStartTime != 0 && (Time.time - fDeathAnimStartTime) >= iDeathAnimEndTime)
        {
            hInGameScriptCS.setupDeathMenu();
            return(true);
        }

        return(false);
    }