示例#1
0
    // -------------------------------------------------------------------------------

    public void ChooseNewPlanetoid(Planetoid newPlanetoid)
    {
        if (newPlanetoid != mGameManager.CurrentPlanetoid)
        {
            var currentPlanetoid = mGameManager.CurrentPlanetoid;
            currentPlanetoid.gameObject.SetActive(false);

            // Make sure flipable planets are upside down before we land!
            if (newPlanetoid.Flipable != null)
            {
                newPlanetoid.Flipable.SetUpsideDown(true);
            }

            if (newPlanetoid.IsHomePlanetoid)
            {
                CurrentHomePlanetoid = newPlanetoid;
                CurrentHomePlanetoid.SetupProxies(ref PlanetoidProxies);
            }

            mGameManager.CurrentPlanetoid = newPlanetoid;
            newPlanetoid.gameObject.SetActive(false); // Don't turn it until we're ready to land!

            UpdateShiptTakeOffPoints();
            TheSun.OrbitDistance  = newPlanetoid.OuterOrbitDistance;
            TheMoon.OrbitDistance = newPlanetoid.OuterOrbitDistance;
            mSeedShip.SetAttachedToPlanetoid(false);

            // Let any interested parties know about the change
            if (OnPlanetoidChange != null)
            {
                OnPlanetoidChange.Invoke(newPlanetoid);
            }
        }
    }
示例#2
0
    // -------------------------------------------------------------------------------

    private void OnSaveGameLoaded(GameData gameData)
    {
        CurrentHomePlanetoid.SetupProxies(ref PlanetoidProxies);
    }