internal void Instantiate() { int idx = completedCount; if ((source != null) && (toBeContinue == null || toBeContinue(idx))) { var o = UnityObject.Instantiate(source); o.name = source.name; completedCount += 1; if (result != null) { result.Add(o); } Misc.SafeInvoke(onInst, o, idx); if (completedCount >= totalCount) { state = AsyncInstAssetInfo.EAsyncState.ToStop; Misc.SafeInvoke(onInst, o, idx); } } else { state = AsyncInstAssetInfo.EAsyncState.ToStop; } }
internal void Reset() { source = null; result = null; toBeContinue = null; onInst = null; onCompleted = null; totalCount = 0; completedCount = 0; state = EAsyncState.ToStop; }