Beispiel #1
0
 //播放大招畜力特效
 public void PlayXPSkillLiveEft(Transform parent, byte type, Vector2 pos)
 {
     m_SkillLiveEft = GameObject.Instantiate(m_SkillLiveObj[type]) as GameObject;
     m_SkillLiveEft.transform.SetParent(parent, false);
     m_SkillLiveEft.transform.position = new Vector3(pos.x, pos.y, 0);
     GlobalEffectMgr.SetEffectOnUI(m_SkillLiveEft);
 }
Beispiel #2
0
    //播放炮上的流光特效
    public void PlayMoveLight(Transform parent, byte type, byte seat)
    {
        m_MoveLightEft[seat] = GameObject.Instantiate(m_MoveLightObj[type]) as GameObject;
        m_MoveLightEft[seat].transform.SetParent(parent, false);
        GlobalEffectMgr.SetEffectOnUI(m_MoveLightEft[seat]);

        //  m_EffectList.Add(m_MoveLightEft[seat]);
    }
Beispiel #3
0
 void InitGoldEffect(Transform parent)
 {
     for (byte i = 0; i < m_GoldEft.Length; ++i)
     {
         m_GoldEft[i] = GameObject.Instantiate(GlobalEffectMgr.Instance.UIGoldEffect[i]) as GameObject;
         m_GoldEft[i].transform.SetParent(parent.GetChild(i).GetChild(0), false);
         GlobalEffectMgr.SetEffectOnUI(m_GoldEft[i]);
     }
 }
Beispiel #4
0
    public void PlayXPSkillMuzzleEft(Transform parent, byte type, Vector3 pos, float life)
    {
        GameObject go = GameObject.Instantiate(m_SkillMuzzleObj[type]) as GameObject;

        go.transform.SetParent(parent, false);
        go.transform.position = SceneRuntime.WorldToNGUI(pos);
        m_XPSkillMuzzleEft    = new GlobalEffectData(go, 0, life);
        GlobalEffectMgr.Instance.AddEffect(m_XPSkillMuzzleEft);
        GlobalEffectMgr.SetEffectOnUI(go);
        //m_EffectList.Add(go);
    }
Beispiel #5
0
 void ShowEffect()
 {
     for (byte i = 0; i < cardsObj.Length; i++)
     {
         GameObject go = (GameObject)GameObject.Instantiate(m_EffectLoad);
         GlobalEffectMgr.SetTrailEffectOnTopWnd(go);
         GlobalEffectMgr.SetMeshRendererOnTopWnd(go);
         go.transform.SetParent(cardsObj[i].transform.GetChild(0), false);
         go.transform.localPosition = Vector3.zero;
     }
 }
Beispiel #6
0
    //播放炮管子上特效
    public void PlayGaiEffect(Transform parent, byte type)
    {
        if (m_GaiEftObj[type] == null)
        {
            return;
        }
        GameObject go = GameObject.Instantiate(m_GaiEftObj[type]) as GameObject;

        go.transform.SetParent(parent, false);
        GlobalEffectMgr.SetEffectOnUI(go);
        // m_EffectList.Add(go);
    }
Beispiel #7
0
 public void GlobalInit()
 {
     m_ProgressValue = 0;
     m_bShow = false;
     Object go = Resources.Load("InnerRes/UI/Progress_bar");
     Object eft = Resources.Load("InnerRes/Effect/Progressbar_Effect");
     m_EffectObj = GameObject.Instantiate(eft) as GameObject;
     m_Progressbar = GameObject.Instantiate(go) as GameObject;
     m_Progressbar.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false);
     m_EffectObj.transform.SetParent(m_Progressbar.transform.GetChild(2), false);
     m_ProgressEffect = m_EffectObj.transform.GetChild(0).gameObject;
     m_ProgressEffect.SetActive(false);
     GlobalEffectMgr.SetEffectOnUI(m_EffectObj);
     m_ProgressSlider = m_Progressbar.transform.GetComponent<UISlider>();
     m_ProgressLabel = m_Progressbar.transform.GetChild(1).GetComponent<UILabel>();
     m_ProgressLabel.text = StringTable.GetString("res_loading");
     m_Progressbar.SetActive(false);
     m_EffectObj.SetActive(false);
 }
