Esempio n. 1
0
 private void Start()
 {
     _controller       = GetComponent <CharacterController>(); //assign the reference variable to the component
     _fpsCamera        = GetComponentInChildren <Camera>();
     _initialCameraPos = _fpsCamera.transform.localPosition;
     _anim             = transform.Find("Main Camera").GetComponentInChildren <Animator>();
     _footstepSFX      = transform.Find("Main Camera").GetComponentInChildren <FootstepSFX>();
     Cursor.visible    = false;
 }
    // Use this for initialization
    void Start()
    {
        flipSource = GameObject.Find("Flip SFX").GetComponent <AudioSource>();

        levelScript   = GameObject.Find("LevelController").GetComponent <LevelController>();
        trigSFXscript = GameObject.Find("Triggered SFX").GetComponent <TriggeredSFX>();
        footSFXscript = GameObject.Find("Footstep SFX").GetComponent <FootstepSFX>();

        levelScript.masterVol     = masterVol;
        levelScript.musicVol      = innerGameVol * musicVol;
        levelScript.checkpointVol = innerGameVol * checkpointVol;

        flipSource.volume = innerGameVol * flipVol;

        trigSFXscript.landingVol      = innerGameVol * landingVol;
        trigSFXscript.flipDisabledVol = innerGameVol * flipDisabledVol;
        trigSFXscript.keyVol          = innerGameVol * keyVol;
        trigSFXscript.doorVol         = innerGameVol * doorVol;

        footSFXscript.volume = innerGameVol * footstepVol;

        currInnerVol = innerGameVol;
    }