public virtual void OnNewObject() { effectComp = gameObject.GetComponent <EffectComp>(); if (effectComp == null) { effectComp = gameObject.AddComponent <EffectComp>(); } isRecyled = false; }
public virtual void OnRecycle() { if (effectComp != null) { DestroyImmediate(effectComp); effectComp = null; } isRecyled = true; }
static int get_effectComp(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); EntityBehavior obj = (EntityBehavior)o; EffectComp ret = obj.effectComp; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index effectComp on a nil value" : e.Message)); } }