/// <summary>Ends the introducable</summary> public void End() { if (introducableObject != null) { introducableObject.EndIntroduction(); introducableObject = null; } }
/// <summary>Updates the introducable by either starting or ending the it based on given index</summary> public void Update(int indexAt) { if (indexAt == fromIndex) { introducableObject = GetIntroducable(); introducableObject.StartIntroduction(); } else if (indexAt == ToIndex) { End(); } }
/// <summary>Returns the introducable object behaviour in the scene based on stored tagname</summary> private IntroducableObject GetIntroducable() { foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag(IntroducableObject.COMPONENT_TAG_NAME)) { IntroducableObject introducable = gameObject.GetComponent <IntroducableObject>(); if (introducable.IntroTagName == tagName) { return(introducable); } } return(null); }