Example #1
0
    public void LoadNextWorld()
    {
        _currentWorldIndex = (_currentWorldIndex + 1) % _worlds.Length;
        WORLD_TYPE worldToLoad = _worlds[_currentWorldIndex].GetComponent <WorldSettings>().WorldType;

        WorldSwitcher(worldToLoad);
    }
Example #2
0
 private void WorldSwitcher(WORLD_TYPE worldToLoad)
 {
     for (int worldNumber = 0; worldNumber < _worlds.Length; worldNumber++)
     {
         GameObject    worldGrid    = _worlds[worldNumber];
         WorldSettings worldSetting = worldGrid.GetComponent <WorldSettings>();
         if (worldSetting.WorldType == worldToLoad)
         {
             worldGrid.SetActive(true);
             _currentWorldIndex = worldNumber;
             UpdateTransitionImage();
         }
         else
         {
             worldGrid.SetActive(false);
         }
     }
 }
Example #3
0
 private void Start()
 {
     _circleWipeImage = FindObjectOfType <CircleWipe>().gameObject.GetComponent <Image>();
     _startingWorld   = _randomizeStartWorld ? (WORLD_TYPE)Random.Range(0, _worlds.Length) : _startingWorld;
     WorldSwitcher(_startingWorld);
 }