Пример #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.transform.GetComponent <CharacterController>() != null)
     {
         BuildingTopColliderManage manager = BuildingTopColliderManage.Instance;
         if (manager && !manager.IsColliderExist(this))
         {
             manager.TopColliders.Add(this);
             BuildingTopColliderManage.IsInBuildingRoof = true;
             PersonExit();
         }
     }
 }
Пример #2
0
 private void OnTriggerExit(Collider other)
 {
     if (other.transform.GetComponent <CharacterController>() != null)
     {
         BuildingTopColliderManage manager = BuildingTopColliderManage.Instance;
         if (manager)
         {
             if (manager.IsColliderExist(this))
             {
                 manager.TopColliders.Remove(this);
             }
             if (manager.TopColliders.Count == 0)
             {
                 BuildingTopColliderManage.IsInBuildingRoof = false;
             }
             PersonEnter();
         }
     }
 }