Exemplo n.º 1
0
    public override void OnWeaponEquOk(Tab_WeaponModel tabData)
    {
        OnWeaponUnEquOk();
        if (tabData == null)
        {
            return;
        }
        base.OnWeaponEquOk(tabData);
        Obj_OtherPlayer otherPlayer = m_cachedObjCharacter as Obj_OtherPlayer;

        if (otherPlayer != null && (otherPlayer.LWeaponObject != null || otherPlayer.RWeaponObject))
        {
            Transform effectPointBone;
            if (otherPlayer.LWeaponObject != null)
            {
                effectPointBone = otherPlayer.LWeaponObject.transform.Find(tabData.LWeaponBindPointPath);
                if (effectPointBone != null)
                {
                    if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_LWEAPON))
                    {
                        m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_LWEAPON] = effectPointBone.gameObject;
                    }
                    else
                    {
                        m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_LWEAPON, effectPointBone.gameObject);
                    }
                    m_effectBindPointsOnWeaponList.Add(GlobeVar.EFFECT_BIND_POINT_LWEAPON);
                }
            }
            if (otherPlayer.RWeaponObject != null)
            {
                effectPointBone = otherPlayer.RWeaponObject.transform.Find(tabData.RWeaponBindPointPath);
                if (effectPointBone != null)
                {
                    if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_RWEAPON))
                    {
                        m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_RWEAPON] = effectPointBone.gameObject;
                    }
                    else
                    {
                        m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_RWEAPON, effectPointBone.gameObject);
                    }
                    m_effectBindPointsOnWeaponList.Add(GlobeVar.EFFECT_BIND_POINT_RWEAPON);
                }
            }

            int count = tabData.getWeaponEffectCount();
            int effectId;
            for (int i = 0; i < count; i++)
            {
                effectId = tabData.GetWeaponEffectbyIndex(i);
                if (effectId >= 0)
                {
                    PlayEffect(effectId);
                }
            }
        }
    }
    public void OnLoadWeaponOK(Tab_WeaponModel tabData)
    {
        ObjAnimModel objAnim = gameObject.GetComponent <ObjAnimModel>();

        if (objAnim == null)
        {
            return;
        }

        Transform effectPointBone;

        if (objAnim.LWeaponObject != null)
        {
            effectPointBone = objAnim.LWeaponObject.transform.Find(tabData.LWeaponBindPointPath);
            if (effectPointBone != null)
            {
                if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_LWEAPON))
                {
                    m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_LWEAPON] = effectPointBone.gameObject;
                }
                else
                {
                    m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_LWEAPON, effectPointBone.gameObject);
                }
            }
        }
        if (objAnim.RWeaponObject != null)
        {
            effectPointBone = objAnim.RWeaponObject.transform.Find(tabData.RWeaponBindPointPath);
            if (effectPointBone != null)
            {
                if (m_effectBindPointCache.ContainsKey(GlobeVar.EFFECT_BIND_POINT_RWEAPON))
                {
                    m_effectBindPointCache[GlobeVar.EFFECT_BIND_POINT_RWEAPON] = effectPointBone.gameObject;
                }
                else
                {
                    m_effectBindPointCache.Add(GlobeVar.EFFECT_BIND_POINT_RWEAPON, effectPointBone.gameObject);
                }
            }
        }

        int count = tabData.getWeaponEffectCount();
        int effectId;

        for (int i = 0; i < count; i++)
        {
            effectId = tabData.GetWeaponEffectbyIndex(i);
            if (effectId >= 0)
            {
                PlayEffect(effectId);
            }
        }
    }
Exemplo n.º 3
0
        private void LoadWeapon(GameObject Obj, string szBindPoint, string szResName, Tab_WeaponModel tabWeaponModel)
        {
            List <object> param = new List <object>();

            if (Singleton <ObjManager> .Instance.MainPlayer != null)
            {
                param.Add(szBindPoint);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.WeaponEffectGem);
                param.Add(null);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.Profession);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.CurWeaponDataID);
                if (szBindPoint == "Weapon_L")
                {
                    param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                }
                else if (szBindPoint == "Weapon_R")
                {
                    param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
                }
                param.Add(tabWeaponModel);
                Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param);
            }

            else
            {
                if (UIControllerBase <RoleChooseLogic> .Instance() != null)
                {
                    param.Add(szBindPoint);
                    param.Add(-1);
                    param.Add(null);
                    param.Add(UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess());
                    param.Add(-1);

                    if (szBindPoint == "Weapon_L")
                    {
                        param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                    }
                    else if (szBindPoint == "Weapon_R")
                    {
                        param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
                    }

                    param.Add(tabWeaponModel);

                    Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param);
                }
            }
        }
