void Update() { if (Input.GetKeyDown(KeyCode.Space)) { Game.GalaxyView = true; CameraViewChange.ChangeCameraView(); } }
void Update() { hitInfo = new RaycastHit(); if (Input.GetKey(KeyCode.Mouse1)) { UnitTravelOrder(); } else if (Input.GetKey(KeyCode.Mouse0)) { SystemViewChange(); } else if (Input.GetKeyDown(KeyCode.Space)) { CameraViewChange.ChangeCameraView(); } }
void SystemViewChange() { hit = Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo); if (hit) { if (selectedObject != hitInfo.transform.gameObject) { selectedObject = hitInfo.transform.gameObject; } else if (selectedObject.tag == "StarSystem") { selectedObject = hitInfo.transform.gameObject; Game.GalaxyView = false; game.currentSolarSystem = game.Systems.Find(x => x.Name == selectedObject.name); CameraViewChange.ChangeCameraView(); } } }