Beispiel #8
0
    public bool Init(ILogic logic, object obj)
    {
        //Screen.sleepTimeout = SleepTimeout.NeverSleep;
        m_bBeginDown = false;
        m_Logic      = (UpdateLogic)logic;
        SceneObjMgr.Instance.LoadInnerUpdateBackMat();

        Object     go     = Resources.Load("InnerRes/UI/Progress_bar");
        Object     eft    = Resources.Load("InnerRes/Effect/Progressbar_Effect");
        GameObject eftObj = GameObject.Instantiate(eft) as GameObject;

        m_Progressbar = GameObject.Instantiate(go) as GameObject;
        m_Progressbar.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false);
        eftObj.transform.SetParent(m_Progressbar.transform.GetChild(2), false);
        m_ProgressEffect = eftObj.transform.GetChild(0).gameObject;
        m_ProgressEffect.SetActive(false);
        GlobalEffectMgr.SetEffectOnUI(eftObj);
        m_ProgressSlider = m_Progressbar.transform.GetComponent <UISlider>();
        m_ProgressLabel  = m_Progressbar.transform.GetChild(1).GetComponent <UILabel>();
        m_str            = StringTable.GetString("check_wait");
        return(true);
    }
Beispiel #9
0
    void InitCenterBtn()
    {
        //Right
        Transform baseTr_R = BaseTranF.GetChild(0);

        m_INfObj[0]      = baseTr_R.gameObject;
        m_CenterRightBtn = new CenterRightBtn[baseTr_R.childCount];

        for (byte i = 0; i < baseTr_R.childCount; ++i)
        {
            m_CenterRightBtn[i].m_Btn.m_BtnObj = baseTr_R.GetChild(i).gameObject;
            m_CenterRightBtn[i].m_Btn.m_Btn    = m_CenterRightBtn[i].m_Btn.m_BtnObj.GetComponent <UIButton>();
            m_CenterRightBtn[i].m_Lock         = baseTr_R.GetChild(i).GetChild(1).gameObject;
            if (i == 0)
            {
                m_CenterRightBtn[i].m_Btn.m_IsChecked     = true;
                m_CenterRightBtn[i].m_Btn.m_Btn.isEnabled = true;
                m_CenterRightBtn[i].m_bLock = false;
            }
            else
            {
                m_CenterRightBtn[i].m_bLock           = true;
                m_CenterRightBtn[i].m_Btn.m_IsChecked = false;
                m_CenterRightBtn[i].m_Lock.SetActive(true);
                // m_CenterRightBtn[i].m_Btn.m_Btn.isEnabled = false;
            }
            m_CenterRightBtn[i].m_Btn.m_Tag = i;
            GetBtnLister(m_CenterRightBtn[i].m_Btn.m_BtnObj).onClick = OnCheckCenterRightBtn;
            m_CenterRightBtn[i].m_Tween.m_alpha = m_CenterRightBtn[i].m_Btn.m_Btn.gameObject.GetComponent <TweenAlpha>();
            m_CenterRightBtn[i].m_Tween.m_Pos   = m_CenterRightBtn[i].m_Btn.m_Btn.gameObject.GetComponent <TweenPosition>();
            //GameObject GEobj = GameObject.Instantiate(m_EffectRigthBtn[i]) as GameObject;
            //GEobj.transform.SetParent(m_CenterRightBtn[i].m_Btn.m_BtnObj.transform,false);
        }
        m_CenterRightBtn[2].m_Btn.m_BtnObj.SetActive(ServerSetting.ShowHallThirdBtn);
        //left
        Transform baseTr_L = BaseTranF.GetChild(1);

        m_CenterObj                       = baseTr_L.gameObject;
        m_INfObj[1]                       = baseTr_L.gameObject;
        m_CenterLiftBtn.m_BGSp            = baseTr_L.GetChild(0).GetComponent <UISprite>();
        m_CenterLiftBtn.m_Btn.m_Btn       = baseTr_L.GetComponent <UIButton>();
        m_CenterLiftBtn.m_Btn.m_IsChecked = false;
        m_CenterLiftBtn.m_Btn.m_Tag       = 0;
        GetBtnLister(m_CenterLiftBtn.m_Btn.m_Btn.gameObject).onClick = OnClickCenterLiftBtn;
        m_CenterLiftBtn.m_Lock   = baseTr_L.GetChild(1).gameObject;
        m_CenterLiftBtn.m_Title  = baseTr_L.GetChild(2).GetComponent <UISprite>();
        m_CenterLiftBtn.m_Effect = new GameObject[3];
        for (byte i = 0; i < 3; ++i)
        {
            m_CenterLiftBtn.m_Effect[i] = GameObject.Instantiate(

                m_EffectLiftBtn[i]) as GameObject;
            m_CenterLiftBtn.m_Effect[i].transform.SetParent(m_CenterLiftBtn.m_BGSp.transform, false);
            GlobalEffectMgr.SetEffectOnUI(m_CenterLiftBtn.m_Effect[i]);
        }
        GlobalEffectMgr.SetEffectOnUI(baseTr_L.GetChild(0).GetChild(0).gameObject);
        m_CenterLiftBtn.m_BtnTag = 0;

        Center_L_BtnBgChange(0);
        m_CenterRightBtn[2].m_Btn.m_BtnObj.SetActive(ServerSetting.ShowMatch);
    }
