例如,我可能有Script.cs,但我也有Script.cs.meta,或者有一个名为Sprites的文件夹和一个名为Sprites.meta的文件。为什么?
我对C#很新,所以如果这很明显,请原谅我.
我正在按照本教程中的步骤操作,并在第六步遇到问题.它给出的错误是:它给出的错误是这样的:
UnityEngine.Component' does not contain a definition for `velocity' and no extension method `velocity' of type `UnityEngine.Component' could be found. Are you missing an assembly reference?'
Run Code Online (Sandbox Code Playgroud)
这是代码:
using UnityEngine;
using System.Collections;
public class RobotController : MonoBehaviour {
//This will be our maximum speed as we will always be multiplying by 1
public float maxSpeed = 2f;
//a boolean value to represent whether we are facing left or not
bool facingLeft = true;
//a value to represent our …Run Code Online (Sandbox Code Playgroud) 在 的文档页面上pygame.display.update(),它说您可以将 rect 传递到方法中以更新部分屏幕。但是,我看到的所有示例都只是从程序中的图像或形状传递了一个现有的矩形。如何告诉它直接更新屏幕上的区域?例如,在绘制矩形时,我可以使用 rect 参数(100,200,30,40)。这将绘制一个矩形,顶部为 200,左侧为 100,宽度为 30,高度为 40。如何将类似的参数传递给pygame.display.update()?我试过pygame.display.update((100,200,30,40)),但这会更新整个窗口。
由于从技术上讲,有4种循环类型(for,while,repeat和goto / lbl),使用“无限”最快的是哪一种?这是我的意思:
while 1
End
repeat 0
End
lbl 1
goTo 1
for(n, 1, [number large enough to function as practically infinite]
End
Run Code Online (Sandbox Code Playgroud)
其中哪一个是最快的,或者甚至更快?
我完成了Unity的roll-a-ball教程,它运行正常.我换了几种材料让它看起来更好.我还添加了一个C#脚本,当玩家从地面掉下来时应重启该级别(我禁用了墙壁).我使用的是Unity 5.5.
但当我离开边缘并重新启动时,它看起来像这样:
在编辑器加载时打开统一后,它有时看起来像这样几秒钟.
这是脚本:
using UnityEngine;
using System.Collections;
public class DeathTrigger : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.CompareTag("Player"))
Application.LoadLevel(Application.loadedLevel);
}
}
Run Code Online (Sandbox Code Playgroud)
关于是什么导致这个的任何想法?