Пример #1
0
        private void OnPrizeChestSelectChanged(UButtonGroupItem oldItem, UButtonGroupItem newItem)
        {
            ClearContainer(chestObjContainer);
            if (newItem)
            {
                PrizeChestInfo info = newItem.GetComponent <PrizeChestInfo>();
                if (info)
                {
                    if (chestObjContainer == null)
                    {
                        GameObject go = new GameObject();
                        go.name           = "PrizeChestContainer";
                        chestObjContainer = go.transform;
                    }

                    GameObject parent = new GameObject();
                    parent.name = "PrizeItem";
                    parent.transform.SetParent(chestObjContainer);
                    parent.transform.localPosition = Vector3.zero;

                    SceneEffectParamBase effectParam = new SceneEffectParamBase(info.PrizeChestConfig.nNormalEffect, parent.transform);
                    SceneEffectManager.Instance.CreateSceneEffect(ref effectParam);

                    SceneEffectParamBase bgEffectParam = new SceneEffectParamBase(info.PrizeChestConfig.nBgEffectID, parent.transform);
                    SceneEffectManager.Instance.CreateSceneEffect(ref bgEffectParam);

                    prizeChestItem.Clear();
                    prizeChestItem.SetData(this, info.PrizeChestConfig.nChestId, info.PrizeChestConfig.strChestName, info.PrizeChestCount);
                }
            }
        }
Пример #2
0
        private void ShowDetailInfo()
        {
            prizeChestClickBtn.interactable = false;

            TimerManager.SetTimer(this, (int)EMPrizeResultTimerType.EMTiemr_AwardOpenEffect, 1);

            if (glowEffectParam != null)
            {
                clickEffectParam = new SceneEffectParamBase((int)ESceneEffectID.SE_PrizeChest_Click, glowEffectParam.AttachTransform);
                SceneEffectManager.Instance.CreateSceneEffect(ref clickEffectParam);
                SceneEffectManager.Instance.DestroySceneEffect(ref glowEffectParam, false);
            }

            Data.UISoundConfig.SSchemeUSoundData soundData = new Data.UISoundConfig.SSchemeUSoundData();
            string key = actorPrizeConfig.nPrizeGrade > 3 ? soundKey_Value : SoundKey_Normal;

            if (Data.UISoundConfig.UISoundConfig.Instance.GetData(SoundFilter, key, ref soundData))
            {
                SoundManager.CreateUISound(soundData.USoundID);
            }

            UTooltipTrigger trigger = this.transform.GetComponent <UTooltipTrigger>();

            if (trigger != null)
            {
                trigger.enabled = true;
                trigger.SetText(UTooltipParamName.BodyText, actorPrizeConfig.strPrizeDesc);
            }
        }
Пример #3
0
        //主界面场景加载完毕回调
        private void SetPrizeChestObjContainer(SceneResInfoManager info)
        {
            currentView = EMPrizeChestView.EMView_Main;
            //挂载主界面场景模型根节点,创建场景光效
            if (chestObjContainer == null)
            {
                GameObject go = new GameObject();
                go.name           = "PrizeChestContainer";
                chestObjContainer = go.transform;
            }
            //挂载宝箱模型根节点到场景上
            chestObjContainer.SetParent(info.SceneRoot.transform);
            chestObjContainer.localPosition = mainViewChestPos;

            RefreshChest();

            if (m_reaminingChestCount <= 0)
            {
                linkBtn.gameObject.SetActive(true);
                if (defaultBGEffect == null && chestObjContainer != null)
                {
                    defaultBGEffect = new SceneEffectParamBase((int)ESceneEffectID.SE_PrizeChest_DefaultBG, chestObjContainer);
                    SceneEffectManager.Instance.CreateSceneEffect(ref defaultBGEffect);
                }
            }
            chestPageObj.SetActive(true);
            closeBtn.gameObject.SetActive(true);
            bEnableClose = true;
        }
