We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public static async Task instantiateObjectAsync(T templateObject, Transform parent = null, bool worldPositionStays = false) where T : UnityEngine.Object { await Task.Delay(16); return UnityEngine.Object.Instantiate(templateObject, parent, worldPositionStays); } public static async Task instantiateObjectAsync(Task loadTemplateObject, Transform parent = null, bool worldPositionStays = false) { GameObject templateObject = await loadTemplateObject;
return await instantiateObjectAsync(templateObject, parent, worldPositionStays);
}
public static async Task instantiateObjectAsync(Task loadTemplateObject, Transform parent = null, bool worldPositionStays = false) where T : UnityEngine.Object { T templateObject = await loadTemplateObject;
return await instantiateObjectAsync<T>(templateObject, parent, worldPositionStays);
public static Task loadTask() { return Task.FromResult(new GameObject()); }
private static async Task Test() { Debug.Log("1"); GameObject obj1 = await instantiateObjectAsync(new GameObject()); Debug.Log("2"); GameObject obj2 = await instantiateObjectAsync(loadTask()); Debug.Log("3"); }
以上程式碼從 Test() 進入 會卡在 Debug.Log("2"); 不會進到 Debug.Log("3");
The text was updated successfully, but these errors were encountered:
bbacfc9
fixed #223
b232306
No branches or pull requests
public static async Task instantiateObjectAsync(T templateObject, Transform parent = null, bool worldPositionStays = false) where T : UnityEngine.Object
{
await Task.Delay(16);
return UnityEngine.Object.Instantiate(templateObject, parent, worldPositionStays);
}
public static async Task instantiateObjectAsync(Task loadTemplateObject, Transform parent = null, bool worldPositionStays = false)
{
GameObject templateObject = await loadTemplateObject;
}
public static async Task instantiateObjectAsync(Task loadTemplateObject, Transform parent = null, bool worldPositionStays = false) where T : UnityEngine.Object
{
T templateObject = await loadTemplateObject;
}
public static Task loadTask()
{
return Task.FromResult(new GameObject());
}
private static async Task Test()
{
Debug.Log("1");
GameObject obj1 = await instantiateObjectAsync(new GameObject());
Debug.Log("2");
GameObject obj2 = await instantiateObjectAsync(loadTask());
Debug.Log("3");
}
以上程式碼從 Test() 進入
會卡在 Debug.Log("2"); 不會進到 Debug.Log("3");
The text was updated successfully, but these errors were encountered: