Ejemplo n.º 1
0
 private void OnInitializedEffect(VFXAsyncResult obj)
 {
     m_InitializingEffectCount--;
     if (m_InitializingEffectCount == 0)
     {
         m_InitializeCompletedAction?.Invoke();
         m_InitializeCompletedAction = null;
     }
 }
Ejemplo n.º 2
0
        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));
            }
        }