Ejemplo n.º 1
0
    // 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;
    }
Ejemplo n.º 2
0
    public JDStateMachineSystem(JDMonoBehavior scriptReference)
    {
        this.ScriptReference = scriptReference;

        scriptReference.ScriptAwake += new MonoScriptEventHandler(ScriptReference_ScriptAwake);
        scriptReference.ScriptDestroy += new MonoScriptEventHandler(ScriptReference_ScriptDestroy);
    }
Ejemplo n.º 3
0
 // gets a weapon bar if it exists on this object.
 public static WeaponBar GetWeaponBar(JDMonoBehavior source)
 {
     var bar = source.GetComponentInChildren<WeaponBar>();
     return bar;
 }
Ejemplo n.º 4
0
 public CollisionEventArgs(JDMonoBehavior scriptReference, Collision other)
     : base(scriptReference)
 {
     this.other = other;
     this.jdOther = new JDCollisionObject(other);
 }
Ejemplo n.º 5
0
 public MonoScriptEventArgs(JDMonoBehavior scriptReference)
 {
     this.script = scriptReference;
 }