Ejemplo n.º 1
0
    void FixedUpdate()
    {
        StartCoroutine(toggleFootStepsSound());

        if (hInGameScriptCS.isGamePaused() == true)
        {
            stopSound(CharacterSounds.Footsteps);
        }

        if (bPlayFootsteps == true)
        {
            //adjust footsteps pitch according to movement speed
            asCharacterSounds [(int)CharacterSounds.Footsteps].pitch = hControllerScriptCS.getCurrentForwardSpeed() / 3.0f;
            if (bFootstepsPlaying == false)
            {
                if (bSoundEnabled)
                {
                    asCharacterSounds [(int)CharacterSounds.Footsteps].Play();
                }
                bFootstepsPlaying = true;
            }
        }
        else
        {
            if (bFootstepsPlaying == true)
            {
                if (bSoundEnabled)
                {
                    asCharacterSounds [(int)CharacterSounds.Footsteps].Stop();
                }
                bFootstepsPlaying = false;
            }
        }
    }
Ejemplo n.º 2
0
    /*
     *	FUNCTION: Reduce energy if player fell int a pit
     */
    public void setPitValues()
    {
        bPitFallingStart = true;

        hControllerScriptCS.setPitFallLerpValue(Time.time);
        hControllerScriptCS.setPitFallForwardSpeed(hControllerScriptCS.getCurrentForwardSpeed());

        print("Fell in a Pit");
    }