Exemple #1
0
    /// <summary>
    /// 显示代金券商户信息5个字.
    /// </summary>
    void ShowDaiJinQuanShangHuInfo(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type, SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJinQuanType)
    {
        if (m_DaiJinQuanShangHuInfo != null)
        {
            string info = "";
            if (XkGameCtrl.GetInstance().m_SSShangHuInfo != null)
            {
                switch (type)
                {
                case SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss:
                {
                    info = XkGameCtrl.GetInstance().m_SSShangHuInfo.GetJPBossShangHuMingDt();
                    break;
                }

                case SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe:
                {
                    info = XkGameCtrl.GetInstance().m_SSShangHuInfo.GetShangHuMingDt(daiJinQuanType).ShangHuJiangPinName;
                    break;
                }
                }
            }

            if (info != "")
            {
                m_DaiJinQuanShangHuInfo.text = info;
            }
        }
    }
    public void Init(PlayerEnum indexPlayer, int caiPiaoNum, Vector3 pos, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type, GameObject exp)
    {
        m_IndexPlayer     = indexPlayer;
        m_CaiPiaoNum      = caiPiaoNum;
        m_DeCaiState      = type;
        m_StartPos        = pos;
        m_ExplosionPrefab = exp;

        if (m_ExplosionPoint == null)
        {
            m_ExplosionPoint = new GameObject();
        }
        m_ExplosionPoint.transform.position = pos;
        if (Camera.main != null)
        {
            m_ExplosionPoint.transform.SetParent(Camera.main.transform);
        }

        Vector3 posUI = XkGameCtrl.GetInstance().GetWorldObjToScreenPos(pos);

        transform.localPosition = posUI;
        ShowCaiPiaoInfo();
        StartCoroutine(DelayShowCaiPiaoInfo());

        if (type == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
        {
            //开启镜头微动.
            XkGameCtrl.GetInstance().IsDisplayBossDeathYanHua = true;
        }
    }
Exemple #3
0
    public void InitCaiPiaoAnimation(float timeVal, PlayerEnum indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType, SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJinQaunType)
    {
#if OPEN_CAIPIAO_ANIMATION
        IndexPlayer        = indexPlayer;
        TimeCaiPiaoAni     = timeVal;
        TimeLastCaiPiaoAni = Time.time;
        IsInitCaiPiaoAni   = true;

        if (m_AniAudio != null)
        {
            m_AniAudio.enabled = true;
            m_AniAudio.loop    = true;
            m_AniAudio.Play();
        }
#else
        IndexPlayer = indexPlayer;
        ShowPlayerCaiPiaoInfo();
        ShowDaiJinQuanShangHuInfo(deCaiType, daiJinQaunType);
#endif

        if (SSUIRoot.GetInstance().m_GameUIManage != null)
        {
            SSUIRoot.GetInstance().m_GameUIManage.CreatPlayerDaiJinQuanUI(indexPlayer);
        }
    }
Exemple #4
0
    /// <summary>
    /// 设置商户名称信息.
    /// </summary>
    void SetShangJiaInfo(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType, SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJinQuanType)
    {
        if (m_ShangJiaInfoLb != null)
        {
            string shangHuInfo = "盛世网络";
            if (XkGameCtrl.GetInstance().m_SSShangHuInfo != null)
            {
                if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
                {
                    shangHuInfo = XkGameCtrl.GetInstance().m_SSShangHuInfo.GetJPBossShangHuMingDt();
                }
                else
                {
                    shangHuInfo = XkGameCtrl.GetInstance().m_SSShangHuInfo.GetShangHuMingDt(daiJinQuanType).ShangHuJiangPinName;
                }
            }

            if (shangHuInfo.Length > 5)
            {
                //最多支持5个字.
                shangHuInfo = shangHuInfo.Substring(0, 5);
            }
            m_ShangJiaInfoLb.text = shangHuInfo;
        }
    }
Exemple #5
0
    /// <summary>
    /// 显示爆炸粒子的彩票UI数量信息.
    /// </summary>
    internal void ShowNumUI(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType, XKNpcHealthCtrl healthCom)
    {
        if (healthCom != null)
        {
            SetShangJiaInfo(deCaiType, healthCom.NpcScript.m_DaiJinQuanState);
        }

        if (m_CaiPiaoInfoParent != null)
        {
            m_CaiPiaoInfoParent.gameObject.SetActive(true);
        }
        enabled        = true;
        m_NpcHealthCom = healthCom;

        SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJiQuan = healthCom.NpcScript.m_DaiJinQuanState;
        int num = XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetPrintCaiPiaoValueByDeCaiState(deCaiType,
                                                                                                                                          SSCaiPiaoDataManage.SuiJiDaoJuState.BaoXiang, daiJiQuan);

        string numStr = num.ToString();

        if (m_FixedUiPosDt != null && m_FixedUiPosDt.IsFixPosX)
        {
            if (m_FixedUiPosDt.UIParent != null)
            {
                int len = numStr.Length;
                if (m_FixedUiPosDt.m_PosXArray.Length >= len)
                {
                    //动态修改UI数据的父级坐标.
                    Vector3 posTmp = m_FixedUiPosDt.UIParent.localPosition;
                    posTmp.x = m_FixedUiPosDt.m_PosXArray[len - 1];
                    m_FixedUiPosDt.UIParent.localPosition = posTmp;
                }
            }
        }

        int max    = m_NumRenderArray.Length;
        int numVal = num;
        int valTmp = 0;
        int powVal = 0;

        for (int i = 0; i < max; i++)
        {
            if (max - i > numStr.Length && IsHiddenGaoWeiNumZero)
            {
                //隐藏数据高位的0.
                m_NumRenderArray[i].material = XkGameCtrl.GetInstance().m_CaiPiaoLiZiNumATouMing;
            }
            else
            {
                //m_UISpriteArray[i].enabled = true;
                powVal = (int)Mathf.Pow(10, max - i - 1);
                valTmp = numVal / powVal;
                //UnityLog("ShowNumUI -> valTmp ====== " + valTmp);
                m_NumRenderArray[i].material = XkGameCtrl.GetInstance().m_NpcCaiPiaoNumArray[valTmp];
                //m_UISpriteArray[i].spriteName = valTmp.ToString();
                numVal -= valTmp * powVal;
            }
        }
    }
    /// <summary>
    /// 显示战车和boss的飞行彩票.
    /// </summary>
    void ShowCaiPiaoZhanCheBossFlyCaiPiao(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType, PlayerEnum indexPlayer, Vector3 startPos)
    {
        //Debug.LogWarning("Unity: ShowCaiPiaoZhanCheBossFlyCaiPiao -> deCaiType ========= " + deCaiType);
        if (m_ExplosionPrefab != null)
        {
            if (m_ExplosionPoint != null)
            {
                startPos = m_ExplosionPoint.transform.position;
                Destroy(m_ExplosionPoint);
            }
            GameObject objExplode = (GameObject)Instantiate(m_ExplosionPrefab, startPos, Quaternion.identity);
            objExplode.transform.parent = XkGameCtrl.NpcAmmoArray;
            XkGameCtrl.CheckObjDestroyThisTimed(objExplode);

            SSCaiPiaoLiZiManage caiPiaoLiZi = objExplode.GetComponent <SSCaiPiaoLiZiManage>();
            if (caiPiaoLiZi != null)
            {
                caiPiaoLiZi.ShowNumUI(m_CaiPiaoNum, indexPlayer);
            }
            else
            {
                Debug.LogWarning("CheckNpcDeathExplode -> caiPiaoLiZi was null.................");
            }
        }

        if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe)
        {
            if (XkGameCtrl.GetInstance().m_CaiPiaoFlyData != null)
            {
                //初始化飞出的彩票逻辑.
                XkGameCtrl.GetInstance().m_CaiPiaoFlyData.InitCaiPiaoFly(startPos, indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe);
            }
            else
            {
                Debug.LogWarning("CreatLiZi -> m_CaiPiaoFlyData was null............");
            }
        }
        else if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
        {
            if (SSUIRoot.GetInstance().m_GameUIManage != null)
            {
                SSUIRoot.GetInstance().m_GameUIManage.InitCaiPiaoAnimation(XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_JPBossCaiPiaoFlyDt.TimeLeiJiaVal, indexPlayer);
            }

            if (XkGameCtrl.GetInstance().m_CaiPiaoFlyData != null)
            {
                //初始化烟花粒子的产生.
                XkGameCtrl.GetInstance().m_CaiPiaoFlyData.InitPlayCaiPiaoYanHua();
            }
            else
            {
                Debug.LogWarning("CreatLiZi -> m_CaiPiaoFlyData was null............");
            }
        }
    }