Пример #4
0
    public static bool SetChangeHeroSkinEffect(int nSkinId, ref SceneEffectParamBase lastSkinEffectParam, ref int nLastSkinId, Transform parentTrans, PERSONMODELVIEWID viewType = PERSONMODELVIEWID.PERSONMODELVIEWID_GAMEWAITINGROOM, Action <object> resLoadFinished = null, object userObj = null)
    {
        if (lastSkinEffectParam != null)
        {
            SceneEffectManager.Instance.DestroySceneEffect(ref lastSkinEffectParam);
            lastSkinEffectParam = null;
            nLastSkinId         = 0;
        }

        if (nSkinId < 0)
        {
            return(false);
        }

        int nSelectEffectID = GameLogicAPI.getSelectEffectID(nSkinId);
        //SceneEffectParamBase effectParam = new SceneEffectParamAsync(nSelectEffectID, parentTrans, _onResLoadFinished: resLoadFinished, _resLoadUserObject: userObj);
        SceneEffectParamBase effectParam = new SceneEffectParamAsync(nSelectEffectID, parentTrans, AssetLoadPriority.Priority_Exclusive, _onResLoadFinished: resLoadFinished, _resLoadUserObject: userObj);

        SceneEffectManager.Instance.CreateSceneEffect(ref effectParam);

        lastSkinEffectParam = effectParam;
        nLastSkinId         = nSkinId;

        return(true);
    }
Пример #5
0
 private void LoadStandbyEffect()
 {
     for (int i = 0; i < heroMountPoints.Length; ++i)
     {
         SceneEffectParamBase sceneEffectParam = new SceneEffectParamBase((int)ESceneEffectID.SE_LifeHero_StandbyEffect, heroMountPoints[i], _bAutoPlay: true);
         SceneEffectManager.Instance.CreateSceneEffect(ref sceneEffectParam);
     }
 }
Пример #6
0
    /// <summary>
    /// 删除场景光效
    /// </summary>
    /// <param name="_effectParam">场景光效参数</param>
    /// <param name="_bReleaseSource">是否释放光效资源</param>
    /// <returns></returns>
    public bool DestroySceneEffect(ref SceneEffectParamBase _effectParam, bool _bReleaseSource = true)
    {
        if (_effectParam == null)
        {
            return(false);
        }

        int nEffectID = _effectParam.AttachEffectID;

        //不在activelist里面意味着走了异步,资源没加载完
        if (!m_listActiveEffectParam.Contains(_effectParam))
        {
            //删除时异步加载未完成
            if (m_dicEffectIDResNodeUsed.ContainsKey(nEffectID) && !m_dicEffectIDResNodeUsed[nEffectID].IsValid())
            {
                SceneEffectParamAsync paramAsync = _effectParam as SceneEffectParamAsync;
                if (paramAsync != null)
                {
                    paramAsync.IsCanBeInstance = true;
                }
            }
        }
        else
        {
            if (_effectParam.ReturnComponent == null)
            {
                m_listActiveEffectParam.Remove(_effectParam);
            }
            else
            {
                if (m_dicEffectIDResNodeUsed.ContainsKey(nEffectID))
                {
                    _effectParam.ReturnComponent.StopEffect();
                    var temp = _effectParam.ReturnComponent.gameObject;
                    m_dicEffectIDResNodeUsed[nEffectID].DestroyInstanceRes(ref temp);
                }

                m_listActiveEffectParam.Remove(_effectParam);
            }
        }

        if (_effectParam is SceneEffectParamAsync)
        {
            ReleaseResNodeAsync(nEffectID);
        }
        else
        {
            if (_bReleaseSource)
            {
                ReleaseResNode(nEffectID);
            }
        }


        return(true);
    }
Пример #7
0
        /// <summary>
        /// 清除选择英雄特效
        /// </summary>
        private void ClearSelectSkinModel()
        {
            if (m_LastSkinEffect == null)
            {
                return;
            }

            SceneEffectManager.Instance.DestroySceneEffect(ref m_LastSkinEffect);
            m_LastSkinEffect = null;
            m_nLastSkinId    = 0;
        }
