3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 1496|回复: 0
打印 上一主题 下一主题

[原创] 获得正向的视角(强迫症最后的倔强)

[复制链接]

11

主题

55

帖子

86

积分

初级玩家

Rank: 2

贡献度
6
金元
621
积分
86
精华
0
注册时间
2021-10-1
跳转到指定楼层
主题
发表于 2021-12-1 14:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    不知道大家在用鼠标或者“Q”、“R”键调整视角的时候,有没有为“总是差那么一点就对正了”而感觉到那么一丢丢不爽。
    反正有点小强迫症的我最终忍不了了。
   
    现在打开 dnSpy 修改 H20.TopDownCameraLogic
    找到 Update 这个函数
    public void Update()
    {
        if (this._fixedTransform != null)
        {
            this.CameraComponent.transform.position = this._fixedTransform.position;
            this.CameraComponent.transform.rotation = this._fixedTransform.rotation;
        }
        else if (this._cutsceneCameraLogic.IsInCutscene)
        {
            this._cutsceneCameraLogic.Update();
        }
        else
        {
            if (this._inputManager.GetKey(KeyCode.Backslash))
            {
                this._targetRotation %= 360f;
                if (this._targetRotation < 0f)
                {
                    this._targetRotation += 360f;
                }
                if (this._targetRotation >= 45f && this._targetRotation < 135f)
                {
                    this._targetRotation = 90f;
                }
                else if (this._targetRotation >= 135f && this._targetRotation < 225f)
                {
                    this._targetRotation = 180f;
                }
                else if (this._targetRotation >= 225f && this._targetRotation < 315f)
                {
                    this._targetRotation = 270f;
                }
                else
                {
                    this._targetRotation = 0f;
                }
            }
            this.UpdateInput();
            this.UpdateTransform();
        }
        this.ApplyEffects();
        this.ApplyShadowDistance();
        if (DebugVars.ShowCameraBounds.Value)
        {
        this.DebugDraw();
        }
        GameObjectUtils.SetActive(this._gameObject, !DebugVars.DisableTopDownCameras.Value);
    }

   上面红色部分是要增加的代码。
    编译保存后进入游戏,打开关卡场景,调整视角到差不多正对某方向(这里就不科普笛卡尔坐标系的知识了),然后按反斜杠("\")键,视角就会完美的对正你要的方向。

评分

1

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-3-31 13:04 , Processed in 0.029733 second(s), 19 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表