Beispiel #1
0
        protected override void Awake()
        {
            base.Awake();
            GoToOrigin.onClick.AddListener(delegate
            {
                var position = ((Drone)Source).GetJob().Pickup;
                AbstractCamera.LookHere(position);
            });

            GoToDestination.onClick.AddListener(delegate
            {
                var position = ((Drone)Source).GetJob().DropOff;
                AbstractCamera.LookHere(position);
            });
            GoToHub.onClick.AddListener(delegate
            {
                var position = ((Drone)Source).GetHub().transform.position;
                AbstractCamera.LookHere(position);
            });

            FollowDrone.onClick.AddListener(delegate
            {
                AbstractCamera.Followee = ((Drone)Source).gameObject;
            });

            JobInfo.onClick.AddListener(OpenJobWindow);
            JobHistory.onClick.AddListener(OpenJobHistoryWindow);
        }
 private void ExecuteButton(IEvent iEvent)
 {
     if (iEvent.Target != null)
     {
         AbstractCamera.ActiveCamera.BreakFollow();
         AbstractCamera.LookHere(new Vector3(iEvent.Target[0], iEvent.Target[1], iEvent.Target[2]));
     }
     iEvent.OpenWindow();
 }
        private void CastMiniMapRayToWorld(Vector2 localCursor)
        {
            var horizontalScale = MinimapCamera.pixelWidth * MapImage.uvRect.width;
            var xDir            = localCursor.x * horizontalScale + MapImage.uvRect.x * MinimapCamera.pixelWidth;
            var verticalScale   = MinimapCamera.pixelHeight * MapImage.uvRect.height;
            var yDir            = localCursor.y * verticalScale + MapImage.uvRect.y * MinimapCamera.pixelHeight;
            var miniMapRay      = MinimapCamera.ScreenPointToRay(new Vector2(xDir, yDir));

            if (Physics.Raycast(miniMapRay, out RaycastHit miniMapHit, 3000, 1 << 13))
            {
                Vector3 target = miniMapHit.point;
                AbstractCamera.LookHere(target);
            }
        }
Beispiel #4
0
        protected override void Awake()
        {
            base.Awake();
            GoToOrigin.onClick.AddListener(delegate
            {
                var position = ((Job)Source).Pickup;
                AbstractCamera.LookHere(position);
            });

            GoToDestination.onClick.AddListener(delegate
            {
                var position = ((Job)Source).DropOff;
                AbstractCamera.LookHere(position);
            });
        }
        protected override void Awake()
        {
            base.Awake();
            GoToOrigin.onClick.AddListener(delegate
            {
                var position = ((RetiredDrone)Source).GetJob().Pickup;
                AbstractCamera.LookHere(position);
            });

            GoToDestination.onClick.AddListener(delegate
            {
                var position = ((RetiredDrone)Source).GetJob().DropOff;
                AbstractCamera.LookHere(position);
            });
            CollidedWith.onClick.AddListener(delegate
            {
                ((RetiredDrone)Source).OtherDrone?.OpenInfoWindow();
            });

            JobInfo.onClick.AddListener(OpenJobWindow);

            JobHistory.onClick.AddListener(OpenJobHistoryWindow);
        }
Beispiel #6
0
        private void GoToHub()
        {
            var position = ((Hub)Source).transform.position;

            AbstractCamera.LookHere(position);
        }