Пример #8
0
    private ResNode GetResNodeAsync(string _strPath, SceneEffectParamBase _param)
    {
        ResNodeHandleParamBase param       = new ResNodeHandleParam_Path(AssetType.Asset_Prefab, _strPath);
        SceneEffectParamAsync  _paramAsync = _param as SceneEffectParamAsync;
        ResNode resultResNode = AssetBundleManager.GetResNodeAsync(this, param, this, _param, _paramAsync == null ? 0 : _paramAsync.priority);//AssetBundleManager.GetResNode(this, param);

        if (resultResNode != null)
        {
            return(resultResNode);
        }
        return(null);
    }
Пример #9
0
    private ResNode GetResNode(string _strPath, SceneEffectParamBase _param)
    {
        ResNodeHandleParamBase param = new ResNodeHandleParam_Path(AssetType.Asset_Prefab, _strPath);
        ResNode resultResNode        = AssetBundleManager.GetResNode(this, param);

        if (resultResNode != null)
        {
            if (resultResNode.IsValid())
            {
                return(resultResNode);
            }
        }
        return(null);
    }
Пример #10
0
        public void OnTimer(int nTimerID)
        {
            if (nTimerID == chestAnimTimer)
            {
                SceneEffectParamBase tmpParam = null;
                for (int i = 0; i < CakeTrailEffectParamList.Count; ++i)
                {
                    tmpParam = CakeTrailEffectParamList[i];
                    SceneEffectManager.Instance.DestroySceneEffect(ref tmpParam);
                }
                CakeTrailEffectParamList.Clear();

                ResNode.DestroyRes(ref tempPriezeChestModel);  //删除开宝箱创建的临时模型
                tempPriezeChestModel = null;

                resultPageObj.SetActive(true);        //显示结果页面UI
                Invoke("OpenAwardClickTip", 1f);
                TimerManager.KillTimer(this, 1);

                SSchemePrizeChestConfig prizeChestConfig = FindNextChestPrize();
                if (prizeChestConfig != null)
                {
                    m_nextChestId = prizeChestConfig.nChestId;
                    nextChestBtn.gameObject.SetActive(true);
                    nextChestBtn.interactable = false;
                    if (m_nResultPageChestType == prizeChestConfig.nChestId)
                    {
                        nextChestHint.gameObject.SetActive(false);
                        int nNextChestCount = 0;
                        if (LogicDataCenter.prizeChestDataManager.ChestInfo.ContainsKey(m_nextChestId))
                        {
                            nNextChestCount = LogicDataCenter.prizeChestDataManager.ChestInfo[m_nextChestId];
                        }
                        nextChestBtn.gameObject.GetComponentInChildren <Text>().text = String.Format("{0}({1})", ULocalizationService.Instance.Get("UIView", "PrizeChest", "NextChestBtn"), nNextChestCount);
                    }
                    else
                    {
                        nextChestHint.gameObject.SetActive(true);
                        nextChestHint.text = String.Format(ULocalizationService.Instance.Get("UIView", "PrizeChest", "WillOpenDifferentChest"), prizeChestConfig.strChestName);
                        nextChestBtn.gameObject.GetComponentInChildren <Text>().text = ULocalizationService.Instance.Get("UIView", "PrizeChest", "NextChestBtn");
                    }
                }
                else
                {
                    m_nextChestId = -1;
                    nextChestHint.gameObject.SetActive(false);
                    nextChestBtn.gameObject.SetActive(false);
                }
            }
        }
Пример #11
0
    protected void _CreateSceneEffect(SceneEffectParamBase _effectParam)
    {
        if (!m_dicEffectIDResNodeUsed.ContainsKey(_effectParam.AttachEffectID))
        {
            return;
        }

        EffectNode effectNode = null;

        effectNode = m_dicEffectIDResNodeUsed[_effectParam.AttachEffectID].InstanceMainRes <EffectNode>();//m_dicEffectIDResNodeUsed[_effectParam.AttachEffectID].InstanceRes<EffectNode>();

        m_listActiveEffectParam.Add(_effectParam);

        _effectParam.ReturnComponent = effectNode;
        _effectParam.ReturnComponent.transform.SetLocalPosition(_effectParam.ReturnComponent.transform.localPosition + _effectParam.GetSceneEffectPositionOffset());

        _effectParam.PlaySceneEffectByGod();
    }
