public Promise Then(Action action) { onResolve.AddListenerOneShot(action); if (isResolved) { onResolve.Invoke(); } return(this); }
public Promise Catch(Action <Exception> action) { onReject.AddListenerOneShot(action); if (isRejected) { onReject.Invoke(cachedException); } return(this); }
public Promise <T> Then(Action <T> action) { onResolve.AddListenerOneShot(action); if (isResolved) { onResolve.Invoke(cache); } return(this); }
private void OnDrawGizmos() { onDrawGizmos.Invoke(); drawGizmos.Invoke(); drawGizmosFixed.ToArray().ForEach(kvp => kvp.action()); drawGizmosFixed = drawGizmosFixed .Where(fsa => fsa.frameStamp >= lastFixedFrameCount) .ToList(); }
/*AUTO SCRIPT*/ /*AUTO SCRIPT*/ /*AUTO SCRIPT*/ /*AUTO SCRIPT*/ public void Invoke(Texture2D val) /*AUTO SCRIPT*/ { /*AUTO SCRIPT*/ if (debug) { /*AUTO SCRIPT*/ Debug.Log($"{name} event invoked: {val}"); } /*AUTO SCRIPT*/ ahoyEvent.Invoke(val); /*AUTO SCRIPT*/ //important to do this incase a listener removes its self from the list /*AUTO SCRIPT*/ unityEventListeners.ToArray().ForEach(l => l.Invoke(val)); /*AUTO SCRIPT*/ assetEventListeners.ToArray().ForEach(l => l.Invoke(val)); /*AUTO SCRIPT*/ }
public void Invoke(gen010 val) { if (debug) { Debug.Log($"{name} event invoked: {val}"); } ahoyEvent.Invoke(name, val); //important to do this incase a listener removes its self from the list unityEventListeners.ToArray().ForEach(l => l.Invoke(name, val)); assetEventListeners.ToArray().ForEach(l => l.Invoke(val)); }
public override void Invoke() { if (debug) { Debug.Log($"{name} event invoked"); } //important to do this incase a listener removes its self from the list ahoyEvent.Invoke(); unityEventListeners.ToArray().ForEach(l => l.Invoke()); assetEventListeners.ToArray().ForEach(l => l.Invoke()); }
void Awake() { if (Application.isEditor) { onApplicationEditor.Invoke(); } if (Application.isMobilePlatform) { onApplicationMobile.Invoke(); } awake.Invoke(); onAwake.Invoke(); }
private void FixedUpdate() { fixedUpdate.Invoke(); onFixedUpdate.Invoke(); lastFixedFrameCount = Time.frameCount; }
private void Update() { update.Invoke(); onUpdate.Invoke(); }
private void Start() { start.Invoke(); onStart.Invoke(); }