Пример #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Water")
     {
         state = WalkingStates.Swimming;
     }
 }
Пример #2
0
 void OnTriggerExit(Collider other)
 {
     if (other.tag == "Water")
     {
         state = WalkingStates.Normal;
     }
 }
Пример #3
0
 void Start()
 {
     animator   = transform.GetChild(0).GetComponent <Animator> ();
     cameraT    = Camera.main.transform;
     controller = GetComponent <CharacterController> ();
     state      = WalkingStates.Normal;
 }