Пример #12
0
        private void CreatPrizeResultModelAndEffect()
        {
            if (m_wndView.PrizeResultObjContainer == null)
            {
                return;
            }

            GameObject go = new GameObject();

            go.name = "ResultItem" + m_Index;
            go.transform.SetParent(m_wndView.PrizeResultObjContainer, false);
            go.transform.localPosition = m_wndView.prizeResultObjPos[m_Index];

            pedestalEffect = new SceneEffectParamBase(actorPrizeConfig.nPedestalEffectID, go.transform);
            SceneEffectManager.Instance.CreateSceneEffect(ref pedestalEffect);

            glowEffectParam = new SceneEffectParamBase(actorPrizeConfig.nPedestalGlowEffectID, go.transform);
            SceneEffectManager.Instance.CreateSceneEffect(ref glowEffectParam);
        }
Пример #13
0
        private bool FillingCultureWithHero(int cultureID, int heroID, bool isRemoveRongjie)
        {
            if (cultureArray == null ||
                cultureID < 0 ||
                cultureID >= cultureArray.Length)
            {
                return(false);
            }

            SSchemeLifeHeroLight lightConfig;

            if (LifeHeroConfig.Instance.LifeHeroLightDic.TryGetValue(heroID, out lightConfig))
            {
                int effectID;
                if (isRemoveRongjie)
                {
                    effectID = lightConfig.staticEffectID;
                }
                else
                {
                    effectID = lightConfig.effectID;
                }

                m_heroModleArray[cultureID] = new SceneEffectParamBase(effectID, heroMountPoints[cultureID], _bAutoPlay: true);
                SceneEffectManager.Instance.CreateSceneEffect(ref m_heroModleArray[cultureID]);

                cultureArray[cultureID].cultureBtn.gameObject.GetComponent <Image>().enabled = false;
            }
            else
            {
                Debug.LogError("not find hero model.heroID=" + heroID + ",cultureID=" + cultureID);
                return(false);
            }

            m_hasHeroCulture[cultureID] = heroID;

            SetHeroToolTip(heroID, cultureID);

            LoadAddHeroOrUpSatrEffectByCultuerID(cultureID);

            return(true);
        }
Пример #14
0
    protected void InitEffectParam(ResNode resNodeInfo, SceneEffectParamBase _effectParam)
    {
        if (resNodeInfo != null && resNodeInfo.IsValid())
        {
            if (_effectParam.GetSceneEffectDelaySpawnTime() > 0)
            {
                DelaySceneEffect(_effectParam);
            }
            else
            {
                _CreateSceneEffect(_effectParam);
            }
            _effectParam.Init();

            if (_effectParam is SceneEffectParamAsync)
            {
                if ((_effectParam as SceneEffectParamAsync).onResLoadFinished != null)
                {
                    (_effectParam as SceneEffectParamAsync).onResLoadFinished.Invoke((_effectParam as SceneEffectParamAsync).ResLoadUserObject);
                }
            }
        }
    }
Пример #15
0
        public void InitSplineMesh()
        {
            if (m_SplineMesh != null)
            {
                return;
            }

            param = new SceneEffectParamBase((int)ESceneEffectID.SE_Guide_PathMesh, null, _bAutoPlay: false);
            SceneEffectManager.Instance.CreateSceneEffect(ref param);
            param.ReturnComponent.transform.position = new Vector3(999, 999, 999);
            m_Prefab = param.ReturnComponent.gameObject;


            GameObject pathGO = new GameObject("PathMesh");

            m_SplineMesh = pathGO.AddComponent <SplineMesh>();
            m_SplineMesh.IsAutoUpdateMesh  = false;
            m_SplineMesh.MeshDistanceDelta = 4f;
            m_SplineMesh.MeshPrefab        = m_Prefab;

            m_SplineMesh.transform.position = m_MainHeroTrans != null ? m_MainHeroTrans.position : Vector3.zero;

            m_SplineMesh.gameObject.SetActive(false);
        }
