public override void OnInspectorGUI() { BackgroundGenerator backgroundGenerator = (BackgroundGenerator)target; GUILayout.Label("Timing", EditorStyles.boldLabel); GUILayout.Label("Timer for Change: " + backgroundGenerator.timerForChange); GUILayout.BeginHorizontal(); GUILayout.Label("Minimum: "); backgroundGenerator.leastTimeToChange = EditorGUILayout.IntField(backgroundGenerator.leastTimeToChange); GUILayout.Label("Maximum: "); backgroundGenerator.mostTimeToChange = EditorGUILayout.IntField(backgroundGenerator.mostTimeToChange); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Label("Offsets", EditorStyles.boldLabel); GUILayout.Label("X: " + backgroundGenerator.offsetX); GUILayout.Label("Y: " + backgroundGenerator.offsetY); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Speeds", EditorStyles.boldLabel); GUILayout.Label("Background Speed: " + backgroundGenerator.backgroundSpeed); GUILayout.BeginHorizontal(); GUILayout.Label("Minimum: "); backgroundGenerator.backgroundSpeedMin = EditorGUILayout.FloatField(backgroundGenerator.backgroundSpeedMin); GUILayout.Label("Maximum: "); backgroundGenerator.backgroundSpeedMax = EditorGUILayout.FloatField(backgroundGenerator.backgroundSpeedMax); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Background Size", EditorStyles.boldLabel); GUILayout.BeginHorizontal(); GUILayout.Label("Width: "); backgroundGenerator.width = EditorGUILayout.IntField(backgroundGenerator.width); GUILayout.Label("Height: "); backgroundGenerator.height = EditorGUILayout.IntField(backgroundGenerator.height); GUILayout.EndHorizontal(); }
private void GenerateImage() { StarSystem sys = new StarSystem(r.Next()); sys.Asteroids = false; sys.Nebula = NebulaType.Monochrome; sys.Planets.Add(new Planet(PlanetType.Red, 2)); sys.Suns.Add(new Sun(SunType.Giant)); BackgroundGenerator gen = new BackgroundGenerator(sys); gen.Run(); s = new Sprite(gen.getTexture()); s.Position = new Vector2f(0, 0); }
public override void OnInspectorGUI() { DrawDefaultInspector(); BackgroundGenerator myScript = (BackgroundGenerator)target; if (GUILayout.Button("Generate")) { myScript.Generate(); } if (GUILayout.Button("Clear")) { myScript.Clear(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); BackgroundGenerator bgGenScript = (BackgroundGenerator)target; if (GUILayout.Button("Generate Background")) { bgGenScript.GenerateBackground(); } if (GUILayout.Button("Delete Background")) { bgGenScript.RemoveBackground(); } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } // var basePath = Environment.CurrentDirectory; // // var fullPath = Path.Combine(basePath, ChildhoodFileName.TrimStart('\\', '/')); // // ChildhoodFile = Resources.Load<TextAsset>(fullPath); // // fullPath = Path.Combine(basePath, ParentStatusFileName.TrimStart('\\', '/')); // ParentStatusFile = Resources.Load<TextAsset>(fullPath); // // fullPath = Path.Combine(basePath, LifeEventsFileName.TrimStart('\\', '/')); // LifeEventsFile = Resources.Load<TextAsset>(fullPath); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); _backgroundGenerator = (BackgroundGenerator)target; EditorGUILayout.Separator(); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Creating Background Grid", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Create BG")) { _backgroundGenerator.MakeBG(); } if (GUILayout.Button("Reset Root")) { _backgroundGenerator.ResetRoot(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Colorize")) { _backgroundGenerator.ColorizeTiles(); } EditorGUILayout.EndHorizontal(); }