private void OnInitializedEffect(VFXAsyncResult obj) { m_InitializingEffectCount--; if (m_InitializingEffectCount == 0) { m_InitializeCompletedAction?.Invoke(); m_InitializeCompletedAction = null; } }
private void OnInstantiateEffectCompleted(VFXAsyncResult result) { int vfxTypeIndex = (int)result.VFXType; if (m_EffectStates[vfxTypeIndex].PopCompletedActions.Count == 0) { throw new Exception("InstantiateCompletedActions.Count == 0"); } Action <VFXEffectInstance> completedAction = m_EffectStates[vfxTypeIndex].PopCompletedActions.Dequeue(); if (result.Success) { m_EffectStates[vfxTypeIndex].InstantiateCount++; completedAction?.Invoke(new VFXEffectInstance(result.VFXType, result.Result, true)); } else { Debug.LogError(string.Format("Instantiate effect ({0}) failed, Error:\n", result.VFXType, result.ErrorMessage)); } }