예제 #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            EffectWrapper pTarget = target as EffectWrapper;

            pTarget.DoInit();
        }
예제 #2
0
        /// <summary>
        /// 이펙트를 실행합니다. <see cref="EffectWrapper"/>을 반환합니다.
        /// </summary>
        /// <param name="strEffectName">플레이할 이펙트의 이름</param>
        /// <param name="OnFinishEffect">이펙트가 끝났을 때 이벤트</param>
        public static EffectWrapper DoPlayEffect(string strEffectName, Vector3 vecPos, System.Action <string> OnFinishEffect = null)
        {
            EffectWrapper pEffect = PlayEffect(strEffectName, OnFinishEffect);

            pEffect.transform.position = vecPos;
            pEffect.IEffectPlayer_PlayEffect();

            return(pEffect);
        }
예제 #3
0
        static EffectWrapper Pop_EffectWrapper(EffectWrapper pEffectWrapper_Origin, Action <string> OnFinishEffect)
        {
            EffectWrapper pEffect = g_pPool.DoPop(pEffectWrapper_Origin);

            pEffect.OnFinish_Effect.DoClear_Observer();
            pEffect.OnFinish_Effect.Subscribe += OnFinish_Effect_Subscribe;
            pEffect.OnFinish_Effect.Subscribe += (Args) => OnFinishEffect?.Invoke(pEffectWrapper_Origin.name);
            pEffect.transform.SetParent(instance.transform);

            return(pEffect);
        }
예제 #4
0
        /* protected - [abstract & virtual]         */


        // ========================================================================== //

        #region Private

        private static EffectWrapper PlayEffect(string strEffectName, Action <string> OnFinishEffect)
        {
            if (g_mapEffectOriginal.ContainsKey(strEffectName) == false)
            {
                Debug.LogError("Error");
            }

            EffectWrapper pEffect = Pop_EffectWrapper(g_mapEffectOriginal[strEffectName], OnFinishEffect);

            return(pEffect);
        }
예제 #5
0
        /// <summary>
        /// 이펙트를 실행합니다. <see cref="EffectWrapper"/>을 반환합니다.
        /// </summary>
        /// <param name="strEffectName">플레이할 이펙트의 이름</param>
        /// <param name="OnFinishEffect">이펙트가 끝났을 때 이벤트</param>
        public static EffectWrapper DoPlayEffect(string strEffectName, Transform pTransform, System.Action <string> OnFinishEffect = null)
        {
            EffectWrapper pEffect          = PlayEffect(strEffectName, OnFinishEffect);
            Transform     pEffectTransform = pEffect.transform;

            pEffectTransform.SetParent(pTransform);
            pEffectTransform.localPosition = Vector3.zero;
            pEffectTransform.localRotation = Quaternion.identity;
            pEffectTransform.localScale    = Vector3.one;
            pEffect.IEffectPlayer_PlayEffect();

            return(pEffect);
        }
예제 #6
0
        public static EffectWrapper DoPlayEffect(EffectWrapper pEffect_Origin, Vector3 vecPos, System.Action <string> OnFinishEffect = null)
        {
            if (pEffect_Origin == null)
            {
                Debug.LogError("DoPlayEffect - pEffect_Origin == null");
                return(null);
            }

            EffectWrapper pEffect = Pop_EffectWrapper(pEffect_Origin, OnFinishEffect);

            pEffect.transform.position = vecPos;
            pEffect.IEffectPlayer_PlayEffect();

            return(pEffect);
        }
예제 #7
0
        public static EffectWrapper DoPlayEffect_Loop(EffectWrapper pEffect_Origin, Vector3 vecPos)
        {
            if (pEffect_Origin == null)
            {
                Debug.LogError("DoPlayEffect - pEffect_Origin == null");
                return(null);
            }

            EffectWrapper pEffect = Pop_EffectWrapper(pEffect_Origin, null);

            pEffect.transform.position = vecPos;
            pEffect.IEffectPlayer_PlayEffect_Loop();

            return(pEffect);
        }
예제 #8
0
        public static EffectWrapper DoPlayEffect_Loop(EffectWrapper pEffect_Origin, Transform pTransform, Vector3 vecLocalPos)
        {
            if (pEffect_Origin == null)
            {
                Debug.LogError("DoPlayEffect - pEffect_Origin == null");
                return(null);
            }

            EffectWrapper pEffect          = Pop_EffectWrapper(pEffect_Origin, null);
            Transform     pEffectTransform = pEffect.transform;

            pEffectTransform.SetParent(pTransform);
            pEffectTransform.localPosition = vecLocalPos;
            pEffectTransform.localRotation = Quaternion.identity;
            pEffectTransform.localScale    = Vector3.one;
            pEffect.IEffectPlayer_PlayEffect_Loop();

            return(pEffect);
        }
예제 #9
0
        public static EffectWrapper DoPlayEffect(EffectWrapper pEffect_Origin, Transform pTransform, System.Action <string> OnFinishEffect = null)
        {
            if (pEffect_Origin == null)
            {
                Debug.LogError("DoPlayEffect - pEffect_Origin == null");
                return(null);
            }

            EffectWrapper pEffect          = Pop_EffectWrapper(pEffect_Origin, OnFinishEffect);
            Transform     pEffectTransform = pEffect.transform;

            pEffectTransform.SetParent(pTransform);
            pEffectTransform.localPosition = Vector3.zero;
            pEffectTransform.localRotation = Quaternion.identity;
            pEffectTransform.localScale    = Vector3.one;
            pEffect.IEffectPlayer_PlayEffect();

            return(pEffect);
        }
예제 #10
0
 public static EffectWrapper DoPlayEffect_Loop(EffectWrapper pEffect_Origin, Transform pTransform)
 {
     return(DoPlayEffect_Loop(pEffect_Origin, pTransform, Vector3.zero));
 }