Пример #16
0
    private void OnDelaySpawnTimer()
    {
        if (m_listDelaySpawnEffectParam.Count <= 0)
        {
            return;
        }
        SceneEffectParamBase param = null;

        for (int i = m_listDelaySpawnEffectParam.Count - 1; i >= 0; --i)
        {
            param = m_listDelaySpawnEffectParam[i];
            if (param == null || param.IsPlaying())
            {
                m_listDelaySpawnEffectParam.Remove(param);
                continue;
            }

            if (param.IsDelayTimeExit())
            {
                _CreateSceneEffect(param);
                m_listDelaySpawnEffectParam.Remove(param);
            }
        }
    }
Пример #17
0
    private void OnDurationTimer()
    {
        if (m_listActiveEffectParam.Count <= 0)
        {
            return;
        }
        SceneEffectParamBase param = null;

        for (int i = m_listActiveEffectParam.Count - 1; i >= 0; --i)
        {
            param = m_listActiveEffectParam[i];
            if (param == null)
            {
                continue;
            }

            int nEffectID = param.AttachEffectID;
            //如果在持续时间内EffectNode跟随父节点释放了的话,就直接移除吧
            if (param.ReturnComponent == null)
            {
                m_listActiveEffectParam.Remove(param);
                param = null;
            }
            else if (param.IsPlaying())
            {
                if (param.IsDurationTimeExit())
                {
                    //GameObject.DestroyObject(param.ReturnComponent.gameObject);
                    var temp = param.ReturnComponent.gameObject;
                    m_dicEffectIDResNodeUsed[nEffectID].DestroyInstanceRes(ref temp);
                    m_listActiveEffectParam.Remove(param);
                    param = null;
                }
            }
        }
    }
Пример #18
0
    public bool CreateSceneEffect(ref SceneEffectParamBase _effectParam)
    {
        bool       result      = false;
        ResNode    resNodeInfo = null;
        EffectNode effectNode  = null;


        //先判断这个资源是否已经取了ResNode,没有的话需要取一次,仅此一次
        if (m_dicEffectIDResNodeUsed.ContainsKey(_effectParam.AttachEffectID))
        {
            resNodeInfo = m_dicEffectIDResNodeUsed[_effectParam.AttachEffectID];

            InitEffectParam(resNodeInfo, _effectParam);
            result = true;
        }
        else
        {
            SSchemeSceneEffectNodeData nodeData = SceneEffectNodeData.Instance.GetData((int)_effectParam.AttachEffectID);
            if (nodeData == null)
            {
                Trace.LogWarning("SceneEffectManager::配置表没有EffectID:" + _effectParam.AttachEffectID + "创建失败");
                return(false);
            }

            if (_effectParam is SceneEffectParamAsync)
            {
                resNodeInfo = GetResNodeAsync(nodeData.strSceneEffectPath, _effectParam);
                if (resNodeInfo == null)
                {
                    Trace.LogWarning("SceneEffectManager::资源库没找到路径为" + nodeData.strSceneEffectPath + " 的资源");
                    return(false);
                }

                m_dicEffectIDResNodeUsed.Add(_effectParam.AttachEffectID, resNodeInfo);
            }
            else
            {
                resNodeInfo = GetResNode(nodeData.strSceneEffectPath, _effectParam);
                if (resNodeInfo == null)
                {
                    Trace.LogWarning("SceneEffectManager::资源库没找到路径为" + nodeData.strSceneEffectPath + " 的资源");
                    return(false);
                }

                m_dicEffectIDResNodeUsed.Add(_effectParam.AttachEffectID, resNodeInfo);

                InitEffectParam(resNodeInfo, _effectParam);
            }

            result = true;
        }


        // 根据参数初始化
        //if (resNodeInfo != null && resNodeInfo.IsValid())
        //{
        //    if (_effectParam.GetSceneEffectDelaySpawnTime() > 0)
        //    {
        //        DelaySceneEffect(_effectParam);
        //    }
        //    else
        //    {
        //        _CreateSceneEffect(_effectParam);
        //    }
        //    _effectParam.Init();
        //    result = true;
        //}
        return(result);
    }
