Beispiel #1
0
            void OnLoadComplete(IAsyncOperation <TObject> operation)
            {
                Validate();
                ResourceManagerEventCollector.PostEvent(ResourceManagerEventCollector.EventType.InstantiateAsyncCompletion, Context, Time.frameCount - m_StartFrame);
                m_PrefabResult = operation.Result;

                if (m_PrefabResult == null)
                {
                    Debug.LogWarning("NULL prefab on instantiate: " + Context);
                }
                else if (Result == null)
                {
                    SetResult(m_InstParams.Instantiate(m_PrefabResult));
                }

                InvokeCompletionEvent();
            }
 void OnComplete(IAsyncOperation <TObject> operation)
 {
     Validate();
     Debug.Assert(operation != null);
     ResourceManagerEventCollector.PostEvent(ResourceManagerEventCollector.EventType.InstantiateAsyncCompletion, Context, Time.frameCount - m_StartFrame);
     m_PrefabResult = operation.Result;
     if (m_PrefabResult == null)
     {
         OperationException = new Exception(string.Format("Unable to load asset to instantiate from location {0}", Context));
         SetResult(null);
     }
     else if (Result == null)
     {
         SetResult(m_InstParams.Instantiate(m_PrefabResult));
     }
     InvokeCompletionEvent();
 }