Beispiel #10
0
    public void Update(float deltaTime)
    {
        if (isCount && m_CoundDownObj != null)
        {
            m_CoundDownObj.SetActive(true);
            count         -= deltaTime;
            CountDown.text = ((int)count).ToString();
            if (count <= 0)
            {
                isCount = false;
                count   = 11;
                m_CoundDownObj.SetActive(false);
                if (m_Btn[0].activeSelf)
                {
                    BeginChooseCard(m_Btn[0]);
                }
                else if (m_Btn[1].activeSelf)
                {
                    CloseClick(null);
                }
                else
                {
                    ChooseCard(cardsObj[0].transform.GetChild(0).gameObject);
                }
            }
        }

        if (cardTurnBack)
        {
            countCard += deltaTime;
            if (countCard >= 0.1f)
            {
                cardsObj[numCard].transform.GetChild(0).GetComponent <Animator>().SetBool("frontToBack", true);
                cardsObj[numCard].transform.GetChild(0).GetChild(0).gameObject.SetActive(false);
                numCard++;
                countCard = 0;
                //if (numCard==1)
                {
                    GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_lottery2);
                }
                if (numCard > 5)
                {
                    cardTurnBack      = false;
                    showShuffleCount  = 0.0f;
                    isShowShuffleCard = true;
                    numCard           = 0;
                }
            }
        }

        if (isShowOtherCard)
        {
            ShowOtherCount += deltaTime;
            if (ShowOtherCount >= 0.3f)
            {
                m_Btn[1].SetActive(true);
                ShowOtherCard(chooseID);
                isShowOtherCard = false;
                GameObject go     = (GameObject)GameObject.Instantiate(m_EffectLoad);
                GameObject effect = (GameObject)GameObject.Instantiate(m_EffectCardTrunLoad);
                GlobalEffectMgr.SetTrailEffectOnTopWnd(go);
                GlobalEffectMgr.SetMeshRendererOnTopWnd(go);
                go.transform.SetParent(chooseCard.transform, false);
                go.transform.localPosition = Vector3.zero;
                effect.transform.SetParent(chooseCard.transform, false);
                effect.transform.localPosition = Vector3.zero;

                UISprite[] sprite = chooseCard.transform.GetChild(0).GetComponentsInChildren <UISprite>();
                UILabel[]  label  = chooseCard.transform.GetComponentsInChildren <UILabel>();
                foreach (UISprite s in sprite)
                {
                    s.depth = 121;
                }
                chooseCard.transform.GetChild(0).GetComponent <UISprite>().depth = 120;
                foreach (UILabel l in label)
                {
                    l.depth = 121;
                }
                m_mask.GetComponent <UITexture>().depth = 119;
                isCount = true;
                count   = 11;
            }
        }

        if (isShowShuffleCard)
        {
            showShuffleCount += deltaTime;
            if (showShuffleCount >= 0.5f)
            {
                ShuffleCard();
            }
            if (showShuffleCount >= 3)
            {
                isShowEffect      = true;
                showEffectCount   = 0.0f;
                cardIndex         = 0;
                isCount           = true;
                count             = 11;
                isShowShuffleCard = false;
                m_Effect[0].SetActive(true);
            }
        }
        if (isShowEffect)
        {
            showEffectCount += deltaTime;
            if (showEffectCount >= 0.1f)
            {
                GameObject go = (GameObject)GameObject.Instantiate(m_EffectLoad);
                GlobalEffectMgr.SetTrailEffectOnTopWnd(go);
                GlobalEffectMgr.SetMeshRendererOnTopWnd(go);
                go.transform.SetParent(cardsObj[cardIndex].transform.GetChild(0), false);
                go.transform.localPosition = Vector3.zero;
                if (cardIndex == 5)
                {
                    for (byte i = 0; i < cardsObj.Length; i++)
                    {
                        UIEventListener.Get(cardsObj[i].transform.GetChild(0).gameObject).onClick = ChooseCard;
                    }
                    isShowEffect = false;
                }
                else
                {
                    cardIndex++;
                    showEffectCount = 0.0f;
                }
            }
        }
    }