Exemplo n.º 4
0
        public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable)
        {
            // 重载武器
            bool           defaultVisual = false;
            Tab_ItemVisual WeaponVisual  = null;
            Tab_EquipAttr  tabEquipAttr  = TableManager.GetEquipAttrByID(nCurWeaponID, 0);

            if (tabEquipAttr != null)
            {
                Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0);
                if (tabWeaponVisual != null)
                {
                    WeaponVisual = tabWeaponVisual;
                }
                else
                {
                    defaultVisual = true;
                }
            }
            else
            {
                defaultVisual = true;
            }

            if (defaultVisual)
            {
                Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabDefaultVisual == null)
                {
                    return;
                }

                WeaponVisual = tabDefaultVisual;
            }

            int nWeaponModelID = -1;

            if (WeaponVisual == null)
            {
                return;
            }


            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance() != null)
                {
                    int nProfession = -1;
                    nProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();

                    if (nProfession == (int)CharacterDefine.PROFESSION.SHAOLIN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDShaoLin;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.TIANSHAN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDTianShan;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.DALI)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDDaLi;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDXiaoYao;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDGaiBang;
                    }
                }
            }

            else
            {
                nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(WeaponVisual);
            }


            Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

            if (tabWeaponModel == null)
            {
                return;
            }

            int playerProfession = -1;

            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance())
                {
                    playerProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();
                }
            }

            else
            {
                playerProfession = Singleton <ObjManager> .Instance.MainPlayer.Profession;
            }

            if (playerProfession == (int)CharacterDefine.PROFESSION.TIANSHAN ||
                playerProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
            {
                LoadWeapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", tabWeaponModel);
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else if (playerProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
        }
Exemplo n.º 5
0
    void HandleFitOnWeapon(int nGoodsId, int nDataID, Tab_EquipAttr tabWeaponEquipAttr)
    {
        Tab_ItemVisual tabItemVisual = TableManager.GetItemVisualByID(tabWeaponEquipAttr.ModelId, 0);

        if (tabItemVisual == null)
        {
            return;
        }

        int nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(tabItemVisual);

        Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

        if (tabWeaponModel == null)
        {
            return;
        }

        /// 因为可能显示过伙伴 坐骑的模型 所以要重载玩家模型预览 设置玩家外观
        Tab_ItemVisual tabModelVisual = null;

        if (m_FitOnVisual.FashionID != GlobeVar.INVALID_ID)
        {
            Tab_FashionData tabFashionData = TableManager.GetFashionDataByID(m_FitOnVisual.FashionID, 0);
            if (tabFashionData == null)
            {
                return;
            }
            tabModelVisual = TableManager.GetItemVisualByID(tabFashionData.ItemVisualID, 0);
        }
        else if (m_FitOnVisual.ArmorID != GlobeVar.INVALID_ID)
        {
            Tab_EquipAttr tabArmorEquipAttr = TableManager.GetEquipAttrByID(m_FitOnVisual.ArmorID, 0);
            if (tabArmorEquipAttr == null)
            {
                return;
            }
            tabModelVisual = TableManager.GetItemVisualByID(tabArmorEquipAttr.ModelId, 0);
        }
        else
        {
            if (Singleton <ObjManager> .Instance.MainPlayer.ModelVisualID == GlobeVar.INVALID_ID)
            {
                tabModelVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
            }
            else
            {
                tabModelVisual = TableManager.GetItemVisualByID(Singleton <ObjManager> .Instance.MainPlayer.ModelVisualID, 0);
            }
        }

        if (tabModelVisual == null)
        {
            return;
        }
        // 设置结束 下面与武器一起重载

        int nCharModelID = Singleton <ObjManager> .Instance.MainPlayer.GetCharModelID(tabModelVisual);

        Tab_CharModel tabCharModel = TableManager.GetCharModelByID(nCharModelID, 0);

        if (tabCharModel == null)
        {
            return;
        }

        Tab_FakeObject tabFakeObject = TableManager.GetFakeObjectByID(m_FakeObjID, 0);

        if (tabFakeObject == null)
        {
            return;
        }

        m_FitOnVisual.WeaponGoodsID = nGoodsId;
        m_FitOnVisual.WeaponID      = nDataID;

        List <object> param = new List <object>();

        param.Add(tabFakeObject);
        param.Add(m_FitOnFakeObj);
        param.Add(m_FitOnVisual);

        Singleton <ObjManager> .GetInstance().ReloadModel(m_FitOnGameObject,
                                                          tabCharModel.ResPath,
                                                          Singleton <ObjManager> .GetInstance().AsycLoadFitOnObjOver,
                                                          param);
    }
Exemplo n.º 6
0
        public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable)
        {
            // 重载武器
            bool           defaultVisual = false;
            Tab_ItemVisual WeaponVisual  = null;
            Tab_EquipAttr  tabEquipAttr  = TableManager.GetEquipAttrByID(nCurWeaponID, 0);

            if (tabEquipAttr != null)
            {
                Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0);
                if (tabWeaponVisual != null)
                {
                    WeaponVisual = tabWeaponVisual;
                }
                else
                {
                    defaultVisual = true;
                }
            }
            else
            {
                defaultVisual = true;
            }

            if (defaultVisual)
            {
                Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabDefaultVisual == null)
                {
                    return;
                }

                WeaponVisual = tabDefaultVisual;
            }

            if (WeaponVisual == null)
            {
                return;
            }

            int nWeaponModelID = GetWeaponModelID(WeaponVisual, GameManager.gameManager.OtherPlayerData.Profession);

            Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

            if (tabWeaponModel == null)
            {
                return;
            }

            if (GameManager.gameManager.OtherPlayerData == null)
            {
                return;
            }
            if (GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.TIANSHAN ||
                GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.GAIBANG)
            {
                LoadOtherViewWapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
            }
            else if (GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.XIAOYAO)
            {
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", Vector3.zero);
            }
            else
            {
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
            }
        }
 public virtual void OnWeaponEquOk(Tab_WeaponModel tabData)
 {
 }