Beispiel #1
0
 public override void OnUpdate()
 {
     base.OnUpdate();
     if (RTSCamera == null || CameraHight == float.NaN)
     {
         return;
     }
     if (BattleMgr.IsInBattle)
     {
         var   data         = SettingsData;
         float speedFaction = 1;
         if (IsLowHight)
         {
             speedFaction = 0.9f;
         }
         else if (IsNearHight)
         {
             speedFaction = 0.8f;
         }
         RTSCamera.DesktopMoveDragSpeed = (ZoomPercent * RTSCamera.desktopMoveDragSpeed) * data.CameraMoveSpeed * speedFaction;
         RTSCamera.DesktopMoveSpeed     = (ZoomPercent * RTSCamera.desktopMoveSpeed) * data.CameraMoveSpeed * speedFaction;
         RTSCamera.DesktopScrollSpeed   = (RTSCamera.desktopScrollSpeed) * data.CameraScrollSpeed;
         if (Input.GetMouseButtonDown(2))
         {
             Vector3 pos = SelfBaseGlobal.ScreenMgr.GetMouseHitPoint();
             RTSCamera.JumpToTargetForMain(SelfBaseGlobal.GetTransform(pos));
         }
         bool isOnUI = BaseUIUtils.CheckGuiObjects();
         RTSCamera.MouseScrollControl(!isOnUI);
         RTSCamera.MouseDragControl(!isOnUI);
         RTSCamera.ControlDisabled.Set(BaseView.IsFullScreenState.IsIn());
     }
 }