コード例 #1
0
 // Use this for initialization
 void Start()
 {
     instance             = this;
     soundProfile         = GameObject.Find("GameManager").GetComponent <SoundManager>().soundProfile;
     hurtAudioSource.clip = soundProfile.heartbeatSound;
     hurtAudioSource.Play();
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     controller   = GetComponent <CharacterController>();
     player       = GetComponent <PlayerController>();
     soundProfile = GameObject.Find("GameManager").GetComponent <SoundManager>().soundProfile;
     InvokeRepeating("GetSurfaceSound", 0, 0.1f); // As getting terrain material is complex algorithm, we will can that function each 0.5s for optimization
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     soundProfile    = GameObject.Find("GameManager").GetComponent <SoundManager>().soundProfile;
     controller      = GetComponent <CharacterController>();
     playerTransform = transform;
     rayDistance     = controller.height / 2 + 1.1f;
     slideLimit      = controller.slopeLimit;
     mouseLook.Init(playerTransform, mainCam.transform);
 }