protected void InstantiateStarSystemPrefabs() { Galaxy galaxy = GameController.Instance.CurrentGalaxy; foreach (StarSystem system in galaxy.StarSystems) { GameObject go = Instantiate(StarSystemPrefab, system.Position, Quaternion.identity, StarSystems); StarSystemView view = go.GetComponent <StarSystemView>(); go.name = "StarSystem(" + system.Name + ")"; view.System = system; view.NameText.text = system.Name; } }
private void Update() { if (Input.GetMouseButtonUp(0)) { RaycastHit hit; if (Physics.Raycast(Camera.ScreenPointToRay(Input.mousePosition), out hit)) { StarSystemView systemView = hit.collider.gameObject.GetComponentInParent <StarSystemView>(); if (systemView != null) { SelectionController.Instance.Select(systemView.System); MainViewController.Instance.ShowSystemView(); } } } }