Esempio n. 1
0
        public static Coroutine everyFrame(this GameObject go, Fn <bool> f)
        {
            var behaviour =
                go.GetComponent <ASyncHelperBehaviour>() ??
                go.AddComponent <ASyncHelperBehaviour>();

            return(ASync.EveryFrame(behaviour, f));
        }
Esempio n. 2
0
 public RegionClickObservable(int gridWidth = 2, int gridHeight = 2)
 {
     this.gridWidth  = gridWidth;
     this.gridHeight = gridHeight;
     ASync.EveryFrame(() => {
         onUpdate();
         return(true);
     });
 }
Esempio n. 3
0
        /* Initialization. */
        static OnMainThread()
        {
            mainThread = Thread.CurrentThread;
            if (Application.isPlaying)
            {
                // In players isPlaying is always true.
                ASync.EveryFrame(onUpdate);
            }
#if UNITY_EDITOR
            else
            {
                UnityEditor.EditorApplication.update += () => onUpdate();
            }
#endif
        }
Esempio n. 4
0
        /* Initialization. */
        static OnMainThread()
        {
            mainThread = Thread.CurrentThread;
#if UNITY_EDITOR
            if (Application.isPlaying)
            {
                ASync.EveryFrame(onUpdate);
            }
            else
            {
                EditorApplication.update += () => onUpdate();
            }
#else
            ASync.EveryFrame(onUpdate);
#endif
        }
Esempio n. 5
0
 public static Coroutine everyFrame(this GameObject go, Fn <bool> f) => ASync.EveryFrame(go, f);
Esempio n. 6
0
 /* Initialization. */
 static OnMainThread()
 {
     mainThread = Thread.CurrentThread;
     ASync.EveryFrame(onUpdate);
 }
Esempio n. 7
0
 /* Initialization. */
 static OnMainThread()
 {
     ASync.EveryFrame(onUpdate);
 }