コード例 #1
0
        public override void OnInspectorGUI()
        {
            using (var check = new EditorGUI.ChangeCheckScope()) {
                base.OnInspectorGUI();
                if (check.changed)
                {
                    planet.GeneratePlanet();
                }
            }

            if (GUILayout.Button("Generate Planet"))
            {
                planet.GeneratePlanet();
            }

            DrawSettingsEditor(planet.settings.shapeSettings, planet.OnShapeSettingsUpdated,
                               ref planet.shapeSettingsFoldout, ref shapeEditor);
            DrawSettingsEditor(planet.settings.colorSettings, planet.OnColorSettingsUpdated,
                               ref planet.colourSettingsFoldout, ref colourEditor);
            DrawSettingsEditor(planet.settings, planet.OnPlanetSettingsUpdated, ref planet.planetSettingsFoldout,
                               ref planetEditor);
        }
コード例 #2
0
 private void Awake()
 {
     startOffset = SimpleNoiseSettings.centre;
     planet.GeneratePlanet();
 }