void AddParticle(bool add)
    {
        UIParticleWidget p = Particle.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = Particle.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 100;
        }
        if (add)
        {
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddParticle(50025);
            }
        }
        else
        {
            if (p != null)
            {
                p.ReleaseParticle();
            }
        }
    }
Exemple #2
0
    /// <summary>
    /// 添加流光特效
    /// </summary>
    /// <param name="b"></param>
    public void SetEffect(bool b)
    {
        if (b)
        {
            m_effectRoot.SetActive(true);
            m_effectRoot.transform.localPosition = new Vector3(130, -26.5f - (m_nHeight - 56) * 0.5f, 0);
            m_effectRoot.transform.localScale    = new Vector3(1, m_nHeight / 56.0f, 1);

            //特效
            UIParticleWidget wight = m_effectRoot.GetComponent <UIParticleWidget>();
            if (null == wight)
            {
                wight       = m_effectRoot.AddComponent <UIParticleWidget>();
                wight.depth = 100;
            }

            if (wight != null)
            {
                wight.SetDimensions(1, 1);
                wight.ReleaseParticle();
                wight.AddParticle(50026);
            }
        }
        else
        {
            m_effectRoot.SetActive(false);
        }
    }
Exemple #3
0
    void ControlMainBtnParticle(Transform parent, bool bShow)
    {
        if (parent != null)
        {
            Transform effect = parent.Find("effect");
            if (effect)
            {
                UIParticleWidget wight = effect.GetComponent <UIParticleWidget>();

                if (wight == null)
                {
                    wight       = effect.gameObject.AddComponent <UIParticleWidget>();
                    wight.depth = 20;
                }
                if (wight != null)
                {
                    wight.SetDimensions(1, 1);
                    wight.ReleaseParticle();
                    if (bShow)
                    {
                        wight.AddParticle(50040);
                    }
                    m_initMainPanel = bShow;
                }
            }
        }
    }
Exemple #4
0
    void InitControls()
    {
        if (!bInit)
        {
            Transform parent = transform.parent;
            if (parent == null)
            {
                return;
            }
            Transform levelTrans = parent.Find("level");
            if (levelTrans != null)
            {
                m_labelLevel = levelTrans.GetComponent <UILabel>();
            }

            Transform nameTrans = parent.Find("name");
            if (nameTrans != null)
            {
                m_labelName = nameTrans.GetComponent <UILabel>();
            }

            GameObject go = parent.Find("choose").gameObject;
            if (go != null)
            {
                m_sprSelect = parent.Find("choose").GetComponent <UISprite>();
                m_sprSelect.gameObject.SetActive(false);
            }

            Transform maskTrans = parent.Find("mask");

            if (maskTrans != null)
            {
                m_sprMask = maskTrans.GetComponent <UISprite>();
                m_sprMask.gameObject.SetActive(true);
            }

            m_transChange = parent.Find("canset");

            Transform iconTrans = parent.Find("select");
            if (iconTrans != null)
            {
                m_sprIcon = iconTrans.GetComponent <UITexture>();
                particle  = iconTrans.Find("TeXiaoRoot").GetComponent <UIParticleWidget>();
                if (particle == null)
                {
                    particle       = iconTrans.Find("TeXiaoRoot").gameObject.AddComponent <UIParticleWidget>();
                    particle.depth = 100;
                }
            }


            m_transLock  = parent.Find("lock");
            m_transSet   = parent.Find("setting");
            m_goRedPoint = parent.Find("redPoint").gameObject;
            bInit        = true;
        }
    }
Exemple #5
0
    IEnumerator DelayToCloseCopyTargetEffect(float delay)
    {
        yield return(new WaitForSeconds(delay));

        UIParticleWidget p = m_trans_copyTargetEffectRoot.GetComponent <UIParticleWidget>();

        if (p != null)
        {
            p.ReleaseParticle();
        }
    }
Exemple #6
0
 public override void Release(bool depthRelease = true)
 {
     base.Release(depthRelease);
     if (m_goSelect != null)
     {
         UIParticleWidget p = m_goSelect.GetComponent <UIParticleWidget>();
         if (p != null)
         {
             p.ReleaseParticle();
         }
     }
 }
Exemple #7
0
    /// <summary>
    /// 自动挂机特效
    /// </summary>
    void PlayRobotEffect(bool isShow)
    {
        //特效
        UIParticleWidget wight = m_trans_robotEffectRoot.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = m_trans_robotEffectRoot.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 100;
        }

        if (isShow)
        {
            //1、挂机特效
            m_trans_robotEffectRoot.gameObject.SetActive(true);
            m_trans_pathEffectRoot.gameObject.SetActive(false);
            m_label_tipsLabelRoot.gameObject.SetActive(false);

            if (wight != null)
            {
                wight.ReleaseParticle();
                wight.AddParticle(50022);
            }

            //2、 挂机按钮状态
            if (m_spriteEx_btnAutoFight != null)
            {
                m_spriteEx_btnAutoFight.ChangeSprite(2);
            }
        }
        else
        {
            //1、释放特效
            m_trans_robotEffectRoot.gameObject.SetActive(false);
            if (wight != null)
            {
                wight.ReleaseParticle();
            }

            //2、 挂机按钮状态
            if (m_spriteEx_btnAutoFight != null)
            {
                m_spriteEx_btnAutoFight.ChangeSprite(1);
            }
        }
    }
Exemple #8
0
    /// <summary>
    /// 宝箱领取提示特效
    /// </summary>
    void PlayEffect()
    {
        //特效
        UIParticleWidget wight = m_btn_BoxOpen.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = m_btn_BoxOpen.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 100;
        }

        if (wight != null)
        {
            wight.ReleaseParticle();
            wight.AddParticle(50035);
        }
    }
Exemple #9
0
 /// <summary>
 /// 五行阵环绕特效
 /// </summary>
 public void PlayCopyTargetEffect()
 {
     if (m_trans_copyTargetEffectRoot != null)
     {
         UIParticleWidget p = m_trans_copyTargetEffectRoot.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = m_trans_copyTargetEffectRoot.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(260, 225);
             p.ReleaseParticle();
             p.AddRoundParticle();
         }
     }
 }
Exemple #10
0
    void ShowEffect(uint effectID)
    {
        Transform bg = transform.Find("Up/RedEnvelopeScrollView/gridRoot");

        if (bg != null)
        {
            UIParticleWidget p = bg.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = bg.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 100;
            }
            if (p != null)
            {
                p.ReleaseParticle();
                p.AddParticle(effectID);
            }
        }
    }
Exemple #11
0
    /// <summary>
    /// 寻路特效
    /// </summary>
    void PlayPathEffect()
    {
        m_trans_robotEffectRoot.gameObject.SetActive(false);
        m_trans_pathEffectRoot.gameObject.SetActive(true);
        m_label_tipsLabelRoot.gameObject.SetActive(false);
        //特效
        UIParticleWidget wight = m_trans_pathEffectRoot.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = m_trans_pathEffectRoot.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 100;
        }

        if (wight != null)
        {
            wight.ReleaseParticle();
            wight.AddParticle(50021);
        }
    }
Exemple #12
0
 void PlayEffect(bool show)
 {
     if (particle != null)
     {
         UIParticleWidget p = particle.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = particle.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(1, 1);
             p.ReleaseParticle();
             if (show)
             {
                 p.AddParticle(50036);
             }
         }
     }
 }