我试图在创建后从我的页面填充我的场景,但出现上述错误。Urho Android - 仅在主线程中支持发送事件
这是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);
在我乌尔禾应用:
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"));
}