Beispiel #1
0
 IEnumerator CoroutineCreatePartsWhileNeed()
 {
     while (PartsOfWorldManager.CreateNextPartOfWorld())
     {
         ObstaclesManager.CreateObstaclesOnPartOfWorld(GameWorldModel.Instance.PartsOfWorld.ToArray()[GameWorldModel.Instance.PartsOfWorld.Count - 1]);
         yield return(new WaitForEndOfFrame());
     }
     Release();
 }
Beispiel #2
0
        IEnumerator CoroutineWaitForRemove()
        {
            while (Vector3.Distance(PlayerView.Transform.position, LeavedPart.EndPointPosition) < distanceFromEndPointToPlayerForDestroy)
            {
                yield return(new WaitForFixedUpdate());
            }

            ObstaclesManager.RemoveAllObstaclesFromPartOfWorld(GameWorldModel.Instance.PartsOfWorld.Peek());
            PartsOfWorldManager.RemoveOldestPartOfWorld();
            Release();
        }