//THIS ONLY GETS CALLED THE FIRST TIME IT'S ACTIVATED void Start() { characterAsMove = GetComponent <Character>() as IMove; if (characterAsMove == null) { Debug.LogWarning("Wander State set on an object (" + name + ") that does not have a Character component that implements IMove."); } characterAsAI = GetComponent <Character>() as IHaveAI; if (characterAsAI == null) { Debug.LogWarning("Wander State set on an object (" + name + ") that does not have a Character component that implements IHaveAI."); } SetMaterial(); }
void Start() { character = GetComponent <Character>(); characterAsMove = GetComponent <Character>() as IMove; if (characterAsMove == null) { Debug.LogWarning("Chase State set on an object (" + name + ") that does not have a Character component that implements IMove."); } characterAsAI = GetComponent <Character>() as IHaveAI; if (characterAsAI == null) { Debug.LogWarning("Chase State set on an object (" + name + ") that does not have a Character component that implements IHaveAI."); } target = characterAsAI.Target.gameObject.GetComponent <Character>() as IHaveStats; if (target == null) { Debug.LogWarning("Target set on an object (" + name + ") that does not have a Character component that implements IHaveStats."); } SetMaterial(); }