/// <summary> /// /// </summary> /// <param name="name"></param> void Load(string[] names) { IProgressResult <float, GameObject[]> result = resources.LoadAssetsAsync <GameObject>(names); result.Callbackable().OnProgressCallback(p => { Debug.LogFormat("Progress:{0}%", p * 100); }); result.Callbackable().OnCallback((r) => { try { if (r.Exception != null) { throw r.Exception; } foreach (GameObject template in r.Result) { GameObject.Instantiate(template); } } catch (Exception e) { Debug.LogErrorFormat("Load failure.Error:{0}", e); } }); }