c# - Unity3d 游戏教程 Scavengers 2D 我的角色只移动一次
问题描述
我是创建游戏的新手,我正在用 C# 编程,我需要帮助,因为我花了很多时间尝试将 Unity3d 教程游戏制作为 2D Scavengers,而我的角色只移动一次其余的都是正常的。Unity 不收取这方面的任何错误。有人可以帮助我吗?
我多次尝试将我的代码与视频课程的代码进行比较,但没有发现任何区别。
private void Update()
{
//Só vamos fazer alguma coisa se for o turno do player
if(!GameManager.instance.playerTurn)return;
int horizontal = 0;
int vertical = 0;
horizontal = (int) (Input.GetAxisRaw("Horizontal"));
vertical = (int) (Input.GetAxisRaw("Vertical"));
if(horizontal != 0)
{
vertical = 0;
}
if(horizontal != 0 || vertical != 0)
{
AttemptMove<Wall> (horizontal, vertical);
}
}
解决方案
推荐阅读
- python - 如何从 txt 文件中读取字典列表
- javascript - 创建了一个 React Native 应用程序,但它在 6 英寸屏幕上看起来不错,但在 4.3 英寸屏幕上不好看
- mysql - Yii 1.1 model relation can't use joined table column on select
- javascript - 从 1 个自动完成输入中自动填充 2 个表单输入,以从一个东西中查找代码和价格
- javascript - Wordpress、Javascript 和 Php:我是否将 authenticate-user.php 放在正确的文件夹中?
- clojure - 列出范围内的素数会导致 Clojure 中出现错误消息
- angularjs - 在 AngularJS 应用程序中注入依赖项得到 $injector:modulerr 错误
- r - 每当更新相应的 CSV 数据文件时,定期更新闪亮仪表板
- oracle-apex-5.1 - 甲骨文交互式报告中最后一行下方的总计
- mysql - 将mysql中的列从上到下行求和并选择值所在的行