コード例 #1
0
        //实例化Hero对象
        private void CallBack_InitHeroObject()
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                {
                    continue;
                }
                X_GUID pMemberGuiD = null;

                if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
                {
                    pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i];
                    if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0)
                    {
                        //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy]
                        pMemberGuiD.CleanUp();
                    }
                }
                else
                {
                    pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy]
                }
                if (!pMemberGuiD.IsValid())
                {
                    continue;
                }
                ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                if (pHero == null)
                {
                    continue;
                }
                ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID());
                if (_Artresourcedata == null)
                {
                    continue;
                }

                GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                if (pHeroObject != null)
                {
                    GameObject obj1 = Instantiate(pHeroObject, FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject;
                    GameUtils.SetLayerRecursively(obj1, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer());
                    float _zoom = _Artresourcedata.getArtresources_zoom();
                    obj1.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);
                    SceneObjectManager.GetInstance().SceneObjectAddHero(obj1, pHero.GetHeroRow().getId(), pHero);
                    FightEditorContrler.GetInstantiate().InitFormationPos(pHero, i);
                }
            }
            FightEditorContrler.GetInstantiate().HeroPathInitSpeed();

            GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryCameraEnd);

            //初始化完成后,切换状态 [1/20/2015 Zmy]
            SetFightState(FightState.prepareData);

            //初始入场怒气
            InitFightPower();
        }
コード例 #2
0
ファイル: ItemContainer.cs プロジェクト: ww386362087/MoyuHero
 //更新符文装备状态 [5/21/2015 Zmy]
 public void OnUpdateRuneEquipState(X_GUID _equipped, bool _state)
 {
     if (_equipped.IsValid())
     {
         ItemEquip _item = (ItemEquip)FindItem((int)EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_EQUIP, _equipped);
         if (_item != null)
         {
             _item.SetEquipState(_state);
         }
     }
 }
コード例 #3
0
        // ============================= 事件响应回调函数 =================================

        //实例化hero出场特效;
        private void CallBack_InitHeroEffect()
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                {
                    continue;
                }
                X_GUID pMemberGuiD = null;

                if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
                {
                    pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i];
                    if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0)
                    {
                        //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy]
                        pMemberGuiD.CleanUp();
                    }
                }
                else
                {
                    pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy]
                }
                if (!pMemberGuiD.IsValid())
                {
                    continue;
                }
                ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                if (pHero == null)
                {
                    continue;
                }
                ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID());
                if (_Artresourcedata == null)
                {
                    continue;
                }

                GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                if (pHeroObject != null)
                {
                    //创建出场特效;
                    GameObject eff = Instantiate(Resources.Load("Effect/Effect_Chuchang01"), FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject;
                    Destroy(eff, 0.3f);
                }
            }

            Invoke("CallBack_InitHeroObject", 0.3f);
        }
コード例 #4
0
 //显示是否可以上场  按钮置灰
 private void InitIsKYUpFront()
 {
     GameUtils.SetImageGrayState(CardImage, false);
     if (UI_Form.GetInst().GetCurPos() == 1 && _Herodata.getClientSignType()[0] == 0)
     {
         GameUtils.SetImageGrayState(CardImage, true);
     }
     if (UI_Form.GetInst().GetGuid().GUID_value > 0)
     {
         if (UI_Form.GetInst().GetAttackPos() == 0 && _Herodata.getClientSignType()[0] == 1)
         {
             int count = UI_Form.GetInst().GetBackHeroGuids().Count;
             for (int i = 0; i < count; i++)
             {
                 if (UI_Form.GetInst().GetBackHeroGuids().Contains(HeroObject.GetGuid().GUID_value))
                 {
                     GameUtils.SetImageGrayState(CardImage, true);
                 }
             }
         }
     }
     for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
     {
         int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
         if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
         {
             continue;
         }
         X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
         if (pMemberGuiD.IsValid())
         {
             ObjectCard card = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
             if (card == null)
             {
                 continue;
             }
             int mid = GameUtils.GetHeroIDNum(card.GetHeroRow().getId());
             if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value != pMemberGuiD.GUID_value)
             {
                 if (mid == GameUtils.GetHeroIDNum(HeroObject.GetHeroRow().getId()) && pMemberGuiD.GUID_value != HeroObject.GetGuid().GUID_value)
                 {
                     GameUtils.SetImageGrayState(CardImage, true);
                 }
             }
         }
     }
 }
