public void GeneratePlanetPanel(GameObject selectedObject) { instanceUIPrefab = Instantiate(planetUIPrefab, transform); panel = instanceUIPrefab.GetComponent <PlanetPanel>(); panel.planet = selectedObject; EnablePlanetPanel(); }
protected void Start() { //get the planet that was selected when this craft was instantiated targetPlanet = Main.getCurrentPlanet(); planetpanel = GameObject.FindObjectOfType <PlanetPanel>(); main = GameObject.FindObjectOfType <Main>(); //set tech level to control how fast this craft mines currentTechLevel = main.getTechLevel(); speed *= main.getTechLevel() * 1.5f; useSpeed *= main.getTechLevel() * 1.5f; //craft are in use by default inUse = true; }
// Use this for initialization void Start() { instance = this; planetPanel.SetActive(false); }