Hello Community,
I am totally new to Unity (yesterday i installed it) and I’m trying to create a little solar system with a window that shows me all properties of the planet i was selecting.
Now i was wondering how it must be implemented in Unity. My first idea was to make a class like this…
using UnityEngine;
using System.Collections;
public class PlanetProperties : MonoBehaviour {
public enum PlanetType {
IcePlanet,
SandPlanet,
DustPlanet,
GasPlanet,
WaterPlanet,
}
public PlanetType planetType;
public Vector2 averageTemperature; //Will be replaced with a custom Class
}
…and then add this Component to all planets.
Then for the selection of a planet, i will implement a class like this:…
using UnityEngine;
using System.Collections;
public class SelectableObject : MonoBehaviour {
void OnMouseDown(){
}
}
…so every Planet is selectable. But now, how i can feed the GUI with the values of the planet I’ve selected?
Thanks for every herlp