Пример #19
0
        //刷新主界面宝箱模型及UI数据
        private void RefreshChest()
        {
            prizeChestItem.Clear();
            if (defaultBGEffect != null)
            {
                SceneEffectManager.Instance.DestroySceneEffect(ref defaultBGEffect);
                defaultBGEffect = null;
            }
            ClearContainer(chestObjContainer);
            ClearContainer(chestGroup.transform);
            Dictionary <int, int> selfChestInfo = LogicDataCenter.prizeChestDataManager.ChestInfo;
            Dictionary <int, SSchemePrizeChestConfig> chestConfig = ActorPrizeConfig.Instance.PrizeChestConfig;

            int nIndex = 0;

            m_reaminingChestCount = 0;
            foreach (var config in chestConfig)
            {
                if (!selfChestInfo.ContainsKey(config.Key))
                {
                    continue;
                }

                int nHaveNum = selfChestInfo[config.Key];
                if (config.Value.nAlwaysShow == 0 && nHaveNum <= 0)
                {
                    continue;
                }

                //只显示宝箱,不显示矿石
                if (config.Value.nChestFlag > 1)
                {
                    continue;
                }

                ++nIndex;
                if (nIndex > 6)
                {
                    break;
                }

                GameObject go = GameObject.Instantiate(prizeChestInfoGO);
                if (go)
                {
                    go.name = "PrizeChestInfoItem";
                    go.transform.SetParent(chestGroup.transform);
                    go.transform.localScale = Vector3.one;
                    UButtonGroupItem item = go.GetComponent <UButtonGroupItem>();
                    if (item)
                    {
                        item.Group = chestGroup;
                    }
                    PrizeChestInfo info = go.GetComponent <PrizeChestInfo>();
                    if (info)
                    {
                        info.SetData(config.Value, nHaveNum);
                        go.SetActive(true);
                        m_reaminingChestCount++;
                    }
                }
            }

            if (m_reaminingChestCount > 0)
            {
                linkBtn.gameObject.SetActive(false);
                Transform chestItemTr = chestGroup.transform.GetChild(0);
                OnPrizeChestSelectChanged(null, chestItemTr.gameObject.GetComponent <UButtonGroupItem>());
                if (m_reaminingChestCount == 1)
                {
                    prizeChestItem.SetOpenChestBtnText(chestItemTr.GetComponent <PrizeChestInfo>().PrizeChestCount);
                    ClearContainer(chestGroup.transform);
                }
                else
                {
                    prizeChestItem.SetOpenChestBtnText(-1);
                }
            }
        }
