public void OnTriggerExit2D(Collider2D C2D) { if (C2D.GetComponent <InputArea>() && C2D.GetComponent <InputArea>() == CurrentArea) { Deactivate(); } if (C2D.GetComponent <InterObject>()) { InterObject IO = C2D.GetComponent <InterObject>(); if (InterObjects.Contains(IO)) { InterObjects.Remove(IO); } } if (C2D.GetComponent <ChoiceRenderer>()) { ChoiceRenderer CR = C2D.GetComponent <ChoiceRenderer>(); if (CRs.Contains(CR)) { CRs.Remove(CR); } } if (C2D.GetComponent <NPC>() && SelectingNPC == C2D.GetComponent <NPC>()) { SelectingNPC = null; } }
public void OnTriggerEnter2D(Collider2D C2D) { if (Room.Current) { if (C2D.GetComponent <InputArea>()) { CanInput = true; CurrentArea = C2D.GetComponent <InputArea>(); } if (C2D.GetComponent <InterObject>()) { InterObject IO = C2D.GetComponent <InterObject>(); if (!InterObjects.Contains(IO)) { InterObjects.Add(IO); } } if (C2D.GetComponent <ChoiceRenderer>()) { ChoiceRenderer CR = C2D.GetComponent <ChoiceRenderer>(); if (!CRs.Contains(CR)) { CRs.Add(CR); } } if (C2D.GetComponent <NPC>()) { SelectingNPC = C2D.GetComponent <NPC>(); } } }
public void CreateChoicesPanel(InterObject IO) { GameObject G = Instantiate(ChoicesPanelPrefab, IO.GetPanelTransform()); G.transform.position = IO.GetPanelPosition(); G.GetComponent <ChoicesPanel>().IO = IO; IO.CP = G.GetComponent <ChoicesPanel>(); }
public void StartInterObject(InterObject IO) { string s = IO.GetCharacterAnimKey(); if (s != "") { SetBoolAnim(s); } }
public void DisruptInterObject() { TargetInterObject = null; StopCoroutine("IODelayAnim"); if (ActiveInterObject) { AC.StopInterObject(); ActiveInterObject.Disable(); ActiveInterObject = null; } }
public void SetTargetInterObject(InterObject IO) { if (!IO || TargetInterObject == IO) { return; } TargetInterObject = IO; if (IO.GetInterPosition().x < transform.position.x) { MoveTargetDirection = Direction.Left; } else if (IO.GetInterPosition().x > transform.position.x) { MoveTargetDirection = Direction.Right; } MoveTargeting = true; }
public InterObject GetSelectingInterObject() { if (InterObjects.Count <= 0) { return(null); } InterObject Temp = null; float a = float.PositiveInfinity; for (int i = InterObjects.Count - 1; i >= 0; i--) { if (!InterObjects[i] || !InterObjects[i].IsActive()) { continue; } if ((transform.position - InterObjects[i].transform.position).magnitude < a) { Temp = InterObjects[i]; a = (transform.position - InterObjects[i].transform.position).magnitude; } } return(Temp); }
public void ActivateInterObject(InterObject IO) { AC.StartInterObject(IO); ActiveInterObject = IO; IO.Activate(); }