/// <summary> /// Ensures that a MonoBehaviour script exists on the GameObject. /// </summary> public static TMonoBehaviour Exists <TMonoBehaviour>(this HUMValue.Data.MBehaviour mono, out TMonoBehaviour component) where TMonoBehaviour : MonoBehaviour { component = mono.ensure.target.GetComponent <TMonoBehaviour>(); if (component == null) { component = mono.ensure.target.AddComponent <TMonoBehaviour>(); } return(component); }
/// <summary> /// Begins the operation of checking interfaces with MonoBehaviours. /// </summary> public static HUMValue.Data.Interface Interface(this HUMValue.Data.MBehaviour ensureMono) { return(new HUMValue.Data.Interface(ensureMono)); }