我读了这段代码。
https://github.com/johnjcsmith/iPhoneMoCapUnity/blob/master/Assets/NetworkMeshAnimator.cs
代码的第 62 行周围有以下说明。
这是在做什么处理?
if (UnityMainThreadDispatcher.Exists()) {
dispatcher = UnityMainThreadDispatcher.Instance ();
}
Run Code Online (Sandbox Code Playgroud)
GitHub 上有代码,但它是 Unity 中的标准功能吗?
我在我的 mac 上运行了以下命令并创建了一个 .app 文件。
pyinstaller --icon icon.icns --noconsole -n testApp main.py
Run Code Online (Sandbox Code Playgroud)
但是,生成的 .app 文件不显示图标。
icon.icns 被指定为 info.plist 中的图标文件。
Content/Resouces 文件夹包含 icon.icns。
当我运行 .app 文件时,我在 Dock 上看到一个图标。
但是,该图标不会反映在 .app 文件本身中。为什么是这样?
在Unity中,我们可以通过以下代码获取GameObject所拥有的材质。
Material myMaterial = GetComponent<Renderer>().material;
Run Code Online (Sandbox Code Playgroud)
但通过上面的代码,我们只能为每个游戏对象获取一种材质。
然而,实际上,Unity 游戏对象可以有不止一种材质。
如果每个游戏对象是按面分配的,则可以有多个材质。
我尝试使用下面的代码获取多种材料,但没有成功。
List<Material> myMaterials = GetComponent<Renderer>().material;
Run Code Online (Sandbox Code Playgroud)
有没有办法将多种材质分配给游戏对象?