예제 #1
0
 public void OnTriggerExit2D(Collider2D other)
 {
     if (other.GetComponent <Dialogueable> () != null)
     {
         dialogueAvail = false;
         activeDialogue.FToInteract(false);
     }
     else if (other.GetComponent <SavePoint> () != null)
     {
         other.GetComponent <SavePoint> ().hideSave();
         abilityCont.SaveZone(false);
     }
 }
예제 #2
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.GetComponent <Dialogueable> () != null)
     {
         dialogueAvail  = true;
         activeDialogue = other.gameObject.GetComponent <Dialogueable> ();
         activeDialogue.FToInteract(true);
     }
     else if (other.GetComponent <Door> () != null)
     {
         WalkBetweenRooms(other.GetComponent <Door> ());
     }
     else if (other.GetComponent <PickupItem> () != null)
     {
         if (other.GetComponent <Food>())
         {
             foundFood();
         }
         pickupUIBar.AddItem(other.GetComponent <PickupItem> ());
         Destroy(other.gameObject);
     }
     else if (other.GetComponent <Vent> () != null)
     {
         if (inVent)
         {
             inVent = false;
             ExitVent(other.GetComponent <Vent> ());
         }
         else
         {
             inVent = true;
             EnterVent(other.GetComponent <Vent> ());
         }
     }
     else if (other.GetComponent <Hunter> () != null && !inVent)
     {
         StartCoroutine("HunterAttack", other.GetComponent <Hunter> ());
     }
     else if (other.GetComponent <SavePoint> () != null)
     {
         other.GetComponent <SavePoint> ().revSave();
         abilityCont.SaveZone(true);
     }
 }