Пример #1
0
 private void OnAnimEvent(Animator animator, AnimEventPayload animEvent)
 {
     if (animEvent.key == STARS_KEY && animEvent.value == _numStars)
     {
         // TODO: this was a quick hack to splice some animations together
         float delay = _numStars == 3 ? 1.3f : _numStars == 2 ? 0.7f : 0.6f;
         CoroutineRunner.WaitSecondsThenRun(delay, () =>
         {
             animator.StopPlayback();
             animator.enabled = false;
             _tallyAnimation.Play();
         });
     }
 }
Пример #2
0
 /// <summary>
 /// Load the static level config for the given level. The file can be in PersistentDataPath,
 /// StreamingAssets, or Resources, in that order; the first file found will be loaded.
 /// See GetLevelResourceName() for the filename format.
 /// </summary>
 /// <param name="levelIndex">The index of the level config to be loaded.</param>
 /// <param name="callback">Returns the loaded config. Can not be null.</param>
 public static void LoadAsync(int levelIndex, Action <int, LevelConfig> callback)
 {
     CoroutineRunner.Run(LoadAsync_Coroutine(levelIndex, callback));
 }
Пример #3
0
 public static void Initialize()
 {
     CoroutineRunner.Run(LoadWords_Coroutine((wm) => { Words = wm; }));
 }
Пример #4
0
 private void OnDestroy()
 {
     Instance = null;
 }
Пример #5
0
        private void Awake()
        {
            Assert.IsTrue(Instance == null, "[CoroutineRunner] CoroutineRunner is a singleton");

            Instance = this;
        }