Exemple #1
0
 public Promise Then(Action action)
 {
     onResolve.AddListenerOneShot(action);
     if (isResolved)
     {
         onResolve.Invoke();
     }
     return(this);
 }
Exemple #2
0
 public Promise Catch(Action <Exception> action)
 {
     onReject.AddListenerOneShot(action);
     if (isRejected)
     {
         onReject.Invoke(cachedException);
     }
     return(this);
 }
Exemple #3
0
 public Promise <T> Then(Action <T> action)
 {
     onResolve.AddListenerOneShot(action);
     if (isResolved)
     {
         onResolve.Invoke(cache);
     }
     return(this);
 }
Exemple #4
0
 private void OnDrawGizmos()
 {
     onDrawGizmos.Invoke();
     drawGizmos.Invoke();
     drawGizmosFixed.ToArray().ForEach(kvp => kvp.action());
     drawGizmosFixed = drawGizmosFixed
                       .Where(fsa => fsa.frameStamp >= lastFixedFrameCount)
                       .ToList();
 }
Exemple #5
0
/*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));
 }
Exemple #7
0
 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());
 }
Exemple #8
0
 void Awake()
 {
     if (Application.isEditor)
     {
         onApplicationEditor.Invoke();
     }
     if (Application.isMobilePlatform)
     {
         onApplicationMobile.Invoke();
     }
     awake.Invoke();
     onAwake.Invoke();
 }
Exemple #9
0
 private void FixedUpdate()
 {
     fixedUpdate.Invoke();
     onFixedUpdate.Invoke();
     lastFixedFrameCount = Time.frameCount;
 }
Exemple #10
0
 private void Update()
 {
     update.Invoke();
     onUpdate.Invoke();
 }
Exemple #11
0
 private void Start()
 {
     start.Invoke();
     onStart.Invoke();
 }