예제 #1
0
    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();
        }
    }
예제 #2
0
        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);
            }
        }
예제 #3
0
    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();
    }
예제 #4
0
    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();
    }