Beispiel #1
0
    static public LuaListener Get(Component com)
    {
        LuaListener listener = com.GetComponent <LuaListener>();

        if (listener == null)
        {
            listener = com.gameObject.AddComponent <LuaListener>();
        }
        return(listener);
    }
Beispiel #2
0
    static public LuaListener Get(GameObject go)
    {
        LuaListener listener = go.GetComponent <LuaListener>();

        if (listener == null)
        {
            listener = go.AddComponent <LuaListener>();
        }
        return(listener);
    }
Beispiel #3
0
    static public LuaListener Get(Transform trans)
    {
        LuaListener listener = trans.GetComponent <LuaListener>();

        if (listener == null)
        {
            listener = trans.gameObject.AddComponent <LuaListener>();
        }
        return(listener);
    }
Beispiel #4
0
    static public LuaListener Get(GameObject go, object data)
    {
        LuaListener listener = go.GetComponent <LuaListener>();

        if (listener == null)
        {
            listener = go.AddComponent <LuaListener>();
        }
        listener.data = data;
        return(listener);
    }
Beispiel #5
0
    static public LuaListener Get(Component com, object data)
    {
        LuaListener listener = com.GetComponent <LuaListener>();

        if (listener == null)
        {
            listener = com.gameObject.AddComponent <LuaListener>();
        }
        listener.data = data;
        return(listener);
    }