private void Start() { //Not doing this for clients if (IsServer) { EntryList.Origin = MatrixMove; //Init listeners MatrixMove.OnStart.AddListener(() => this["StartButton"].SetValue = "1"); MatrixMove.OnStop.AddListener(() => { this["StartButton"].SetValue = "0"; HideWaypoint(); }); if (!Waypoint) { Waypoint = new GameObject($"{MatrixMove.gameObject.name}Waypoint"); } HideWaypoint(false); // EntryList.AddItems( MapIconType.Airlock, GetObjectsOf<AirLockAnimator>( null, "AirLock" ) ); EntryList.AddItems(MapIconType.Ship, GetObjectsOf(new HashSet <MatrixMove>(new[] { MatrixMove }))); var stationBounds = MatrixManager.Get(0).MetaTileMap.GetBounds(); int stationRadius = (int)Mathf.Abs(stationBounds.center.x - stationBounds.xMin); EntryList.AddStaticItem(MapIconType.Station, stationBounds.center, stationRadius); EntryList.AddItems(MapIconType.Waypoint, new List <GameObject>(new[] { Waypoint })); RescanElements(); StartRefresh(); } }
private void StartNormalOperation() { EntryList.AddItems(MapIconType.Ship, GetObjectsOf <MatrixMove>( mm => mm != MatrixMove && //ignore current ship (mm.HasWorkingThrusters || mm.gameObject.name.Equals("Escape Pod")) //until pod gets engines )); try { EntryList.AddItems(MapIconType.Asteroids, GetObjectsOf <Asteroid>()); var stationBounds = MatrixManager.Get(0).MetaTileMap.GetBounds(); int stationRadius = (int)Mathf.Abs(stationBounds.center.x - stationBounds.xMin); EntryList.AddStaticItem(MapIconType.Station, stationBounds.center, stationRadius); EntryList.AddItems(MapIconType.Waypoint, new List <GameObject>(new[] { Waypoint })); RescanElements(); StartRefresh(); } catch (NullReferenceException exception) { Logger.LogError("Caught NRE in GUI_ShuttleControl.StartNormalOperation: " + exception.Message, Category.Shuttles); } }
private void StartNormalOperation() { // EntryList.AddItems( MapIconType.Airlock, GetObjectsOf<AirLockAnimator>( null, "AirLock" ) ); EntryList.AddItems(MapIconType.Ship, GetObjectsOf(new HashSet <MatrixMove>(new[] { MatrixMove }))); var stationBounds = MatrixManager.Get(0).MetaTileMap.GetBounds(); int stationRadius = (int)Mathf.Abs(stationBounds.center.x - stationBounds.xMin); EntryList.AddStaticItem(MapIconType.Station, stationBounds.center, stationRadius); EntryList.AddItems(MapIconType.Waypoint, new List <GameObject>(new[] { Waypoint })); RescanElements(); StartRefresh(); }
private void StartNormalOperation() { EntryList.AddItems(MapIconType.Ship, GetObjectsOf <MatrixMove>( mm => mm != MatrixMove && //ignore current ship (mm.HasWorkingThrusters || mm.gameObject.name.Equals("Escape Pod")) //until pod gets engines )); EntryList.AddItems(MapIconType.Asteroids, GetObjectsOf <Asteroid>()); var stationBounds = MatrixManager.Get(0).MetaTileMap.GetBounds(); int stationRadius = (int)Mathf.Abs(stationBounds.center.x - stationBounds.xMin); EntryList.AddStaticItem(MapIconType.Station, stationBounds.center, stationRadius); EntryList.AddItems(MapIconType.Waypoint, new List <GameObject>(new[] { Waypoint })); RescanElements(); StartRefresh(); }