Пример #20
0
        private void LoadPrizeResultEffectAndSetUIData()
        {
            //获取当前开启的宝箱配置
            prizeChestConfig = ActorPrizeConfig.Instance.GetPrizeChestConfig(m_nResultPageChestType);
            if (prizeChestConfig == null)
            {
                return;
            }

            //创建临时模型
            tempModelID = Mathf.Clamp(prizeChestConfig.nChestModelID - 1, 0, 2);
            if (prizeChestResNodeList[tempModelID] != null)
            {
                GameObject prizeChestObj = prizeChestResNodeList[tempModelID].InstanceMainRes();
                if (prizeChestObj != null)
                {
                    prizeChestObj.transform.SetParent(prizeResultObjContainer);
                    prizeChestObj.transform.localPosition = Vector3.zero;

                    tempPriezeChestModel = prizeChestObj;
                }
            }
            else
            {
                Debug.LogError(String.Format("not find model ID in prizeChestResNodeList[{0}]", tempModelID));
                return;
            }

            //播放模型打开动画的光效
            SceneEffectParamBase openEffectParam = new SceneEffectParamBase(prizeChestConfig.nOpenEffect, tempPriezeChestModel.transform);

            SceneEffectManager.Instance.CreateSceneEffect(ref openEffectParam);

            Data.UISoundConfig.SSchemeUSoundData soundData = new Data.UISoundConfig.SSchemeUSoundData();
            if (Data.UISoundConfig.UISoundConfig.Instance.GetData(SoundFilter_AnimStart, SoundKey_AnimStart, ref soundData))
            {
                SoundManager.CreateUISound(soundData.USoundID);
            }

            Transform[] tempChestModelChilds = tempPriezeChestModel.transform.GetComponentsInChildren <Transform>();

            //挂载摄像机动画
            Transform cmdTr = prizeResultObjContainer.parent.FindChild("CamTarget");

            if (cmdTr != null)
            {
                DestroyObject(cmdTr.gameObject);
            }
            GameObject camTarget = new GameObject();

            camTarget.name = "CamTarget";
            camTarget.transform.SetParent(prizeResultObjContainer.parent);
            camTarget.transform.localPosition    = prizeResultObjContainer.localPosition;
            camTarget.transform.localEulerAngles = Vector3.zero;

            LightingEffectManager lem = EntityFactory.EffectGroup.GetComponent <LightingEffectManager>();

            if (lem != null)
            {
                LightEffectParam param = new LightEffectParam();
                param.srcObject = camTarget;
                param.sourcePos = camTarget.transform.position;
                param.targetPos = camTarget.transform.position;

                m_camEffectID = prizeChestConfig.nCamEffectID;

                lem.AddLighting(prizeChestConfig.nCamEffectID, param);
            }


            List <int> prizeIdList = LogicDataCenter.prizeChestDataManager.PrizeIdList;

            openPrizeCount = 0;
            prizeCount     = Mathf.Clamp(prizeIdList.Count, 0, 7);

            //增加Tooltip
            if (continueOpenBtn != null)
            {
                continueOpenBtn.interactable = prizeCount > 0 ? false : true;
                if (!continueOpenBtn.interactable)
                {
                    UTooltipTrigger tooltip = continueOpenBtn.gameObject.GetComponent <UTooltipTrigger>();
                    if (tooltip == null)
                    {
                        tooltip = continueOpenBtn.gameObject.AddComponent <UTooltipTrigger>(ETooltipStyle.ETS_Default);
                    }
                    tooltip.SetText(UTooltipParamName.BodyText, openTips);
                }
            }

            foreach (PrizeResultItem item in prizeResultList)
            {
                UTooltipTrigger trigger = item.transform.GetComponent <UTooltipTrigger>();
                if (trigger != null)
                {
                    trigger.enabled = false;
                }
            }

            //奖励宝箱模型上挂载光效
            for (int i = 0; i < prizeIdList.Count; ++i)
            {
                //PrizeID必须大于0,界面大小,图标最多放12个
                if (prizeIdList[i] <= 0 || i >= 7)
                {
                    break;
                }

                int nPrizeID = prizeIdList[i];
                SSchemeActorPrizeConfig config = null;

                if (nPrizeID >= RAND_CARD_FIRST_INDEX && nPrizeID < LogicDataCenter.prizeChestDataManager.RandCardIndex)
                {
                    config = LogicDataCenter.prizeChestDataManager.RandCardResult[nPrizeID];
                }
                else
                {
                    config = ActorPrizeConfig.Instance.GetActorPrizeConfig(nPrizeID);
                }

                if (config == null)
                {
                    return;
                }

                //骨骼上挂载奖励光效
                foreach (Transform tr in tempChestModelChilds)
                {
                    if (tr != null && tr.name.Equals(bonesName[i]))
                    {
                        SceneEffectParamBase effectParam = new SceneEffectParamBase(config.nCakeTrailEffectID, tr, null, true, 2700);
                        SceneEffectManager.Instance.CreateSceneEffect(ref effectParam);

                        CakeTrailEffectParamList.Add(effectParam);
                    }
                }
                //奖励UI数据填充
                prizeResultList[i].SetData(this, i, prizeIdList[i], config);
            }
            //开启动画定时器
            TimerManager.SetTimer(this, chestAnimTimer, 4.2f);
        }
