//Selects the parent object in the stellar_hierarchy (NONE, STAR, PLANET, SURFACE) public static void Backup_Current_Selection() { Selection_Object current = current_Object; if (current_Object) { CameraController.focus_Level focus_Level = CameraController.Get_Focus_Level(); Planet planet = current.GetComponent <Planet>(); Star star = current.GetComponent <Star>(); if (focus_Level == CameraController.focus_Level.STAR) { StarToGalaxy(); } else if (focus_Level == CameraController.focus_Level.SYSTEM) { SystemToStar(star); } else if (focus_Level == CameraController.focus_Level.PLANET) { SystemToStar(planet.Get_Star()); } else if (focus_Level == CameraController.focus_Level.SURFACE) { SurfaceToPlanet(planet); } } }
private void Select_Planet(Planet planet) { CameraController.focus_Level focus_Level = CameraController.Get_Focus_Level(); if (focus_Level == CameraController.focus_Level.STAR) { Select_New_Planet(planet); } if (focus_Level == CameraController.focus_Level.SYSTEM) { Select_New_Planet(planet); } if (focus_Level == CameraController.focus_Level.PLANET) { Planet prevPlanet = null; if (current_Object) { prevPlanet = current_Object.GetComponent <Planet>(); } if (prevPlanet) { if (current_Object != this) //Previous Planet is not this planet { Select_New_Planet(planet); } else //Previous planet is this planet { //Zoom to structure PlanetToSurface(planet); } } else //No Previous Planet was selected, This shouldn't ever happen { Select_New_Planet(planet); } } if (focus_Level == CameraController.focus_Level.SURFACE) { } }
private void Update() { if (select) { CameraController.focus_Level focus = CameraController.Get_Focus_Level(); if ((int)focus > 2) { Planet p = select.GetComponent <Planet>(); Set_Planet_Position(p); } else { mini_Indicator.transform.position = select.transform.position; } } }