public void Dispatch(object[] args) { try { this.BaseListener?.Invoke(this, args); this.OnceBaseListener?.Invoke(this, args); } catch (Exception ex) { Log.Error(LogGroups.Engine, CoreUtil.FormatExceptionString("BaseSignal", "Trapped listener exception", ex)); } this.OnceBaseListener = null; numOnceListeners = 0; }
public static IEnumerator Flicker(List <GameObject> objects, int flickerCount = 7, float durationFactor = 0.02f, bool reverse = false) { bool active = objects[0].activeSelf; for (int i = 0; i < flickerCount; i++) { active = !active; objects.ForEach(delegate(GameObject o) { o.SetActive(active); }); int num = reverse ? (flickerCount - i) : (i + 1); yield return(CoreUtil.WaitForSecondsOrBreak((float)num * durationFactor)); } }
public void Dispatch() { try { Action listener = this.Listener; if (listener != null) { listener(); } Action onceListener = this.OnceListener; if (onceListener != null) { onceListener(); } } catch (Exception ex) { Log.Error(LogGroups.Engine, CoreUtil.FormatExceptionString("Signal", "Trapped listener exception", ex)); } this.OnceListener = null; numOnceListeners = 0; Dispatch(null); }
public static void LogAssemblyCsharpHash() { Log.Verbose(LogGroups.Engine, CoreUtil.HashToString(CalculateMD5(Path.Combine(Application.dataPath, "Managed", "Assembly-CSharp.dll")))); }