void Start() { CharacterPos = Char2.transform.localPosition; HidePos = Char1.transform.localPosition; Char1Renderer = Char1.GetComponent <SpriteRenderer>(); Char2Renderer = Char2.GetComponent <SpriteRenderer>(); Char3Renderer = Char3.GetComponent <SpriteRenderer>(); }
public bool Died(GameObject who) { //GameObject Send = Char2; if (Comment) { print(Char1); } if (Comment) { print(Char2); } if (Char1 != null && Char1.activeSelf) { if (Char1.GetInstanceID() == who.GetInstanceID()) { Char1_List.Clear(); } else if (Char1.GetComponent <AI> ().enabled&& Char1.GetComponent <AI> ().target_GO.GetInstanceID() == who.GetInstanceID()) { Char1.GetComponent <AI> ().target_GO = null; } } if (Char2 != null && Char2.activeSelf) { if (Char2.GetInstanceID() == who.GetInstanceID()) { Char2_List.Clear(); } else if (Char2.GetComponent <AI> ().enabled&& !Char2.GetComponent <AI> ().target_GO&& Char2.GetComponent <AI> ().target_GO != null && Char2.GetComponent <AI> ().target_GO.GetInstanceID() == who.GetInstanceID()) { Char2.GetComponent <AI> ().target_GO = null; } } Graveyard_List.Add(who); Char1_List.Remove(who); Char2_List.Remove(who); if (!who.GetComponent <CharController>().itsItem) { who.GetComponent <AI>().target_GO = null; } who.SetActive(false); return(Graveyard_List[Graveyard_List.Count - 1] == who); }