コード例 #5
0
 public void RemoveTeamMember(int nID, X_GUID guid)
 {
     if ((nID < 0) || (nID >= GlobalMembers.MAX_MATRIX_COUNT))
     {
         return;
     }
     if (guid.IsValid())
     {
         for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
         {
             if (m_Matrix[nID, i].GUID_value == guid.GUID_value)
             {
                 m_Matrix[nID, i].CleanUp();
                 break;
             }
         }
     }
 }
コード例 #6
0
ファイル: HeroData.cs プロジェクト: ww386362087/MoyuHero
        /// <summary>
        /// 判断指定物品是否装备在英雄身上;
        /// </summary>
        /// <param name="itemEquip"></param>
        /// <returns></returns>
        public bool IsItemEquiped(X_GUID itemGUID)
        {
            if (!itemGUID.IsValid())
            {
                return(false);
            }

            for (int i = 0, j = m_pItem.Length; i < j; i++)
            {
                if (m_pItem [i] == null)
                {
                    continue;
                }

                if (m_pItem [i].Equals(itemGUID))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #7
0
ファイル: Spell.cs プロジェクト: ww386362087/MoyuHero
        public bool __CalculateSpellTarget(ref FIGHTOBJECT_LIST targetlist)
        {
            targetlist.m_pObjectList.Clear();
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);
            SkillTemplate pRow = m_pSpellInfo.GetSpellRow();

            LogManager.LogAssert(pRow);
            switch (m_pSpellInfo.GetTargetType())
            {
            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND:
            {
                if (m_pSpellInfo.IsNeedTarget())
                {
                    if (m_SpellTarget.IsValid())
                    {
                        SceneObjectManager pScene = SceneObjectManager.GetInstance();
                        LogManager.LogAssert(pScene);
                        ObjectCreature pTarget = pScene.GetObjectHeroByGUID(m_SpellTarget);
                        if (pTarget != null)
                        {
                            targetlist.Add((ObjectCreature)pTarget);
                        }
                    }
                }
                else if (pRow.getCoverage() < 0.0f)
                {
                    SceneObjectManager pScene = SceneObjectManager.GetInstance();
                    LogManager.LogAssert(pScene);
                    SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                    init.m_Type = m_pSpellInfo.GetTargetType();
                    pScene.ScanByObject(m_pHolder, ref init);
                    for (int j = 0; j < init.m_ObjectList.Count; j++)
                    {
                        targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                    }
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ENEMY:
            {
                if (m_pSpellInfo.IsNeedTarget())
                {
                    if (m_SpellTarget.IsValid())
                    {
                        SceneObjectManager pScene = SceneObjectManager.GetInstance();
                        LogManager.LogAssert(pScene);
                        ObjectCreature pTarget = pScene.GetSceneObjectByGUID(m_SpellTarget);
                        if (pTarget != null)
                        {
                            targetlist.Add((ObjectCreature)pTarget);
                        }
                    }
                }
                else if (pRow.getCoverage() < 0.0f)
                {
                    SceneObjectManager pScene = SceneObjectManager.GetInstance();
                    LogManager.LogAssert(pScene);
                    SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                    init.m_Type = m_pSpellInfo.GetTargetType();
                    pScene.ScanByObject(m_pHolder, ref init);
                    for (int j = 0; j < init.m_ObjectList.Count; j++)
                    {
                        targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                    }
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_SELF:
            {
                targetlist.Add((ObjectCreature)m_pHolder);
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ALL:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND_NO_SELF:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND_MIN_HPPERCENT:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ALL_NO_SELF:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ENEMY_MIN_HPPERCENT:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ATTACK_ME:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                ObjectCreature pTarget = pScene.GetObjectHeroByGUID(m_SpellTarget);
                if (pTarget != null)
                {
                    targetlist.Add((ObjectCreature)pTarget);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ENEMY_RAND:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                pScene.ScanByObject(m_pHolder, ref init);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_IMPACT_CASTER:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                ObjectCreature pTarget = pScene.GetObjectHeroByGUID(m_SpellTarget);
                if (pTarget != null)
                {
                    targetlist.Add((ObjectCreature)pTarget);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND_RAND:
            {
                SceneObjectManager pScene = SceneObjectManager.GetInstance();
                LogManager.LogAssert(pScene);
                SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                init.m_Type = m_pSpellInfo.GetTargetType();
                int m_Tagnum = m_pSpellInfo.GetBaseSpellTargetNumber();
                pScene.ScanByObject(m_pHolder, ref init, m_Tagnum);
                for (int j = 0; j < init.m_ObjectList.Count; j++)
                {
                    targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_ENEMY_RANDOM:
            {
                if (m_pSpellInfo.IsNeedTarget())
                {
                    if (m_SpellTarget.IsValid())
                    {
                        SceneObjectManager pScene = SceneObjectManager.GetInstance();
                        LogManager.LogAssert(pScene);
                        ObjectCreature pTarget = pScene.GetObjectHeroByGUID(m_SpellTarget);
                        if (pTarget != null)
                        {
                            targetlist.Add((ObjectCreature)pTarget);
                        }
                        SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                        init.m_Type = m_pSpellInfo.GetTargetType();
                        pScene.ScanByObject(m_pHolder, ref init, m_pSpellInfo.GetBaseSpellTargetNumber(), pTarget);
/*                                targetlist.m_pObjectList.Clear();*/

                        for (int j = 0; j < init.m_ObjectList.Count; j++)
                        {
                            targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                        }
                    }
                }
                else
                {
                    LogManager.Log("F**K");
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND_RANDOM:
            {
                if (m_pSpellInfo.IsNeedTarget())
                {
                    if (m_SpellTarget.IsValid())
                    {
                        SceneObjectManager pScene = SceneObjectManager.GetInstance();
                        LogManager.LogAssert(pScene);
                        ObjectCreature pTarget = pScene.GetObjectHeroByGUID(m_SpellTarget);
                        if (pTarget != null)
                        {
                            targetlist.Add((ObjectCreature)pTarget);
                        }
                        SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                        init.m_Type = m_pSpellInfo.GetTargetType();
                        pScene.ScanByObject(m_pHolder, ref init, m_pSpellInfo.GetBaseSpellTargetNumber(), pTarget);
                        for (int j = 0; j < init.m_ObjectList.Count; j++)
                        {
                            targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                        }
                    }
                }
                else
                {
                    LogManager.Log("F**K");
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_SELF_RANDOM:
            {
                if (m_pSpellInfo.IsNeedTarget())
                {
                    if (m_SpellTarget.IsValid())
                    {
                        SceneObjectManager pScene = SceneObjectManager.GetInstance();
                        LogManager.LogAssert(pScene);
                        ObjectCreature pTarget = pScene.GetSceneObjectByGUID(m_SpellTarget);
                        if (pTarget != null)
                        {
                            targetlist.Add((ObjectCreature)pTarget);
                            int m_Tagnum = m_pSpellInfo.GetBaseSpellTargetNumber();
                            if (pTarget.GetGameObject().GetHashCode() != m_pHolder.GetGameObject().GetHashCode())
                            {
                                targetlist.Add((ObjectCreature)m_pHolder);
                            }
                            else
                            {
                                m_Tagnum = m_Tagnum + 1;
                            }

                            SCANOPERATOR_INIT init = new SCANOPERATOR_INIT();
                            init.m_Type = m_pSpellInfo.GetTargetType();
                            pScene.ScanByObject(m_pHolder, ref init, m_Tagnum, pTarget);
                            for (int j = 0; j < init.m_ObjectList.Count; j++)
                            {
                                targetlist.Add((ObjectCreature)init.m_ObjectList[j]);
                            }
                        }
                    }
                }
                else
                {
                    LogManager.Log("F**K");
                }
            }
            break;

            default:
                break;
            }
            return(true);
        }
コード例 #8
0
        //刷新2D显示人物
        public void Init2DHeros()
        {
            //int type = ObjectSelf.GetInstance().Teams.GetFormationType();
            //if (type == 1)
            //{
            TeamViewRoomTeam1.SetActive(true);
            TeamViewRoomTeam2.SetActive(false);
            CurrentViewRoomTeam = TeamViewRoomTeam1.transform;
            //}
            //else
            //{
            //    TeamViewRoomTeam1.SetActive(false);
            //    TeamViewRoomTeam2.SetActive(true);
            //    CurrentViewRoomTeam = TeamViewRoomTeam2.transform;
            //}
            int GroupCount = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
            int HeroCount  = ObjectSelf.GetInstance().Teams.m_Matrix.GetLength(1);

            for (int i = 0; i < HeroCount; ++i)
            {
                X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[GroupCount, i];

                GameObject _obj = null;
                if (pMemberGuiD.IsValid())
                {
                    ObjectCard temp = ObjectSelf.GetInstance().HeroContainerBag.FindHero(ObjectSelf.GetInstance().Teams.m_Matrix[GroupCount, i]);

                    if (temp == null)
                    {
                        continue;
                    }

                    HeroTemplate        _HeroData        = temp.GetHeroRow();
                    ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(temp.GetHeroData().GetHeroViewID());
                    GameObject          _AssetRes        = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                    if (_AssetRes != null)
                    {
                        if (_AssetRes.GetComponent <NavMeshAgent>() != null)
                        {
                            _AssetRes.GetComponent <NavMeshAgent>().enabled = false;
                        }

                        _obj = Instantiate(_AssetRes, CurrentViewRoomTeam.GetChild(i).position, CurrentViewRoomTeam.GetChild(i).rotation) as GameObject;
                        float _zoom = _Artresourcedata.getArtresources_zoom();
                        _obj.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);
                    }
                }
//                 else
//                 {
//                     //GameObject _DefRes = AssetLoader.Inst.GetAssetRes("ElementBody02");
//                     GameObject _DefRes = Resources.Load(common.EleBody + "ElementBody02") as GameObject;
//                     if (_DefRes != null)
//                         _obj = Instantiate(_DefRes, CurrentViewRoomTeam.GetChild(i).position, CurrentViewRoomTeam.GetChild(i).rotation) as GameObject;
//                 }

                if (_obj != null)
                {
                    HeroObjs2D.Add(_obj);
                    Animation anim = _obj.GetComponent <Animation>();
                    if (anim != null)
                    {
                        if (anim["Nidle1"] != null)
                        {
                            anim.CrossFade("Nidle1", 0.5f);
                        }
                        else if (anim["Idle1"] != null)
                        {
                            anim.CrossFade("Idle1", 0.5f);
                        }
                        anim.wrapMode = WrapMode.Loop;
                    }
                }
            }
        }
コード例 #9
0
        void OnclickSelectBtn()
        {
            UI_Form.GetInst().SetCurrentHeroItem(this);
            //UI_Form.GetInst().SetSelectModel(HeroObject);//
            if (UI_Form.GetInst().isClick)
            {
                //相同英雄不可同时上阵
                for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
                {
                    int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                    if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                    {
                        continue;
                    }
                    X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
                    if (pMemberGuiD.IsValid())
                    {
                        ObjectCard card = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                        if (card == null)
                        {
                            continue;
                        }
                        int mid = GameUtils.GetHeroIDNum(card.GetHeroRow().getId());
                        if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value != pMemberGuiD.GUID_value)
                        {
                            if (mid == GameUtils.GetHeroIDNum(HeroObject.GetHeroRow().getId()) && pMemberGuiD.GUID_value != HeroObject.GetGuid().GUID_value)
                            {
                                InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip3"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                                return;
                            }
                        }
                    }
                }
                //近战英雄只能在前排
                if (UI_Form.GetInst().GetCurPos() == 1 && _Herodata.getClientSignType()[0] == 0)
                {
                    InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip4"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                    return;
                }
                //换人 近战英雄只能在前排
                if (UI_Form.GetInst().GetGuid().GUID_value > 0)
                {
                    if (UI_Form.GetInst().GetAttackPos() == 0 && _Herodata.getClientSignType()[0] == 1)
                    {
                        int count = UI_Form.GetInst().GetBackHeroGuids().Count;
                        for (int i = 0; i < count; i++)
                        {
                            if (UI_Form.GetInst().GetBackHeroGuids().Contains(HeroObject.GetGuid().GUID_value))
                            {
                                InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip4"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                                return;
                            }
                        }
                    }
                }
                IsUpState();
                UI_Form.GetInst().isClick = false;
            }

            UI_Form.GetInst().OnClickPackBtn();

            // 新手引导
            if (GuideManager.GetInstance().isGuideUser&&
                GuideManager.GetInstance().IsContentGuideID(100305) == false &&
                GuideManager.GetInstance().GetBackCount(100304))
            {
                GuideManager.GetInstance().ShowGuideWithIndex(100305);
            }

            // 新手引导
            if (GuideManager.GetInstance().isGuideUser&&
                GuideManager.GetInstance().IsContentGuideID(100404) == false &&
                GuideManager.GetInstance().GetBackCount(100403))
            {
                GuideManager.GetInstance().ShowGuideWithIndex(100404);
            }
        }
コード例 #10
0
ファイル: AssetLoader.cs プロジェクト: ww386362087/MoyuHero
        //索引英雄模型资源
        private void IndexHeromodel()
        {
            if (SceneManager.Inst.NextloadScene.ToString().Contains("Battle"))//战斗场景加载阵型内英雄资源
            {
                for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
                {
                    int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                    if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                    {
                        continue;
                    }

                    X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
                    if (!pMemberGuiD.IsValid())
                    {
                        continue;
                    }
                    ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                    if (pHero == null)
                    {
                        continue;
                    }
                    int          nTableID = pHero.GetHeroData().TableID;
                    HeroTemplate _rowData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(nTableID);
                    IndexModel(_rowData, true);
                    IndexSkillmodel(_rowData);
                    //IndexModel(_rowData);
                    //PushNeedDownBundle("HeroPlayer" + _strRes);
                    //IndexSkillmodel(_rowData);
                }
            }
            else if (SceneManager.Inst.NextloadScene.ToString().Equals("Login") == false)
            {
                //加载图鉴表中的所有英雄模型资源 [7/29/2015 Zmy]
                //int num = DataTemplate.GetInstance().m_IllustratehandbookTable.getDataCount();
                //for (int i = 0; i < num; ++i)
                //{
                //    if (DataTemplate.GetInstance().m_IllustratehandbookTable.tableContainsKey(i) == false)
                //        continue;

                //    IllustratehandbookTemplate row = (IllustratehandbookTemplate)DataTemplate.GetInstance().m_IllustratehandbookTable.getTableData(i);
                //    if (row != null && row.getType() == 1)
                //    {
                //        int nTableID = row.getContentId();
                //        HeroTemplate _rowData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(nTableID);
                //        if (_rowData != null)
                //        {
                //            IndexModel(_rowData, true);
                //            IndexSkillmodel(_rowData);
                //        }
                //    }
                //}
                //加载英雄背包中的英雄
                List <ObjectCard> _heroBagCardList = ObjectSelf.GetInstance().HeroContainerBag.GetHeroList();
                int _heroBagCount = _heroBagCardList.Count;
                for (int i = 0; i < _heroBagCount; ++i)
                {
                    ObjectCard   pHero    = _heroBagCardList[i];
                    int          nTableID = pHero.GetHeroData().TableID;
                    HeroTemplate _rowData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(nTableID);
                    IndexModel(_rowData, true);
                    IndexSkillmodel(_rowData);
                }
                PushNeedDownBundle("ElementBody02" + _strRes);
            }
            PushNeedDownBundle("Cloud" + _strRes);
        }