Beispiel #11
0
    public void ShowWonderfulUI(CatchedData cd)
    {
        if (m_BaseWndObject.activeSelf == true)
        {
            if (m_GlobalEffect.IsEnd == false)
            {
                m_GlobalEffect.Life = 0;
            }
            DestorySelf();
        }
        float lifetime  = 3.8f;
        float efttime   = 0.1f;
        float delaytime = 0.1f;

        if (cd.CatchType == 2)
        {
            switch (cd.SubType)
            {
            case (byte)SkillType.SKILL_FREEZE:
            {
                lifetime  = 3.8f;
                efttime   = 0.2f;
                delaytime = 0.2f;
            }
            break;

            case (byte)SkillType.SKILL_LIGHTING:
            {
                lifetime  = 3.8f;
                efttime   = 2.0f;
                delaytime = 2.0f;
            }
            break;

            case (byte)SkillType.SKILL_TORNADO:
            {
                lifetime  = 3.8f;
                efttime   = 2.2f;
                delaytime = 2.2f;
            }
            break;
            }
        }
        m_LifeTime = lifetime;
        m_Scroe    = cd.GoldNum;
        m_BaseWndObject.SetActive(true);
        m_SocreLabel.text = "0";

        //播放特效
        GameObject Eft = GameObject.Instantiate(m_EftObj) as GameObject;

        m_GlobalEffect = new GlobalEffectData(Eft, efttime, 4.5f);
        GlobalEffectMgr.Instance.AddEffect(m_GlobalEffect);
        GlobalEffectMgr.SetEffectOnUI(Eft);

        m_TweenScale.delay = delaytime;
        m_bDelay           = true;
        m_DelayInterval    = delaytime;
        m_bNumAinm         = true;

        m_TweenScale.ResetToBeginning();
        m_TweenScale.PlayForward();
    }