Exemple #7
0
    public void Init(int indexCaiPiao, float timeFly, Vector3[] path, PlayerEnum indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type)
    {
        IndexCaiPiao = indexCaiPiao;
        IndexPlayer  = indexPlayer;
        m_DeCaiState = type;

        iTween.MoveTo(gameObject, iTween.Hash("path", path,
                                              "time", timeFly,
                                              "orienttopath", false,
                                              "easeType", iTween.EaseType.linear,
                                              "oncomplete", "MoveCaiPiaoOnCompelteITween"));
    }
 /// <summary>
 /// 初始化彩票飞出数据信息.
 /// </summary>
 public void InitCaiPiaoFly(Vector3 startPos, PlayerEnum indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type)
 {
     if (m_CaiPiaoFlyManageDtList != null)
     {
         GameObject gmDataPrefab = (GameObject)Resources.Load("Prefabs/GameData/CaiPiaoFlyManageDt");
         GameObject obj          = m_CaiPiaoFlyManageDtList.FindObjByPrefab(gmDataPrefab, transform);
         if (obj != null)
         {
             //SSCaiPiaoFlyManage caiPiaoFlyManage = gameObject.AddComponent<SSCaiPiaoFlyManage>();
             SSCaiPiaoFlyManage caiPiaoFlyManage = obj.GetComponent <SSCaiPiaoFlyManage>();
             if (caiPiaoFlyManage != null)
             {
                 caiPiaoFlyManage.Init(startPos, indexPlayer, type);
             }
         }
     }
 }
