Exemple #1
0
    protected void ChangeMode(GameManager.GameMode gameMode)
    {
        switch (gameMode)
        {
        case GameManager.GameMode.Idle:
            if (PlanetController.OccupedPlanetNum != ID)
            {
                StartPlanetIdleRotation();
            }
            else
            {
                PlanetRotator = null;
            }
            break;

        case GameManager.GameMode.Game:
            StartCoroutine(SetPlanetOnGame());
            break;

        case GameManager.GameMode.ChangePlanet:
            StartPlanetIdleRotation();
            break;

        default:
            break;
        }
    }
Exemple #2
0
    public void InitState()
    {
        if ((!PlayerPrefs.HasKey("occupedPlanetNum") && ID == 0) || PlayerPrefs.HasKey("openPlanetCount") && PlayerPrefs.GetInt("openPlanetCount") >= ID)
        {
            isOpen = true;
            LockedPlanetObj.SetActive(false);
            UI_LockedPlanetObj.SetActive(false);
            OpenedPlanetObj.SetActive(true);
            UI_OpenedPlanetObj.SetActive(true);
        }

        else
        {
            isOpen = false;
            OpenedPlanetObj.SetActive(false);
            UI_OpenedPlanetObj.SetActive(false);
            LockedPlanetObj.SetActive(true);
            UI_LockedPlanetObj.SetActive(true);
        }

        if (PlanetController.OccupedPlanetNum != ID)
        {
            StartPlanetIdleRotation();
        }
        else
        {
            PlanetRotator = null;
        }
    }
Exemple #3
0
 public void StartPlanetIdleRotation()
 {
     if (isOpen)
     {
         PlanetRotator = _OpenedPlanetIdleRotation;
     }
     else
     {
         PlanetRotator = _ClosedPlanetIdleRotation;
     }
 }
Exemple #4
0
    IEnumerator SetPlanetOnGame()
    {
        yield return(null);

        PlanetRotator = null;
        if (PlanetController.OccupedPlanetNum != ID)
        {
            OpenedPlanetObj.SetActive(false);
            UI_OpenedPlanetObj.SetActive(false);
            LockedPlanetObj.SetActive(false);
            UI_LockedPlanetObj.SetActive(false);
        }
    }