public int AddPlayFx(string s_key, float f_time, string s_path, Transform t_hook, Transform t_target, GameObject g_clipper, float f_lifeTime, int i_order) { TLEvent tl = new UEvtUIFx() { StartTime = f_time, KeyName = s_key, Path = s_path, Holder = t_hook, Target = t_target, Clipper = g_clipper, LifeTime = f_lifeTime, OrderOffset = i_order }; return(AddEvent(tl)); }
public void ExcEvent(TLEvent evt) { if (evt.EvtType == UEEventType.PlayAnim) { UEvtAnim block = evt as UEvtAnim; if (block != null && block.Anim != null) { block.Anim.Play(block.Path); } } else if (evt.EvtType == UEEventType.PlayDotween) { UEvtDot block = evt as UEvtDot; if (block != null && block.DotPlayer != null) { block.DotPlayer.Restart(block.Id); } } else if (evt.EvtType == UEEventType.UIFx) { UEvtUIFx block = evt as UEvtUIFx; if (block != null) { GNewUITools.PlayFx(block.Holder, block.Target, block.Clipper, block.Path, block.LifeTime, true, block.OrderOffset); } } else if (evt.EvtType == UEEventType.SetActive) { UEvtActive block = evt as UEvtActive; if (block != null && block.Go != null) { block.Go.SetActive(block.ActiveState); } } else if (evt.EvtType == UEEventType.ShakeScreen) { UEvtShake block = evt as UEvtShake; if (block != null) { CameraShaker cs = Main.PanelRoot.GetComponent <CameraShaker>(); if (cs != null) { cs.ShakeOnce(block.Mag, 10, 0.15f, 0.15f, block.LifeTime, "ui"); } } } else if (evt.EvtType == UEEventType.Lua) { UEvtLua block = evt as UEvtLua; if (block != null && block.LuaFunc != null) { block.LuaFunc.Call(); } } else if (evt.EvtType == UEEventType.UISound) { UEvtUISound block = evt as UEvtUISound; if (block != null) { #if IN_GAME ISoundMan soundMan = EntryPoint.Instance.SoundMan; if (soundMan != null) { soundMan.Play2DAudio(block.Path); } #endif } } }