Exemple #9
0
    public void Init(PlayerEnum indexPlayer, int caiPiaoNum, Vector3 pos, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type,
                     GameObject exp, SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJinQuanType)
    {
        ShowDaiJinQuanShangHuInfo(type, daiJinQuanType);
        m_IndexPlayer     = indexPlayer;
        m_CaiPiaoNum      = caiPiaoNum;
        m_DeCaiState      = type;
        m_StartPos        = pos;
        m_ExplosionPrefab = exp;

        if (m_ExplosionPoint == null)
        {
            m_ExplosionPoint = new GameObject();
        }
        m_ExplosionPoint.transform.position = pos;
        if (Camera.main != null)
        {
            m_ExplosionPoint.transform.SetParent(Camera.main.transform);
        }

        Vector3 posUI = XkGameCtrl.GetInstance().GetWorldObjToScreenPos(pos);

        transform.localPosition = posUI;
        ShowCaiPiaoInfo();

        if (type == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
        {
            //开启镜头微动.
            XkGameCtrl.GetInstance().IsDisplayBossDeathYanHua = true;
        }

        if (m_Animator != null)
        {
            IsCloseZhuanPanAni = false;
            m_Animator.enabled = true;
            //m_Animator.enabled = false; //test
        }
        SetActive(true);
        StartCoroutine(DelayShowCaiPiaoInfo(daiJinQuanType));
    }
    public void Init(Vector3 startPos, PlayerEnum indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type)
    {
        m_CaiPiaoStartPos = startPos;
        switch (indexPlayer)
        {
        case PlayerEnum.PlayerOne:
        {
            m_CaiPiaoEndTr = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_CaiPiaoEndTrP1;
            break;
        }

        case PlayerEnum.PlayerTwo:
        {
            m_CaiPiaoEndTr = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_CaiPiaoEndTrP2;
            break;
        }

        case PlayerEnum.PlayerThree:
        {
            m_CaiPiaoEndTr = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_CaiPiaoEndTrP3;
            break;
        }
        }

        switch (type)
        {
        case SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe:
        {
            if (m_ZhanCheCaiPiaoFlyObjListCom == null)
            {
                m_ZhanCheCaiPiaoFlyObjListCom = gameObject.AddComponent <SSGameObjListManage>();
            }
            m_MaxCaiPiao       = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_ZhanCheCaiPiaoFlyDt.MaxCaiPiao;
            m_TimeFly          = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_ZhanCheCaiPiaoFlyDt.TimeFly;
            m_FlyCaiPiaoPrefab = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_ZhanCheFlyCaiPiaoPrefab;
            break;
        }

        case SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.SuiJiDaoJu:
        {
            if (m_SuiJiDaoJuCaiPiaoFlyObjListCom == null)
            {
                m_SuiJiDaoJuCaiPiaoFlyObjListCom = gameObject.AddComponent <SSGameObjListManage>();
            }
            m_MaxCaiPiao       = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_SuiJiCaiPiaoFlyDt.MaxCaiPiao;
            m_TimeFly          = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_SuiJiCaiPiaoFlyDt.TimeFly;
            m_FlyCaiPiaoPrefab = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_FlyCaiPiaoPrefab;
            break;
        }

        case SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhengChang:
        {
            if (m_ZhengChangCaiPiaoFlyObjListCom == null)
            {
                m_ZhengChangCaiPiaoFlyObjListCom = gameObject.AddComponent <SSGameObjListManage>();
            }
            m_MaxCaiPiao       = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_ZhengChangCaiPiaoFlyDt.MaxCaiPiao;
            m_TimeFly          = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_ZhengChangCaiPiaoFlyDt.TimeFly;
            m_FlyCaiPiaoPrefab = XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_FlyCaiPiaoPrefab;
            break;
        }
        }

        if (m_FlyCaiPiaoPrefab == null)
        {
            UnityLogWarning("Init -> m_FlyCaiPiaoPrefab was null. type ======== " + type);
            Destroy(this);
            return;
        }

        m_LastCaiPiaoTime = Time.time;
        m_CaiPiaoCount    = 0;
        IndexPlayer       = indexPlayer;
        m_DeCaiState      = type;
        IsCreatCaiPiao    = true;
        CreatFlyCaiPiao();
    }
    public void OnDamageNpc(int damageNpcVal         = 1,
                            PlayerEnum playerSt      = PlayerEnum.Null,
                            PlayerAmmoType pAmmoType = PlayerAmmoType.Null,
                            bool isAiFireAmmo        = false)
    {
        if (IsDeathNpc)
        {
            return;
        }

        if (pAmmoType == PlayerAmmoType.SanDanAmmo)
        {
            if (Time.time - TimeSanDanDamage < XKPlayerGlobalDt.GetInstance().TimeShouDongDaoDan)
            {
                //对于玩家的主炮散弹在同一次发射内只计算一次伤害.
                //SSDebug.LogWarning("************* pAmmoType ====== " + pAmmoType);
                return;
            }
            TimeSanDanDamage = Time.time;
        }

        if (pAmmoType == PlayerAmmoType.ChuanTouAmmo)
        {
            if (XKPlayerMvFanWei.GetInstanceQian() != null && XKPlayerCamera.GetInstanceFeiJi() != null)
            {
                Vector3 forwardVecCam = XKPlayerCamera.GetInstanceFeiJi().transform.forward;
                Vector3 posA          = transform.position;
                Vector3 posB          = XKPlayerMvFanWei.GetInstanceQian().transform.position;
                forwardVecCam.y = posA.y = posB.y = 0f;
                Vector3 vecBA = posA - posB;
                if (Vector3.Dot(forwardVecCam, vecBA) >= 0f)
                {
                    //npc在镜头前方范围之外,不受玩家子弹伤害.
                    return;
                }
            }
        }

        if (IsBackDaiJinQuanNpcBlood == true)
        {
            //代金券npc重置血值后,给一定时间的无敌状态.
            if (Time.time - m_TimeLastBackDaiJinQuanNpcBlood <= 0.5f)
            {
                return;
            }
            else
            {
                IsBackDaiJinQuanNpcBlood = false;
            }
        }

        //switch (NpcJiFen)
        //{
        //    case NpcJiFenEnum.Boss:
        //        if (!XKBossXueTiaoCtrl.GetInstance().GetIsCanSubXueTiaoAmount())
        //        {
        //            if (NpcDamageCom != null)
        //            {
        //                NpcDamageCom.PlayNpcDamageEvent();
        //            }
        //            return;
        //        }
        //        break;
        //}


        if (NpcDamageCom != null)
        {
            NpcDamageCom.PlayNpcDamageEvent();
        }

        if (NpcScript != null)
        {
            if (NpcScript.IsCaiPiaoZhanChe == true && NpcScript.IsEnterCameraBox == false)
            {
                //彩票战车和boss没有进入摄像机盒子,不计算伤害.
                return;
            }
        }

        if (CountActivePlayer != XkGameCtrl.PlayerActiveNum)
        {
            if (CountActivePlayer != 0)
            {
                //fix PuTongAmmoCount.
                int indexValTmp      = CountActivePlayer - 1;
                int puTongAmmoNumTmp = MaxPuTongAmmo[indexValTmp];
                indexValTmp = XkGameCtrl.PlayerActiveNum - 1;
                if (indexValTmp >= 0)
                {
                    float healthPer = (float)PuTongAmmoCount / puTongAmmoNumTmp;
                    //int oldPuTongAmmoCount = PuTongAmmoCount;
                    PuTongAmmoCount = (int)(healthPer * MaxPuTongAmmo[indexValTmp]);

                    /*Debug.Log("Unity:"+"fix npc health -> PuTongAmmoCount "+PuTongAmmoCount
                     +", oldPuTongAmmoCount "+oldPuTongAmmoCount);*/
                }
            }
            CountActivePlayer = XkGameCtrl.PlayerActiveNum;
        }

        if (NpcScript == null || (NpcScript != null && !NpcScript.GetIsWuDi()))
        {
            PuTongAmmoCount += damageNpcVal;
        }

        int indexVal = XkGameCtrl.PlayerActiveNum - 1;

        indexVal = indexVal < 0 ? 0 : indexVal;
        int puTongAmmoNum = MaxPuTongAmmo[indexVal];

        if (NpcScript != null)
        {
            if (NpcScript.IsZhanCheNpc || NpcScript.IsJPBossNpc)
            {
                if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                {
                    //当没有玩家激活游戏时,彩票战车和JPBoss采用原血量的一定比例来计算.
                    puTongAmmoNum = (int)(XkGameCtrl.GetInstance().m_ZhanCheBossBloodPer *puTongAmmoNum);
                }
            }
        }

        /*if (NpcJiFen == NpcJiFenEnum.Boss)
         * {
         *              float bossAmount = (float)(puTongAmmoNum - PuTongAmmoCount) / puTongAmmoNum;
         *              bossAmount = bossAmount < 0f ? 0f : bossAmount;
         *  if (XKBossXueTiaoCtrl.GetInstance() != null)
         *  {
         *      XKBossXueTiaoCtrl.GetInstance().SetBloodBossAmount(bossAmount, this);
         *  }
         *      }*/

        if (NpcScript != null)
        {
            if (NpcScript.IsCaiPiaoZhanChe == true)
            {
                if (XkGameCtrl.GetInstance() != null && XKPlayerFenShuCtrl.GetInstance() != null)
                {
                    if (pAmmoType == PlayerAmmoType.DaoDanAmmo ||
                        pAmmoType == PlayerAmmoType.PaiJiPaoAmmo ||
                        pAmmoType == PlayerAmmoType.ChuanTouAmmo ||
                        pAmmoType == PlayerAmmoType.SanDanAmmo ||
                        pAmmoType == PlayerAmmoType.ChongJiBoAmmo)
                    {
                        int jiFenVal = XkGameCtrl.GetInstance().m_DaoDanHitBossJiFen;
                        //XKPlayerFenShuCtrl.GetInstance().ShowPlayerFenShu(playerSt, GetJiFen(jiFenVal));
                        XKPlayerFenShuCtrl.GetInstance().ShowPlayerFenShu(playerSt, jiFenVal);
                    }
                }

                float bloodAmount = (float)(puTongAmmoNum - PuTongAmmoCount) / puTongAmmoNum;
                bloodAmount = bloodAmount < 0f ? 0f : bloodAmount;

                bool isCanJiBao = true;
                if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                {
                    //没有玩家激活游戏时,Ai都认为是可以击爆战车或Boss.
                }
                else
                {
                    //有玩家激活游戏.
                    if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null)
                    {
                        isCanJiBao = XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_CurrentTotalHealthDt.IsCanJiBao;
                    }
                }

                if (isCanJiBao == false)
                {
                    //不允许被玩家击爆的代金券npc.
                    if (IsBloodToStage02 == false)
                    {
                        if (bloodAmount <= 0.24f)
                        {
                            //强制保留一定的血量.
                            m_BloodAmoutValue      = bloodAmount = 0.24f;
                            IsBloodToStage02       = true;
                            m_TimeLastBloodToStage = Time.time;
                            PuTongAmmoCount        = puTongAmmoNum - 1;
                        }
                    }
                    else if (IsBloodToStage01 == false)
                    {
                        float minBloodAmount = 0.12f; //最小极限血值.
                        if (m_BloodAmoutValue > minBloodAmount)
                        {
                            //血值已经降到最低阶段.
                            float dTimeVal = 0.4f;
                            if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null)
                            {
                                dTimeVal = XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TimeNoDead;
                            }

                            if (Time.time - m_TimeLastBloodToStage >= dTimeVal)
                            {
                                //每次间隔一定时间减少一定血值.
                                m_TimeLastBloodToStage = Time.time;
                                float subBloodAmount = 0.02f; //每次减少的血值.
                                if (m_BloodAmoutValue > minBloodAmount)
                                {
                                    m_BloodAmoutValue -= subBloodAmount;
                                    if (m_BloodAmoutValue < minBloodAmount)
                                    {
                                        //强制保护的血值信息.
                                        m_BloodAmoutValue = minBloodAmount;
                                        IsBloodToStage01  = true;
                                    }
                                }
                            }
                        }
                        bloodAmount     = m_BloodAmoutValue;
                        PuTongAmmoCount = puTongAmmoNum - 1; //强制保留一定的血值.
                    }
                    else
                    {
                        float minBloodAmount = 0.03f; //最小极限血值.
                        if (m_BloodAmoutValue > minBloodAmount)
                        {
                            //血值已经降到最低阶段.
                            float dTimeVal = 0.4f;
                            if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null)
                            {
                                dTimeVal = XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TimeNoDead;
                            }

                            if (Time.time - m_TimeLastBloodToStage >= dTimeVal)
                            {
                                //每次间隔一定时间减少一定血值.
                                m_TimeLastBloodToStage = Time.time;
                                float subBloodAmount = 0.01f; //每次减少的血值.
                                if (m_BloodAmoutValue > minBloodAmount)
                                {
                                    m_BloodAmoutValue -= subBloodAmount;
                                    if (m_BloodAmoutValue < minBloodAmount)
                                    {
                                        //强制保护的血值信息.
                                        m_BloodAmoutValue = minBloodAmount;
                                    }
                                }
                            }
                        }
                        bloodAmount     = m_BloodAmoutValue;
                        PuTongAmmoCount = puTongAmmoNum - 1; //强制保留一定的血值.
                    }
                }

                //彩票战车和boss的血条UI信息更新.
                SSUIRoot.GetInstance().m_GameUIManage.SetDaiJinQuanNpcXueTiaoAmount(bloodAmount);

                if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                {
                    //没有玩家激活游戏时,Ai都认为是不可以击爆JPBoss特殊武器的.
                }
                else
                {
                    //JPBoss受到玩家子弹伤害.
                    if (NpcScript.IsJPBossNpc == true)
                    {
                        NpcScript.OnDamageJPBossWeapon(bloodAmount);
                    }
                }
            }
        }

        /*Debug.Log("Unity:"+"OnDamageNpc -> "
         +", nameNpc "+NpcNameInfo
         +", puTongAmmoNum "+puTongAmmoNum);*/
        if (PuTongAmmoCount >= puTongAmmoNum)
        {
            if (NpcScript != null)
            {
                if (NpcScript.IsZhanCheNpc)
                {
                    //战车npc是否可以被击爆的判断.
                    if (XkGameCtrl.GetInstance().IsCaiPiaoHuLuePlayerIndex == false && NpcScript.m_IndexPlayerJiBao != playerSt)
                    {
                        //不是可以击爆战车npc的玩家.
                        return;
                    }

                    if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                    {
                        //没有激活任何玩家.
                    }
                    else
                    {
                        if (!XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetIsChuCaiPiaoByDeCaiState(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe, NpcScript.m_DaiJinQuanState))
                        {
                            //战车彩池的彩票积累的不够.
                            return;
                        }
                    }
                }

                if (NpcScript.IsJPBossNpc)
                {
                    //JPBoss是否可以被击爆的判断.
                    if (XkGameCtrl.GetInstance().IsCaiPiaoHuLuePlayerIndex == false && NpcScript.m_IndexPlayerJiBao != playerSt)
                    {
                        //不是可以击爆JPBoss的玩家.
                        return;
                    }

                    if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                    {
                        //没有激活任何玩家.
                    }
                    else
                    {
                        if (!XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetIsChuCaiPiaoByDeCaiState(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss))
                        {
                            //JPBoss彩池的彩票积累的不够.
                            return;
                        }
                    }
                }
            }

            if (IsDeathNpc)
            {
                return;
            }
            IsDeathNpc = true;

            if (IsOpenCameraShake)
            {
                XKPlayerCamera.GetInstanceFeiJi().HandlePlayerCameraShake();
            }

            if (NpcJiFen == NpcJiFenEnum.Boss && BossXieZiScript != null)
            {
                BossXieZiScript.ResetBossXieZiShouBiInfo();
            }

            if (BoxColCom != null)
            {
                BoxColCom.enabled = false;
            }
            CheckSpawnDaoJuCom(playerSt);
            CheckNpcDeathExplode(playerSt);
            CheckHiddenNpcObjArray();

//			bool isAddKillNpcNum = true;
//			if (NpcScript != null && CannonScript != null) {
//				if (NpcScript.GetIsDeathNPC()) {
//					isAddKillNpcNum = false;
//					Debug.Log("Unity:"+"name "+NpcScript.name+", isAddKillNpcNum "+isAddKillNpcNum);
//				}
//			}

            if (!IsYouTongNpc)
            {
                switch (NpcJiFen)
                {
                case NpcJiFenEnum.Boss:
                    if (GameTimeBossCtrl.GetInstance() != null &&
                        GameTimeBossCtrl.GetInstance().GetTimeBossResidual() > 0)
                    {
                        XkGameCtrl.GetInstance().AddPlayerKillNpc(PlayerEnum.Null, NpcJiFen, GetJiFen());
                    }
                    break;

                default:
                    XkGameCtrl.GetInstance().AddPlayerKillNpc(playerSt, NpcJiFen, GetJiFen());
                    ShowPiaoFen(playerSt);
                    break;
                }
//				if (isAddKillNpcNum) {
//					switch (NpcJiFen) {
//					case NpcJiFenEnum.Boss:
//						if (GameTimeBossCtrl.GetInstance().GetTimeBossResidual() > 0) {
//							XkGameCtrl.GetInstance().AddPlayerKillNpc(PlayerEnum.Null, NpcJiFen, JiFenVal);
//						}
//						break;
//					default:
//						XkGameCtrl.GetInstance().AddPlayerKillNpc(playerSt, NpcJiFen, JiFenVal);
//						break;
//					}
//				}
            }
            else
            {
                CheckYouTongDamageNpc();
            }

            if (NpcScript != null)
            {
                if (CannonScript != null)
                {
                    CannonScript.OnRemoveCannon(playerSt, 1);
                }

                if (NpcJiFen != NpcJiFenEnum.Boss && NpcScript.GetIsBossNpc())
                {
                    return;
                }
                NpcScript.TriggerRemovePointNpc(1, CannonScript, pAmmoType);

                if (NpcScript.IsCaiPiaoZhanChe)
                {
                    SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe;
                    //彩票boss或战车npc.
                    if (NpcScript.GetIsBossNpc())
                    {
                        deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss;
                    }
                    else
                    {
                        if (XkPlayerCtrl.GetInstanceFeiJi() != null)
                        {
                            XkPlayerCtrl.GetInstanceFeiJi().AddGetZhanCheDaiJinQuanPlayer(XKPlayerMoveCtrl.GetInstance(playerSt));
                        }
                    }

                    if (XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage != null)
                    {
                        if (isAiFireAmmo == false)
                        {
                            //只有被玩家击爆的代金券npc才允许出彩.
                            XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.SubGameDeCaiValByDeCaiState(playerSt, deCaiType,
                                                                                                                                               SSCaiPiaoDataManage.SuiJiDaoJuState.BaoXiang, NpcScript.m_DaiJinQuanState);
                        }
                        //else
                        //{
                        //被Ai坦克击爆的代金券npc不允许出彩.
                        //SSDebug.Log("The DaiJinQuan was killed by AiTank");
                        //}
                    }
                }
                else
                {
                    //普通npc被击杀.
                    //if (XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData != null && DeathExplodePoint != null)
                    //{
                    //    //随机送出正常得彩.
                    //    XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData.CheckPlayerSongPiaoInfo(playerSt, DeathExplodePoint.position);
                    //}
                }
            }
            else if (CannonScript != null)
            {
                CannonScript.OnRemoveCannon(playerSt, 1);
                //炮台类npc被击杀.
                //if (XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData != null && DeathExplodePoint != null)
                //{
                //    //随机送出正常得彩.
                //    XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData.CheckPlayerSongPiaoInfo(playerSt, DeathExplodePoint.position);
                //}
            }
        }
    }
    void CheckNpcDeathExplode(PlayerEnum indexPlayer = PlayerEnum.Null)
    {
        if (DeathExplode == null)
        {
            return;
        }


        if (NpcScript != null && NpcScript.IsCaiPiaoZhanChe)
        {
            SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe;
            //彩票boss或战车npc.
            if (NpcScript.GetIsBossNpc())
            {
                deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss;
                AudioBeiJingCtrl.StopGameBeiJingAudio();
            }

            if (XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage != null)
            {
                int value = XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetPrintCaiPiaoValueByDeCaiState(deCaiType, SSCaiPiaoDataManage.SuiJiDaoJuState.BaoXiang,
                                                                                                                                                    NpcScript.m_DaiJinQuanState);
                if (DeathExplodePoint != null)
                {
                    //Vector3 pos = XkGameCtrl.GetInstance().GetWorldObjToScreenPos(objExplode.transform.position);
                    SSCaiPiaoDataManage.GameCaiPiaoData.DaiJinQuanState daiJinQuanType = NpcScript.m_DaiJinQuanState;
                    SSUIRoot.GetInstance().m_GameUIManage.CreatZhanCheBossCaiPiaoZhuanPan(indexPlayer, value, DeathExplodePoint.position, deCaiType, DeathExplode, daiJinQuanType);
                    //SSCaiPiaoLiZiManage caiPiaoLiZi = objExplode.GetComponent<SSCaiPiaoLiZiManage>();
                    //if (caiPiaoLiZi != null)
                    //{
                    //    caiPiaoLiZi.ShowNumUI(value, indexPlayer);
                    //}
                    //else
                    //{
                    //    Debug.LogWarning("CheckNpcDeathExplode -> caiPiaoLiZi was null.................");
                    //}
                    if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
                    {
                        //只给boss产生爆炸粒子.
                        GameObject objExplode = (GameObject)Instantiate(DeathExplode, DeathExplodePoint.position, DeathExplodePoint.rotation);
                        objExplode.transform.parent = XkGameCtrl.NpcAmmoArray;
                        XkGameCtrl.CheckObjDestroyThisTimed(objExplode);

                        SSCaiPiaoLiZiManage caiPiaoLiZi = objExplode.GetComponent <SSCaiPiaoLiZiManage>();
                        if (caiPiaoLiZi != null)
                        {
                            caiPiaoLiZi.ShowNumUI(value, indexPlayer);
                        }
                        else
                        {
                            Debug.LogWarning("CheckNpcDeathExplode -> caiPiaoLiZi was null.................");
                        }
                    }
                }
            }

            //if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe)
            //{
            //    if (XkGameCtrl.GetInstance().m_CaiPiaoFlyData != null)
            //    {
            //        //初始化飞出的彩票逻辑.
            //        XkGameCtrl.GetInstance().m_CaiPiaoFlyData.InitCaiPiaoFly(transform.position, indexPlayer, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe);
            //    }
            //    else
            //    {
            //        Debug.LogWarning("CreatLiZi -> m_CaiPiaoFlyData was null............");
            //    }
            //}
            //else if (deCaiType == SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss)
            //{
            //    if (SSUIRoot.GetInstance().m_GameUIManage != null)
            //    {
            //        SSUIRoot.GetInstance().m_GameUIManage.InitCaiPiaoAnimation(XkGameCtrl.GetInstance().m_CaiPiaoFlyData.m_JPBossCaiPiaoFlyDt.TimeLeiJiaVal, indexPlayer);
            //    }

            //    if (XkGameCtrl.GetInstance().m_CaiPiaoFlyData != null)
            //    {
            //        //初始化烟花粒子的产生.
            //        XkGameCtrl.GetInstance().m_CaiPiaoFlyData.InitPlayCaiPiaoYanHua();
            //    }
            //    else
            //    {
            //        Debug.LogWarning("CreatLiZi -> m_CaiPiaoFlyData was null............");
            //    }
            //}
        }
        else
        {
            GameObject objExplode = (GameObject)Instantiate(DeathExplode, DeathExplodePoint.position, DeathExplodePoint.rotation);
            objExplode.transform.parent = XkGameCtrl.NpcAmmoArray;
            XkGameCtrl.CheckObjDestroyThisTimed(objExplode);
        }
    }
