Esempio n. 1
0
        void DoFinish()
        {
            this.gameObject.SetActive(false);

#if UNITY_EDITOR
            if (!EditorApplication.isPlaying)
            {
                ClearEditModeMeshs();
                foreach (EffectLayer el in EflList)
                {
                    el.Reset();
                }
                ElapsedTime = 0f;
                return;
            }
#endif

            for (int i = 0; i < EflList.Count; i++)
            {
                EffectLayer el = EflList[i];
                el.Reset();
            }
            DeActive();
            ElapsedTime = 0f;

            if (AutoDestroy)
            {
                GameObject.Destroy(gameObject);
            }
        }
Esempio n. 2
0
        void DoFinish()
        {
            mIsActive = false;

#if UNITY_EDITOR
            if (!EditorApplication.isPlaying)
            {
                //if this xffect is in XffectCache, we need to set it to inactive.
                if (transform.parent != null && transform.parent.GetComponent <XffectCache>() != null)
                {
                    DeActive();
                }
                else
                {
                    foreach (EffectLayer el in EflList)
                    {
                        el.Reset();
                    }

                    foreach (XftEventComponent e in EventList)
                    {
                        e.ResetCustom();
                    }

                    ClearEditModeMeshs();
                    ElapsedTime = 0f;
                    return;
                }
            }
#endif

            for (int i = 0; i < EflList.Count; i++)
            {
                EffectLayer el = EflList[i];
                el.Reset();
            }
            DeActive();
            ElapsedTime = 0f;

            if (AutoDestroy)
            {
                switch (this.tag)
                {
                case "Mage":
                    this.transform.parent.gameObject.GetComponent <Mage> ().remove();
                    GameObject.Destroy(gameObject);
                    break;

                default:
                    Destroy(this.gameObject);
                    break;
                }
            }
        }
Esempio n. 3
0
        public void Reset()
        {
            mIsActive   = true;
            ElapsedTime = 0f;

            //reset times
            Start();

            for (int i = 0; i < EflList.Count; i++)
            {
                EffectLayer el = EflList[i];
                el.Reset();
            }


            for (int i = 0; i < EventList.Count; i++)
            {
                XftEventComponent e = EventList[i];
                e.ResetCustom();
            }
        }
Esempio n. 4
0
        void DoFinish()
        {
            mIsActive = false;

#if UNITY_EDITOR
            if (!EditorApplication.isPlaying)
            {
                foreach (EffectLayer el in EflList)
                {
                    el.Reset();
                }

                foreach (XftEventComponent e in EventList)
                {
                    e.ResetCustom();
                }

                ClearEditModeMeshs();
                ElapsedTime = 0f;
                return;
            }
#endif

            for (int i = 0; i < EflList.Count; i++)
            {
                EffectLayer el = EflList[i];
                el.Reset();
            }
            DeActive();
            ElapsedTime = 0f;

            if (AutoDestroy)
            {
                GameObject.Destroy(gameObject);
            }
        }
Esempio n. 5
0
        void DoFinish()
        {
            mIsActive = false;

#if UNITY_EDITOR
            if (!EditorApplication.isPlaying)
            {
                //if this xffect is in XffectCache, we need to set it to inactive.
                if (transform.parent != null && transform.parent.GetComponent <XffectCache>() != null)
                {
                    DeActive();
                }
                else
                {
                    foreach (EffectLayer el in EflList)
                    {
                        el.Reset();
                    }

                    foreach (XftEventComponent e in EventList)
                    {
                        e.ResetCustom();
                    }

                    ClearEditModeMeshs();
                    ElapsedTime = 0f;
                    return;
                }
            }
#endif

            for (int i = 0; i < EflList.Count; i++)
            {
                EffectLayer el = EflList[i];
                el.Reset();
            }
            DeActive();
            ElapsedTime = 0f;

            if (AutoDestroy)
            {
                if (this.transform.parent)
                {
                    switch (this.transform.parent.tag)
                    {
                    case "meteo":
                        Destroy(this.transform.parent.gameObject);
                        if (this.transform.parent.parent.gameObject.layer == LayerMask.NameToLayer("Player"))
                        {
                            this.GetComponentInParent <JobBase>().ReturnPos();
                        }
                        if (this.transform.parent.parent.gameObject.layer == LayerMask.NameToLayer("Enemy"))
                        {
                            this.GetComponentInParent <EnemyBase>().ReturnPos();
                        }
                        break;

                    default:
                        if (this.transform.parent.gameObject.layer == LayerMask.NameToLayer("Enemy"))
                        {
                            this.GetComponentInParent <EnemyBase>().ReturnPos();
                        }
                        if (this.transform.parent.gameObject.layer == LayerMask.NameToLayer("Player"))
                        {
                            this.GetComponentInParent <JobBase>().ReturnPos();
                        }
                        break;
                    }
                }
                Destroy(this.gameObject);
            }
        }