예제 #1
0
 public void Start(GD_Planet planet)
 {
     m_planet        = planet;
     m_step          = 0;
     m_progress      = 0.0f;
     m_mapsGenerated = false;
     m_abort         = false;
 }
예제 #2
0
    // call this before you enable the planet
    public void InitializePlanet(GD_Planet planet)
    {
        // get to the player data
        var playerData = DataController.m_instance.m_playerData;

        // check if we have a planet
        if ((planet == null) || (planet.m_id == -1))
        {
            // nope - forget this planet
            m_planet = null;

            // we don't need to generate maps for this planet
            m_mapsGenerated = true;

            // don't do anything more here
            return;
        }

        // yep - remember the planet we are controlling
        m_planet = planet;

        // get the mesh renderer component
        m_meshRenderer = m_planetModel.GetComponent <MeshRenderer>();

        // grab the material from the mesh renderer and make a clone of it
        m_material = m_meshRenderer.material;

        // start the maps generation process
        m_planetGenerator = new PlanetGenerator();

        m_planetGenerator.Start(m_planet);

        m_mapsGenerated = false;

        // set the current position of the planet
        transform.localPosition = m_planet.GetPosition();

        // set the initial rotation angle of the planet
        m_currentRotationAngle = m_planet.m_orbitPosition;
    }
예제 #3
0
    public override bool Execute()
    {
        // get to the game data
        var gameData = DataController.m_instance.m_gameData;

        // get to the player data
        var playerData = DataController.m_instance.m_playerData;

        // new message text
        string text;

        // do we have sensor data to analyze?
        if (SpaceflightController.m_instance.m_displayController.m_sensorsDisplay.m_hasSensorData)
        {
            // yes - start building the new messages text
            text = "<color=white>Analysis of Last Sensor Reading</color>\n";

            // what did we just scan
            switch (SpaceflightController.m_instance.m_displayController.m_sensorsDisplay.m_scanType)
            {
            case SensorsDisplay.ScanType.Planet:
            {
                // get to the planet
                GD_Planet planet = gameData.m_planetList[playerData.m_general.m_currentPlanetId];

                // object and orbit number
                text += "Object: <color=white>Planet</color>   Orbit Number: <color=white>" + planet.m_orbitPosition + "</color>\n";

                // surface
                text += "Predominant Surface: <color=white>" + planet.GetSurfaceText() + "</color>\n";

                // gravity
                text += "Gravity: <color=white>" + planet.GetGravityText() + "</color>\n";

                // atmospheric density
                text += "Atmospheric Density: <color=white>" + planet.GetAtmosphericDensityText() + "</color>\n";

                // temperature
                text += "Temperature: <color=white>" + planet.GetTemperatureText() + "</color>\n";

                // weather
                text += "Global Weather: <color=white>" + planet.GetGlobalWeatherText() + "</color>";

                break;
            }

            case SensorsDisplay.ScanType.Minstrel:
            {
                // display the ship information
                var vessel = gameData.m_vesselList[(int)SpaceflightController.m_instance.m_displayController.m_sensorsDisplay.m_scanType];

                // object
                text += "Object: <color=white>" + vessel.m_object + "</color>\n";

                // size
                text += "Size: <color=white>" + (vessel.m_mass / playerData.m_playerShip.m_mass) + " times the size of our ship</color>\n";

                break;
            }

            default:
            {
                // display the ship information
                var vessel = gameData.m_vesselList[(int)SpaceflightController.m_instance.m_displayController.m_sensorsDisplay.m_scanType];

                // object
                text += "Object: <color=white>" + vessel.m_object + "</color>\n";

                // type
                text += "Type: <color=white>" + vessel.m_type + "</color>\n";

                // size
                text += "Size: <color=white>" + (vessel.m_mass / playerData.m_playerShip.m_mass) + " times the size of our ship</color>\n";

                // shields
                text += "Shields: <color=yellow>Not certain</color>\n";

                // weapon status
                text += "Weapon Status: <color=yellow>Not certain</color>\n";

                break;
            }
            }
        }
        else
        {
            // nope - buzz
            SoundController.m_instance.PlaySound(SoundController.Sound.Error);

            // complain to the player
            text = "<color=white>I need a current senor reading.</color>";
        }

        // update the messages text
        SpaceflightController.m_instance.m_messages.Clear();
        SpaceflightController.m_instance.m_messages.AddText(text);

        // turn off the active button dot
        SpaceflightController.m_instance.m_buttonController.UpdateButtonSprites();

        return(false);
    }