Beispiel #12
0
    public void Init(Object obj)
    {
        m_BaseWndObject = GameObject.Instantiate(obj) as GameObject;
        m_BaseTrans     = m_BaseWndObject.transform;
        m_BaseTrans.SetParent(SceneObjMgr.Instance.UIPanelTransform, false);
        Vector3 pos = m_Pos;

        for (byte i = 0; i < 2; ++i)
        {
            m_ChildTrans[i]     = m_BaseTrans.GetChild(i);
            m_Combo[i].m_Object = m_BaseTrans.GetChild(i).gameObject;

            m_Combo[i].m_HitBg      = m_ChildTrans[i].GetChild(1).GetComponent <UISprite>();
            m_Combo[i].m_ZiTi       = m_ChildTrans[i].GetChild(3).GetComponent <UISprite>();
            m_Combo[i].m_Alpha_Num  = m_ChildTrans[i].GetChild(0).GetComponent <TweenAlpha>();
            m_Combo[i].m_Alpha_ZiTi = m_ChildTrans[i].GetChild(3).GetComponent <TweenAlpha>();
            m_Combo[i].m_Scale_Num  = m_ChildTrans[i].GetChild(0).GetComponent <TweenScale>();
            m_Combo[i].m_Scale_ZiTi = m_ChildTrans[i].GetChild(3).GetComponent <TweenScale>();

            if (m_IsMySelf)
            {
                m_Pos.x = -1.25f;
                m_Pos.y = 0.42f;
                m_ChildTrans[i].localScale = new Vector3(1f, 1f, 1f);
                m_Combo[i].m_Panle_Energy  = m_ChildTrans[i].GetChild(1).GetChild(0).GetComponent <UIPanel>();
                m_Combo[i].m_Energy        = m_ChildTrans[i].GetChild(1).GetChild(0).GetChild(0).GetComponent <UISprite>();
                Vector2 Panle_set = m_Combo[i].m_Panle_Energy.clipOffset;
                Panle_set.x = 0;
                m_Combo[i].m_Panle_Energy.clipOffset = Panle_set;
                m_Speed = m_Combo[i].m_Panle_Energy.width;
            }
            else
            {
                m_Pos = pos;
                if (m_Pos.y > 0)
                {
                    m_Pos.y -= 0.235f;
                }
                else
                {
                    m_Pos.y += 0.235f;
                }
                m_Pos.x -= 0.59f;
                m_ChildTrans[i].localScale = new Vector3(0.5f, 0.5f, 0.5f);
                if (m_Combo[i].m_HitBg.gameObject.activeSelf != false)
                {
                    m_Combo[i].m_HitBg.gameObject.SetActive(false);
                }
            }
            m_ChildTrans[i].position = m_Pos;
        }
        m_Combo[0].m_Star  = m_ChildTrans[0].GetChild(2).GetComponent <UISprite>();
        m_Combo[0].m_label = new UILabel[4];
        for (byte j = 0; j < 4; ++j)
        {
            m_Combo[0].m_label[j] = m_ChildTrans[0].GetChild(0).GetChild(j).GetComponent <UILabel>();
        }

        if (!m_IsMySelf)
        {
            m_Combo[0].m_Star.gameObject.SetActive(false);
        }
        else
        {
            GameObject go = GameObject.Instantiate(SceneRuntime.PlayerMgr.ComboEftObj) as GameObject;
            go.transform.SetParent(m_ChildTrans[1].GetChild(2), false);
            GlobalEffectMgr.SetEffectOnUI(go);
            if (go.transform.GetChild(0).gameObject.activeSelf != true)
            {
                go.transform.GetChild(0).gameObject.SetActive(true);
            }
        }

        //调整位置
        if (m_IsMySelf && SceneRuntime.LogicUI.UnLockIsShow())
        {
            SetCobmoPos(false);
        }
    }