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; } }
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; } }
public void StartPlanetIdleRotation() { if (isOpen) { PlanetRotator = _OpenedPlanetIdleRotation; } else { PlanetRotator = _ClosedPlanetIdleRotation; } }
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); } }