Ejemplo n.º 1
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            if (!this._updatable || !Singleton <Input> .IsInstance() || (!Singleton <Resources> .IsInstance() || !Singleton <Game> .IsInstance()) || Object.op_Inequality((Object)Singleton <Game> .Instance.MapShortcutUI, (Object)null))
            {
                return;
            }
            float             deltaTime         = Time.get_deltaTime();
            Input             instance          = Singleton <Input> .Instance;
            LocomotionProfile locomotionProfile = Singleton <Resources> .Instance.LocomotionProfile;

            LocomotionProfile.PhotoShotSetting photoShot          = locomotionProfile.PhotoShot;
            LocomotionProfile.LensSettings     defaultLensSetting = locomotionProfile.DefaultLensSetting;
            float num1 = instance.ScrollValue();
            float num2 = (float)(((double)num1 + (double)this._prevScrollValue) / 2.0);

            this._prevScrollValue = num1;
            Transform  transform = ((Component)this._actorCamera).get_transform();
            Vector2    moveAxis  = instance.MoveAxis;
            Quaternion rotation  = transform.get_rotation();
            Vector3    vector3   = Quaternion.op_Multiply(Quaternion.Euler(0.0f, (float)((Quaternion) ref rotation).get_eulerAngles().y, 0.0f), Vector3.ClampMagnitude(new Vector3((float)moveAxis.x, 0.0f, (float)moveAxis.y), 1f));

            info.move    = vector3;
            info.lookPos = Vector3.op_Addition(((Component)player).get_transform().get_position(), Vector3.op_Multiply(transform.get_forward(), 100f));
            if (instance.IsPressedKey((KeyCode)324))
            {
                this._onEndAction.OnNext(Unit.get_Default());
            }
            else
            {
                if (instance.IsPressedKey((KeyCode)325))
                {
                    this.PlaySE(SoundPack.SystemSE.Photo);
                    this._actorCamera.ScreenShot.Capture(string.Empty);
                }
                if (!Mathf.Approximately(num2, 0.0f))
                {
                    float       num3  = num2 * photoShot.mouseZoomScale * deltaTime;
                    ref Vector3 local = ref this._offset;
                    local.z = (__Null)(local.z + (double)num3 * (!this._reversi ? 1.0 : -1.0));
                }
                if (Object.op_Inequality((Object)this._followRoot, (Object)null) && Object.op_Inequality((Object)this._camera, (Object)null))
                {
                    Vector3 offsetMoveValue = photoShot.offsetMoveValue;
                    Vector3 maxOffset       = photoShot.maxOffset;
                    Vector3 minOffset       = photoShot.minOffset;
                    if (Input.GetKey((KeyCode)273))
                    {
                        ref Vector3 local = ref this._offset;
                        local.y = (__Null)(local.y + offsetMoveValue.y * (double)deltaTime);
                    }
                    if (Input.GetKey((KeyCode)274))
                    {
                        ref Vector3 local = ref this._offset;
                        local.y = (__Null)(local.y - offsetMoveValue.y * (double)deltaTime);
                    }
Ejemplo n.º 2
0
 protected override void OnAwake(PlayerActor player)
 {
     this._actorCamera  = player.CameraControl;
     this._camera       = this._actorCamera.CameraComponent;
     this._prevShotType = this._actorCamera.ShotType;
     if (this._prevShotType != ShotType.PointOfView)
     {
         this._actorCamera.ShotType = ShotType.PointOfView;
     }
     this._prevCameraChangeable = this._actorCamera.IsChangeable;
     if (this._prevCameraChangeable)
     {
         this._actorCamera.IsChangeable = false;
     }
     this._prevFieldOfView = (float)this._actorCamera.LensSetting.FieldOfView;
     this._prevDutch       = (float)this._actorCamera.LensSetting.Dutch;
     this._followRoot      = ((CinemachineVirtualCameraBase)this._actorCamera.ActiveFreeLookCamera)?.get_Follow();
     if (Object.op_Inequality((Object)this._followRoot, (Object)null))
     {
         this._prevCameraLocalPosition = this._followRoot.get_localPosition();
         this._prevCameraLocalRotation = this._followRoot.get_localRotation();
     }
     this._cameraLayer = Singleton <Resources> .Instance.DefinePack.MapDefines.MapLayer;
     MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
     MapUIContainer.SetVisibleHUD(false);
     if (Singleton <Resources> .IsInstance())
     {
         LocomotionProfile.LensSettings     defaultLensSetting = Singleton <Resources> .Instance.LocomotionProfile.DefaultLensSetting;
         LocomotionProfile.PhotoShotSetting photoShot          = Singleton <Resources> .Instance.LocomotionProfile.PhotoShot;
         MapUIContainer.PhotoShotUI.SetZoomValue(Mathf.InverseLerp(defaultLensSetting.MinFOV, defaultLensSetting.MaxFOV, this._prevFieldOfView));
     }
     else
     {
         MapUIContainer.PhotoShotUI.SetZoomValue(0.5f);
     }
     MapUIContainer.SetActivePhotoShotUI(true);
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ =>
     {
         this._updatable = false;
         player.PlayerController.ChangeState("Normal");
     }));
     this._updatable = true;
 }