예제 #1
0
 void OnTriggerExit(Collider col)
 {
     if (col.gameObject.layer == 9)
     {
         moveChar characterMove = col.GetComponent <moveChar>();
         characterMove.useGrav = true;
     }
 }
예제 #2
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.layer == 9)
     {
         moveChar characterMove = col.GetComponent <moveChar>();
         characterMove.useGrav    = false;
         characterMove.movement.y = 0;
     }
 }
예제 #3
0
 void OnTriggerStay(Collider col)
 {
     if (col.gameObject.layer == 9)
     {
         CharacterController character     = col.GetComponent <CharacterController>();
         moveChar            characterMove = col.GetComponent <moveChar>();
         characterMove.movement.y = 0;
         characterMove.useGrav    = false;
         character.Move((transform.right).normalized * force * Time.deltaTime);
     }
 }