Пример #21
0
        private IEnumerator PlayEffect()
        {
            m_isPlayingEffect = true;
            int index = m_injectMsgData.lifeHero.nCultureID;

            if (cultureArray == null || index >= cultureArray.Length)
            {
                Debug.LogError("预制体培养仓个数不对,无法播放光效.");
                m_isPlayingEffect = false;
                yield break;
            }

            if (m_heroModleArray[index] != null)
            {
                SceneEffectManager.Instance.DestroySceneEffect(ref m_heroModleArray[index]);
                m_heroModleArray[index] = null;
            }

            SoundManager.CreateUISound((int)LifeHeroSoundID.ADD_LIFEHERO_SOUND);

            m_fillupEffectParam = new UEffectPrefabParam(
                _eType: UEffectPrefabType.UEPT_LifeHero_FillUp,
                _tfAttachParent: cultureArray[index].cultureBtn.transform, _bAutoDestroy: false);
            UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref m_fillupEffectParam);
            yield return(new WaitForSeconds(1.1f));

            cultureArray[index].cultureBtn.GetComponent <Image>().enabled = false;
            UEffectManager.Instance.DestroyEffect(UEffectType.UET_EffectPrefab, ref m_fillupEffectParam);
            m_fillupEffectParam = null;

            SceneEffectParamBase sceneEffectParam = new SceneEffectParamBase((int)ESceneEffectID.SE_LifeHero_VerticalDownBlink, heroMountPoints[index], _bAutoPlay: true);

            SceneEffectManager.Instance.CreateSceneEffect(ref sceneEffectParam);
            yield return(new WaitForSeconds(0.7f));

            SceneEffectManager.Instance.DestroySceneEffect(ref sceneEffectParam);

            sceneEffectParam = new SceneEffectParamBase((int)ESceneEffectID.SE_LifeHero_DNASpiralUp, heroMountPoints[index], _bAutoPlay: true);
            SceneEffectManager.Instance.CreateSceneEffect(ref sceneEffectParam);
            yield return(new WaitForSeconds(0.6f));

            SceneEffectManager.Instance.DestroySceneEffect(ref sceneEffectParam);

            bool isSuccess = FillingCultureWithHero(m_injectMsgData.lifeHero.nCultureID, m_injectMsgData.lifeHero.nHeroID, false);

            if (isSuccess)
            {
                if (LogicDataCenter.lifeHeroDataManager.AllLifeHero.Count == (int)ELifeHeroType.LIFEHERO_MAX_COUNT)
                {
                    if (m_openShareFrame)
                    {
                        m_openShareFrame = !m_openShareFrame;
                        #region recordShare
                        shareTex2D = new Texture2D((int)ShareRawImg.rectTransform.sizeDelta.x, (int)ShareRawImg.rectTransform.sizeDelta.y);

                        yield return(new WaitForSeconds(1.2f));

                        CaptureScreen.GetInstance().CaptureAreaImage(new CaptureAreaImgData(shareImgName, GetRecordRect()));
                        yield return(new WaitForSeconds(0.5f));

                        //Invoke("OpenRecordShareFrame", 0.5f);
                        OpenRecordShareFrame();
                        #endregion
                    }
                }
                else
                {
                    yield return(new WaitForSeconds(1.2f));

                    UEffectParamBase param = new UEffectPrefabParam(
                        _eType: UEffectPrefabType.UEPT_LifeHero_InjectFrame_Title,
                        _tfAttachParent: injectFrame.transform, _bAutoDestroy: true);
                    UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref param);
                    injectFrame.OpenInjectFrame(this, m_injectMsgData.lifeHero.nHeroID, param);
                }
            }

            m_isPlayingEffect = false;

            prizeFrame.SetObtainBtn();

            SetReplaceBtnVisible();

            yield break;
        }
Пример #22
0
 protected void DelaySceneEffect(SceneEffectParamBase _effectParam)
 {
     m_listDelaySpawnEffectParam.Add(_effectParam);
 }