Exemple #13
0
    public void OnDamageNpc(int damageNpcVal         = 1, PlayerEnum playerSt = PlayerEnum.Null,
                            PlayerAmmoType pAmmoType = PlayerAmmoType.Null)
    {
        if (IsDeathNpc)
        {
            return;
        }

        //switch (NpcJiFen)
        //{
        //    case NpcJiFenEnum.Boss:
        //        if (!XKBossXueTiaoCtrl.GetInstance().GetIsCanSubXueTiaoAmount())
        //        {
        //            if (NpcDamageCom != null)
        //            {
        //                NpcDamageCom.PlayNpcDamageEvent();
        //            }
        //            return;
        //        }
        //        break;
        //}


        if (NpcDamageCom != null)
        {
            NpcDamageCom.PlayNpcDamageEvent();
        }

        if (NpcScript != null)
        {
            if (NpcScript.IsCaiPiaoZhanChe == true && NpcScript.IsEnterCameraBox == false)
            {
                //彩票战车和boss没有进入摄像机盒子,不计算伤害.
                return;
            }
        }

        if (CountActivePlayer != XkGameCtrl.PlayerActiveNum)
        {
            if (CountActivePlayer != 0)
            {
                //fix PuTongAmmoCount.
                int indexValTmp      = CountActivePlayer - 1;
                int puTongAmmoNumTmp = MaxPuTongAmmo[indexValTmp];
                indexValTmp = XkGameCtrl.PlayerActiveNum - 1;
                if (indexValTmp >= 0)
                {
                    float healthPer = (float)PuTongAmmoCount / puTongAmmoNumTmp;
                    //int oldPuTongAmmoCount = PuTongAmmoCount;
                    PuTongAmmoCount = (int)(healthPer * MaxPuTongAmmo[indexValTmp]);

                    /*Debug.Log("Unity:"+"fix npc health -> PuTongAmmoCount "+PuTongAmmoCount
                     +", oldPuTongAmmoCount "+oldPuTongAmmoCount);*/
                }
            }
            CountActivePlayer = XkGameCtrl.PlayerActiveNum;
        }

        if (NpcScript == null || (NpcScript != null && !NpcScript.GetIsWuDi()))
        {
            PuTongAmmoCount += damageNpcVal;
        }

        int indexVal = XkGameCtrl.PlayerActiveNum - 1;

        indexVal = indexVal < 0 ? 0 : indexVal;
        int puTongAmmoNum = MaxPuTongAmmo[indexVal];

        if (NpcJiFen == NpcJiFenEnum.Boss)
        {
            float bossAmount = (float)(puTongAmmoNum - PuTongAmmoCount) / puTongAmmoNum;
            bossAmount = bossAmount < 0f ? 0f : bossAmount;
            XKBossXueTiaoCtrl.GetInstance().SetBloodBossAmount(bossAmount, this);
        }

        /*Debug.Log("Unity:"+"OnDamageNpc -> "
         +", nameNpc "+NpcNameInfo
         +", puTongAmmoNum "+puTongAmmoNum);*/
        if (PuTongAmmoCount >= puTongAmmoNum)
        {
            if (NpcScript != null)
            {
                if (NpcScript.IsZhanCheNpc)
                {
                    //战车npc是否可以被击爆的判断.
                    if (XkGameCtrl.GetInstance().IsCaiPiaoHuLuePlayerIndex == false && NpcScript.m_IndexPlayerJiBao != playerSt)
                    {
                        //不是可以击爆战车npc的玩家.
                        return;
                    }

                    if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                    {
                        //没有激活任何玩家.
                    }
                    else
                    {
                        if (!XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetIsChuCaiPiaoByDeCaiState(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe))
                        {
                            //战车彩池的彩票积累的不够.
                            return;
                        }
                    }
                }

                if (NpcScript.IsJPBossNpc)
                {
                    //JPBoss是否可以被击爆的判断.
                    if (XkGameCtrl.GetInstance().IsCaiPiaoHuLuePlayerIndex == false && NpcScript.m_IndexPlayerJiBao != playerSt)
                    {
                        //不是可以击爆JPBoss的玩家.
                        return;
                    }

                    if (XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer == true)
                    {
                        //没有激活任何玩家.
                    }
                    else
                    {
                        if (!XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.GetIsChuCaiPiaoByDeCaiState(SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss))
                        {
                            //JPBoss彩池的彩票积累的不够.
                            return;
                        }
                    }
                }
            }

            if (IsDeathNpc)
            {
                return;
            }
            IsDeathNpc = true;

            if (IsOpenCameraShake)
            {
                XKPlayerCamera.GetInstanceFeiJi().HandlePlayerCameraShake();
            }

            if (NpcJiFen == NpcJiFenEnum.Boss && BossXieZiScript != null)
            {
                BossXieZiScript.ResetBossXieZiShouBiInfo();
            }

            if (BoxColCom != null)
            {
                BoxColCom.enabled = false;
            }
            CheckSpawnDaoJuCom(playerSt);
            CheckNpcDeathExplode(playerSt);
            CheckHiddenNpcObjArray();

//			bool isAddKillNpcNum = true;
//			if (NpcScript != null && CannonScript != null) {
//				if (NpcScript.GetIsDeathNPC()) {
//					isAddKillNpcNum = false;
//					Debug.Log("Unity:"+"name "+NpcScript.name+", isAddKillNpcNum "+isAddKillNpcNum);
//				}
//			}

            if (!IsYouTongNpc)
            {
                switch (NpcJiFen)
                {
                case NpcJiFenEnum.Boss:
                    if (GameTimeBossCtrl.GetInstance().GetTimeBossResidual() > 0)
                    {
                        XkGameCtrl.GetInstance().AddPlayerKillNpc(PlayerEnum.Null, NpcJiFen, JiFenVal);
                    }
                    break;

                default:
                    XkGameCtrl.GetInstance().AddPlayerKillNpc(playerSt, NpcJiFen, JiFenVal);
                    ShowPiaoFen(playerSt);
                    break;
                }
//				if (isAddKillNpcNum) {
//					switch (NpcJiFen) {
//					case NpcJiFenEnum.Boss:
//						if (GameTimeBossCtrl.GetInstance().GetTimeBossResidual() > 0) {
//							XkGameCtrl.GetInstance().AddPlayerKillNpc(PlayerEnum.Null, NpcJiFen, JiFenVal);
//						}
//						break;
//					default:
//						XkGameCtrl.GetInstance().AddPlayerKillNpc(playerSt, NpcJiFen, JiFenVal);
//						break;
//					}
//				}
            }
            else
            {
                CheckYouTongDamageNpc();
            }

            if (NpcScript != null)
            {
                if (CannonScript != null)
                {
                    CannonScript.OnRemoveCannon(playerSt, 1);
                }

                if (NpcJiFen != NpcJiFenEnum.Boss && NpcScript.GetIsBossNpc())
                {
                    return;
                }
                NpcScript.TriggerRemovePointNpc(1, CannonScript, pAmmoType);

                if (NpcScript.IsCaiPiaoZhanChe)
                {
                    SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.ZhanChe;
                    //彩票boss或战车npc.
                    if (NpcScript.GetIsBossNpc())
                    {
                        deCaiType = SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState.JPBoss;
                    }

                    if (XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage != null)
                    {
                        XkPlayerCtrl.GetInstanceFeiJi().m_SpawnNpcManage.m_CaiPiaoDataManage.m_GameCaiPiaoData.SubGameDeCaiValByDeCaiState(playerSt, deCaiType);
                    }
                }
                else
                {
                    //普通npc被击杀.
                    if (XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData != null && DeathExplodePoint != null)
                    {
                        //随机送出正常得彩.
                        XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData.CheckPlayerSongPiaoInfo(playerSt, DeathExplodePoint.position);
                    }
                }
            }
            else if (CannonScript != null)
            {
                CannonScript.OnRemoveCannon(playerSt, 1);
                //炮台类npc被击杀.
                if (XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData != null && DeathExplodePoint != null)
                {
                    //随机送出正常得彩.
                    XkGameCtrl.GetInstance().m_PlayerJiChuCaiPiaoData.CheckPlayerSongPiaoInfo(playerSt, DeathExplodePoint.position);
                }
            }
        }
    }
    /// <summary>
    /// 创建战车boss彩票转盘.
    /// </summary>
    public void CreatZhanCheBossCaiPiaoZhuanPan(PlayerEnum indexPlayer, int caiPiaoVal, Vector3 pos, SSCaiPiaoDataManage.GameCaiPiaoData.DeCaiState type, GameObject exp)
    {
        //StartCoroutine(DelayCreatZhanCheBossCaiPiaoZhuanPan(indexPlayer, caiPiaoVal, pos, type, exp));
        if (m_GameUIBottomLeft == null)
        {
            UnityLogWarning("CreatZhanCheBossCaiPiaoZhuanPan -> m_GameUIBottomLeft was null.........");
            return;
        }

        GameObject gmDataPrefab = (GameObject)Resources.Load("Prefabs/GUI/CaiPiaoUI/CaiPiaoZhuanPan");

        if (gmDataPrefab != null)
        {
            //UnityLog("CreatZhanCheBossCaiPiaoZhuanPan...");
            GameObject             obj             = (GameObject)Instantiate(gmDataPrefab, m_GameUIBottomLeft);
            SSCaiPiaoZhanCheBossUI caiPiaoZhuanPan = obj.GetComponent <SSCaiPiaoZhanCheBossUI>();
            if (caiPiaoZhuanPan != null)
            {
                caiPiaoZhuanPan.Init(indexPlayer, caiPiaoVal, pos, type, exp);
            }
        }
        else
        {
            UnityLogWarning("CreatZhanCheBossCaiPiaoZhuanPan -> gmDataPrefab was null");
        }
    }