public int AddEvent(TLEvent evt) { if (_AllEvents.Count > COUNT_LIMIT) { Common.HobaDebuger.LogWarning("Schedule on " + _Tag + " exceeds limit: " + COUNT_LIMIT); } if (uniID == int.MaxValue) { uniID = int.MinValue; } uniID += 1; evt.KeyID = uniID; _AllEvents.Add(evt); return(uniID); }
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 } } }