示例#1
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.CompareTag("Player") && !npc.IsFighting)
     {
         // Does the player stands in the way of the npc? Then stop moving.
         if (npc.CaulculateFacingDirection(PlayerController.Instance.transform.position) == npc.CurrentFacing)
         {
             npc.WayBlocked = true;
             npc.MoveCharacter(false);
         }
     }
 }