Пример #1
0
    /// <summary>
    /// Draws a planet's interface
    /// </summary>
    /// <param name="solarBody"></param>
    /// <returns></returns>
    bool DrawSolarBody(SolarBody solarBody)
    {
        if (solarBody == null)
        {
            solarManager.RemoveSolarBody(solarBody);
            return(REFRESH_EDITOR);
        }


        GUILayout.BeginHorizontal("box");

        GUILayout.BeginVertical();

        if (DrawRemoveSolarBodyButton(solarBody))
        {
            return(REFRESH_EDITOR);
        }

        if (DrawSolarBodyMain(solarBody))
        {
            return(REFRESH_EDITOR);
        }

        if (DrawAddSatelliteButton(solarBody))
        {
            return(REFRESH_EDITOR);
        }

        if (solarBody.satellites.Count != 0)
        {
            if (DrawSatellites(solarBody))
            {
                return(REFRESH_EDITOR);
            }
        }


        GUILayout.EndVertical();

        GUILayout.EndHorizontal();


        return(!REFRESH_EDITOR);
    }
Пример #2
0
    /// <summary>
    /// Generates a texture map for every sattelite of the given planet
    /// </summary>
    /// <param name="solarBodies"></param>
    void GenerateSatelliteMaps(List <SolarBody> solarBodies)
    {
        foreach (SolarBody solarBody in solarBodies)
        {
            if (solarBody == null)
            {
                solarManager.RemoveSolarBody(solarBody);
                continue;
            }

            GenerateMap(solarBody);

            GenerateSatelliteMaps(solarBody.satellites);
        }
    }