我试图在我的页面创建后填充我的场景,但我收到了上述错误。
这适用于 android ,它适用于 iOS (线程安全的一些问题)
01-05 18:45:19.139 E/Urho3D (32719): Sending events is only supported from the main thread
01-05 18:45:19.139 E/Urho3D (32719): Sending events is only supported from the main thread
01-05 18:45:19.139 E/Urho3D (32719): Sending events is only supported from the main thread
01-05 18:45:19.139 E/Urho3D (32719): Attempted to get resource Models/Box.mdl from outside the main thread
01-05 18:45:19.149 E/Urho3D (32719): Attempted to get resource Materials/Stone.xml from outside the main thread
知道如何在创建场景后将项目添加到我的场景中吗?
urhoApp?.addItem(urhoval);
在我的 urho 应用程序中:
public void addItem(string p)
{
modelNode2 = scene.CreateChild(p);
modelNode2.Position = new Vector3(5.0f, 1.0f, 5.0f);
modelNode2.SetScale(10.0f);
var obj2 = modelNode2.CreateComponent<StaticModel>();
obj2.Model = ResourceCache.GetModel("Models/Box.mdl");
obj2.SetMaterial(urhoAssets.GetMaterial("Materials/Stone.xml"));
}