コード例 #1
0
    void Awake()
    {
        locationName = SceneManager.GetActiveScene().name;
        Debug.Log("Setting location name to: " + locationName);
        mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript>();
        ds    = mcRef.getStorage();

        rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> ();

        GameObject PlayerGO = GameObject.Find("Player");

        if (PlayerGO != null)
        {
            player = PlayerGO.GetComponent <PlayerScript> ();
        }

        footstepMngr = GameObject.Find("FootstepSoundManager").GetComponent <FootstepSoundManager> ();

        GameObject cam = GameObject.Find("Main Camera");

        if (cam != null)
        {
            cameraGrab = cam.GetComponent <CameraUtils> ();
        }

        string savedSound = ds.retrieveStringValue("GroundType");

        if (!savedSound.Equals(""))
        {
            footstepMngr.setGroundType(savedSound);
        }
        else
        {
            if (!groundType.Equals(""))
            {
                footstepMngr.setGroundType(groundType);
            }
        }

        aSource = this.GetComponent <AudioSource> ();
    }
コード例 #2
0
 void OnTriggerEnter(Collider other)
 {
     if (RecoilRemain > 0.0f)
     {
         return;
     }
     if (!enabled)
     {
         return;
     }
     if (other.tag == "Player")
     {
         int FootstepLevel = lvl.retrieveIntValue("FootstepTriggerLevel");
         ++FootstepLevel;
         lvl.storeIntValue("FootstepTriggerLevel", FootstepLevel);
         Debug.Log("FSTLevel: " + FootstepLevel);
         if (!groundType.Equals(""))
         {
             Debug.Log("Setting sound: " + groundType);
             footsoundMgr.setGroundType(groundType);
         }
     }
 }