private void StartPlay() { _IsPlaying = true; gameObject.SetActive(true); //If using rectMask2D UISFxAreaClip sfx_clip = GetComponent <UISFxAreaClip>(); if (sfx_clip != null) { sfx_clip.UpdateFxObject(false); } if (_Duration <= 0) { FxDuration fd = _FxObject.GetComponent <FxDuration>(); if (fd != null) { _Duration = fd.duration; } } // adapted to the new FX recycle mechanism by LiJian _AutoPlayComp = _FxObject.GetComponent <AutoPlayFx>(); if (_AutoPlayComp == null) { _AutoPlayComp = _FxObject.AddComponent <AutoPlayFx>(); } _AutoPlayComp.enabled = true; if (_Duration > 0) { Invoke("StopPlay", _Duration); } //_LastStopTime = Time.time; #if IN_GAME if (_OnCreateLuaCB != null) { _OnCreateLuaCB.Call(gameObject); _OnCreateLuaCB.Release(); _OnCreateLuaCB = null; } #endif }
private void SetOnLoadCallBack(LuaInterface.LuaFunction luaCall) { if (_FxObject != null) { if (luaCall != null) { luaCall.Call(gameObject); luaCall.Release(); } } else { _OnCreateLuaCB = luaCall; } }