コード例 #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.tag.Equals("Shelter") && other == currentCollider)
     {
         if (!aiming)
         {
             if (characterStatus.isBehindCover && move != 2)
             {
                 if (direction == Direction.right && currentShelter.shelterAngel.rightNeigbor != null)
                 {
                     currentShelter  = currentShelter.shelterAngel.rightNeigbor;
                     currentCollider = currentShelter.GetComponent <BoxCollider>();
                 }
                 else if (direction == Direction.left && currentShelter.shelterAngel.leftNeigbor != null)
                 {
                     currentShelter  = currentShelter.shelterAngel.leftNeigbor;
                     currentCollider = currentShelter.GetComponent <BoxCollider>();
                 }
                 target = currentShelter.playerPoint.position;
                 move   = 1;
             }
             else
             {
                 currentCollider    = null;
                 currentShelter     = null;
                 opportunityToStels = false;
             }
         }
     }
 }