// Place this as an instance in a script to get access to any Text element in that script's object. // if null, no text mesh exists in hierarchy or failed to get/add DynamicText script. public static DynamicText GetTextMesh(JDMonoBehavior source) { var textObject = source.GetComponentInChildren<TextMesh>(); if (textObject != null) { DynamicText textual = textObject.GetComponent<DynamicText>(); if (textual == null) { textual = textObject.gameObject.AddComponent<DynamicText>(); } return textual; } return null; }
public JDStateMachineSystem(JDMonoBehavior scriptReference) { this.ScriptReference = scriptReference; scriptReference.ScriptAwake += new MonoScriptEventHandler(ScriptReference_ScriptAwake); scriptReference.ScriptDestroy += new MonoScriptEventHandler(ScriptReference_ScriptDestroy); }
// gets a weapon bar if it exists on this object. public static WeaponBar GetWeaponBar(JDMonoBehavior source) { var bar = source.GetComponentInChildren<WeaponBar>(); return bar; }
public CollisionEventArgs(JDMonoBehavior scriptReference, Collision other) : base(scriptReference) { this.other = other; this.jdOther = new JDCollisionObject(other); }
public MonoScriptEventArgs(JDMonoBehavior scriptReference) { this.script = scriptReference; }