private ProfessionAvatar createMagaAvatar(ChaOutInfo info)
        {
            GameObject obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
            GameObject magicGO    = GameObject.Instantiate(obj_prefab, standPoint.transform.position, Quaternion.identity) as GameObject;

            Transform cur_model = magicGO.transform.FindChild("model");

            //创建avatar
            ProfessionAvatar m_proAvatar = new ProfessionAvatar();
            string           str         = "h_";

            m_proAvatar.Init_PA(A3_PROFESSION.Mage, "profession_mage_", str, EnumLayer.LM_SELFROLE, EnumMaterial.EMT_EQUIP_H, cur_model.transform, "Fx_armourFX_mage_");
            m_proAvatar.set_body(info.bodyID, info.bodyInte);
            m_proAvatar.set_weaponl(info.weaponLID, info.weaponLInte);
            //m_proAvatar.set_weaponr(info.weaponRID, info.weaponRInte);
            m_proAvatar.set_wing(info.wingID, info.wingInte);
            m_proAvatar.set_equip_color((uint)info.colorID);

            if (info.addeff)
            {
                m_proAvatar.set_equip_eff(info.bodyID, true);
            }
            m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(info.activecount));
            m_curProAvatar = m_proAvatar;

            //火焰
            Transform cur_r_finger1 = magicGO.transform.FindChild("model/R_Finger1");

            obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
            GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;

            light_fire.transform.SetParent(cur_r_finger1, false);

            return(m_proAvatar);
        }
        private ProfessionAvatar createAssassinAvatar(ChaOutInfo info)
        {
            GameObject obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
            GameObject rogueGO    = GameObject.Instantiate(obj_prefab, standPoint.transform.position, Quaternion.identity) as GameObject;

            Transform cur_model = rogueGO.transform.FindChild("model");

            //创建avatar
            ProfessionAvatar m_proAvatar = new ProfessionAvatar();
            string           str         = "h_";

            m_proAvatar.Init_PA(A3_PROFESSION.Assassin, "profession_assa_", str, EnumLayer.LM_SELFROLE, EnumMaterial.EMT_EQUIP_H, cur_model, "Fx_armourFX_assa_");

            m_proAvatar.set_body(info.bodyID, info.bodyInte);
            m_proAvatar.set_weaponl(info.weaponLID, info.weaponLInte);
            m_proAvatar.set_weaponr(info.weaponRID, info.weaponRInte);
            m_proAvatar.set_wing(info.wingID, info.wingInte);
            m_proAvatar.set_equip_color((uint)info.colorID);
            if (info.addeff)
            {
                m_proAvatar.set_equip_eff(info.bodyID, true);
            }
            m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(info.activecount));
            m_curProAvatar = m_proAvatar;

            return(m_proAvatar);
        }
Beispiel #3
0
        void changeWing(int curStage)
        {
            if (wingAvatar != null)
            {
                if (wingAvatar.transform.FindChild("model/Plus_B").transform.childCount > 0)
                {
                    GameObject.Destroy(wingAvatar.transform.FindChild("model/Plus_B").transform.GetChild(0).gameObject);
                }
            }

            A3_PROFESSION eprofession = A3_PROFESSION.None;

            if (SelfRole._inst is P2Warrior)
            {
                eprofession = A3_PROFESSION.Warrior;
            }
            else if (SelfRole._inst is P3Mage)
            {
                eprofession = A3_PROFESSION.Mage;
            }
            else if (SelfRole._inst is P5Assassin)
            {
                eprofession = A3_PROFESSION.Assassin;
            }

            Transform cur_model = wingAvatar.transform.FindChild("model");

            m_proAvatar = new ProfessionAvatar();
            m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
            m_proAvatar.set_wing(curStage, curStage);
        }
Beispiel #4
0
        void createAvatar_body()
        {
            GameObject    obj_prefab;
            A3_PROFESSION eprofession = A3_PROFESSION.None;

            if (SelfRole._inst is P2Warrior)
            {
                eprofession = A3_PROFESSION.Warrior;
                obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");//-213.44f, 0.1f, 0.8f
                m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
            }
            else if (SelfRole._inst is P3Mage)
            {
                eprofession = A3_PROFESSION.Mage;
                obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");//-213.48f, 0.19f, 0.5f
                m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 167, 0, 0)) as GameObject;
            }
            else if (SelfRole._inst is P5Assassin)
            {
                eprofession = A3_PROFESSION.Assassin;
                obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");//-213.46f, 0.12f, 1.2f
                m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
            }
            else
            {
                return;
            }
            foreach (Transform tran in m_SelfObj.GetComponentsInChildren <Transform>())
            {
                tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;// 更改物体的Layer层
            }
            Transform cur_model = m_SelfObj.transform.FindChild("model");

            if (SelfRole._inst is P3Mage)
            {
                Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                light_fire.transform.SetParent(cur_r_finger1, false);
            }
            m_proAvatar = new ProfessionAvatar();
            m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
            seteqp_eff();
            seteqp_eff_new();
            m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
            m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
            m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
            m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
            m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());
        }
Beispiel #5
0
    public void SetSkin()
    {
        SXML itemsXMl = XMLMgr.instance.GetSXML("mlzd");
        int  lvln     = SelfRole._inst.zhuan * 10 + SelfRole._inst.lvl;
        int  waiguan  = 2;
        int  a_w_b_c  = 1;
        var  vv       = itemsXMl.GetNodeList("stage");

        foreach (var v in vv)
        {
            string ss = v.getString("lvl");
            int    a  = int.Parse(ss.Split(',')[0]);
            int    b  = int.Parse(ss.Split(',')[1]);
            if (lvln <= a * 10 + b)
            {
                waiguan = v.getInt("waiguan");
                break;
            }
        }

        GameObject m_Obj = this.m_curGameObj;

        string m_strAvatarPath = "";

        m_strAvatarPath = "profession_warrior_";

        foreach (Transform tran in m_Obj.GetComponentsInChildren <Transform>())
        {
            tran.gameObject.layer = EnumLayer.LM_SELFROLE;            // 更改物体的Layer层
        }

        Transform cur_model = m_Obj.transform.FindChild("model");

        m_proAvatar.Init_PA(A3_PROFESSION.Warrior, m_strAvatarPath, "l_", m_curGameObj.layer, EnumMaterial.EMT_EQUIP_L, m_curModel);

        m_proAvatar.set_body(a_w_b_c * 100 + waiguan * 10 + 3, 0);
        m_proAvatar.set_weaponl(a_w_b_c * 100 + waiguan * 10 + 6, 0);
        m_proAvatar.set_weaponr(a_w_b_c * 100 + waiguan * 10 + 6, 0);
        m_proAvatar.set_wing(0, 0);
        //m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
        //m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());

        m_curPhy = m_curModel.transform.FindChild("physics");
        try {
            m_curPhy.gameObject.layer = EnumLayer.LM_BT_FIGHT;
        } catch (System.Exception ex) {
        }
    }
        /*对手*/
        void createAvatar_match()
        {
            if (sence_avater2 == null)
            {
                GameObject    obj_prefab;
                A3_PROFESSION eprofession     = A3_PROFESSION.None;
                string        m_strAvatarPath = "";
                string        equipEff_path   = "";
                if (carr == 2)
                {
                    eprofession     = A3_PROFESSION.Warrior;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    sence_avater2   = GameObject.Instantiate(obj_prefab, new Vector3(-143.82f, 7.86f, 24.88f), Quaternion.identity) as GameObject;
                    m_strAvatarPath = "profession_warrior_";
                    equipEff_path   = "Fx_armourFX_warrior_";
                    //sence_avater2.transform.eulerAngles = new Vector3(3.13f, 34.793f, 5.908f);
                }
                else if (carr == 3)
                {
                    eprofession     = A3_PROFESSION.Mage;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    sence_avater2   = GameObject.Instantiate(obj_prefab, new Vector3(-143.82f, 7.86f, 24.88f), Quaternion.identity) as GameObject;
                    m_strAvatarPath = "profession_mage_";
                    equipEff_path   = "Fx_armourFX_mage_";
                    //sence_avater2.transform.eulerAngles = new Vector3(3.197f, 29.584f, 6.8f);
                }
                else if (carr == 5)
                {
                    eprofession     = A3_PROFESSION.Assassin;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    sence_avater2   = GameObject.Instantiate(obj_prefab, new Vector3(-143.82f, 7.86f, 24.88f), Quaternion.identity) as GameObject;
                    m_strAvatarPath = "profession_assa_";
                    equipEff_path   = "Fx_armourFX_assa_";
                    //sence_avater2.transform.eulerAngles = new Vector3(1.497f, 32.282f, 5.623f);
                }
                else
                {
                    return;
                }


                Transform cur_model = sence_avater2.transform.FindChild("model");
                // cur_model.Rotate(Vector3.up, 200f);
                //cur_model.rotation = new Quaternion(-3.135f,-130f,-8.074f,1);
                //手上的小火球
                if (carr == 3)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                int  bodyid   = 0;
                int  bodyFxid = 0;
                uint colorid  = 0;
                if (Equips.ContainsKey(3))
                {
                    bodyid   = (int)Equips[3].tpid;
                    bodyFxid = Equips[3].equipdata.stage;
                    colorid  = Equips[3].equipdata.color;
                }
                int m_Weapon_LID   = 0;
                int m_Weapon_LFXID = 0;
                int m_Weapon_RID   = 0;
                int m_Weapon_RFXID = 0;

                if (Equips.ContainsKey(6))
                {
                    switch (carr)
                    {
                    case 2:
                        m_Weapon_RID   = (int)Equips[6].tpid;
                        m_Weapon_RFXID = Equips[6].equipdata.stage;
                        break;

                    case 3:
                        m_Weapon_LID   = (int)Equips[6].tpid;
                        m_Weapon_LFXID = Equips[6].equipdata.stage;
                        break;

                    case 5:
                        m_Weapon_LID   = (int)Equips[6].tpid;
                        m_Weapon_LFXID = Equips[6].equipdata.stage;
                        m_Weapon_RID   = (int)Equips[6].tpid;
                        m_Weapon_RFXID = Equips[6].equipdata.stage;
                        break;
                    }
                }
                m_proAvatar2 = new ProfessionAvatar();
                m_proAvatar2.Init_PA(eprofession, m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, equipEff_path);
                if (active_eqp.Count >= 10)
                {
                    m_proAvatar2.set_equip_eff(bodyid, true);
                }
                m_proAvatar2.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(active_eqp.Count));
                m_proAvatar2.set_body(bodyid, bodyFxid);
                m_proAvatar2.set_weaponl(m_Weapon_LID, m_Weapon_LFXID);
                m_proAvatar2.set_weaponr(m_Weapon_RID, m_Weapon_RFXID);
                m_proAvatar2.set_wing(show_wing, show_wing);
                m_proAvatar2.set_equip_color(colorid);
                foreach (Transform tran in sence_avater2.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                }
                matchload = true;
            }
        }
        /*自己*/
        void createAvatar_self()
        {
            GameObject    obj_prefab;
            A3_PROFESSION eprofession = A3_PROFESSION.None;

            if (SelfRole._inst is P2Warrior)
            {
                eprofession   = A3_PROFESSION.Warrior;
                obj_prefab    = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");//-213.44f, 0.1f, 0.8f
                sence_avater1 = GameObject.Instantiate(obj_prefab, new Vector3(-141.2f, 7.86f, 24.88f), new Quaternion(0, 0, 0, 0)) as GameObject;
            }
            else if (SelfRole._inst is P3Mage)
            {
                eprofession   = A3_PROFESSION.Mage;
                obj_prefab    = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");//-213.48f, 0.19f, 0.5f
                sence_avater1 = GameObject.Instantiate(obj_prefab, new Vector3(-140.88f, 7.86f, 24.88f), new Quaternion(0, 0, 0, 0)) as GameObject;
            }
            else if (SelfRole._inst is P5Assassin)
            {
                eprofession   = A3_PROFESSION.Assassin;
                obj_prefab    = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");//-213.46f, 0.12f, 1.2f
                sence_avater1 = GameObject.Instantiate(obj_prefab, new Vector3(-141.2f, 7.86f, 24.88f), new Quaternion(0, 0, 0, 0)) as GameObject;
            }
            else
            {
                return;
            }
            foreach (Transform tran in sence_avater1.GetComponentsInChildren <Transform>())
            {
                tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;// 更改物体的Layer层
            }
            Transform cur_model = sence_avater1.transform.FindChild("model");

            if (SelfRole._inst is P3Mage)
            {
                Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                light_fire.transform.SetParent(cur_r_finger1, false);
            }
            m_proAvatar1 = new ProfessionAvatar();
            string h_or_l;
            int    type = SelfRole._inst.get_bodyid() != 0 ? a3_BagModel.getInstance().getEquipTypeBytpId(SelfRole._inst.get_bodyid()) : 0;

            if (type == 11 || type == 12)
            {
                h_or_l = "l_";
            }
            else
            {
                h_or_l = "h_";
            }

            m_proAvatar1.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, h_or_l, EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
            if (m_proAvatar1 != null)
            {
                m_proAvatar1.clear_oldeff();
                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar1.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
            }
            if (m_proAvatar1 != null)
            {
                m_proAvatar1.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
            }

            m_proAvatar1.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
            m_proAvatar1.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
            m_proAvatar1.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
            m_proAvatar1.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
            m_proAvatar1.set_equip_color(SelfRole._inst.get_equip_colorid());
            myselfload = true;
        }
Beispiel #8
0
        private void CreatWingAvatar()
        {
            DisposeAvatar();

            if (wingAvatar == null)
            {
                //string path = "";
                GameObject    obj_prefab;
                A3_PROFESSION eprofession = A3_PROFESSION.None;
                if (SelfRole._inst is P2Warrior)
                {
                    eprofession = A3_PROFESSION.Warrior;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else if (SelfRole._inst is P3Mage)
                {
                    eprofession = A3_PROFESSION.Mage;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else if (SelfRole._inst is P5Assassin)
                {
                    eprofession = A3_PROFESSION.Assassin;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else
                {
                    return;
                }

                Transform cur_model = wingAvatar.transform.FindChild("model");

                foreach (Transform tran in wingAvatar.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;// 更改物体的Layer层
                }
                //手上的小火球
                if (SelfRole._inst is P3Mage)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                m_proAvatar = new ProfessionAvatar();
                m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
                m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());

                obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_show_scene");
                scene_Obj  = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.49f, 15.1f), new Quaternion(0, 180, 0, 0)) as GameObject;
                foreach (Transform tran in scene_Obj.GetComponentsInChildren <Transform>())
                {
                    if (tran.gameObject.name == "scene_ta")
                    {
                        tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;
                    }
                    else
                    {
                        tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                    }
                }
                obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_scene_ui_camera");
                avatarCamera = GameObject.Instantiate(obj_prefab) as GameObject;


                //Camera cam = avatarCamera.GetComponentInChildren<Camera>();
                //if (cam != null)
                //{
                //    float r_size = cam.orthographicSize * 1920 / 1080 * Screen.height / Screen.width;
                //    cam.orthographicSize = r_size;
                //}
            }
        }
        public void createAvatar()
        {
            if (m_SelfObj == null)
            {
                GameObject    obj_prefab;
                A3_PROFESSION eprofession     = A3_PROFESSION.None;
                string        m_strAvatarPath = "";
                string        equipEff_path   = "";
                if (carr == 2)
                {
                    eprofession     = A3_PROFESSION.Warrior;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    m_SelfObj       = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    m_strAvatarPath = "profession_warrior_";
                    equipEff_path   = "Fx_armourFX_warrior_";
                }
                else if (carr == 3)
                {
                    eprofession     = A3_PROFESSION.Mage;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    m_SelfObj       = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 167, 0, 0)) as GameObject;
                    m_strAvatarPath = "profession_mage_";
                    equipEff_path   = "Fx_armourFX_mage_";
                }
                else if (carr == 5)
                {
                    eprofession     = A3_PROFESSION.Assassin;
                    obj_prefab      = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    m_SelfObj       = GameObject.Instantiate(obj_prefab, new Vector3(-77.38f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    m_strAvatarPath = "profession_assa_";
                    equipEff_path   = "Fx_armourFX_assa_";
                }
                else
                {
                    return;
                }

                foreach (Transform tran in m_SelfObj.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;// 更改物体的Layer层
                }

                Transform cur_model = m_SelfObj.transform.FindChild("model");

                //手上的小火球
                if (carr == 3)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                int  bodyid   = 0;
                int  bodyFxid = 0;
                uint colorid  = 0;
                if (Equips.ContainsKey(3))
                {
                    bodyid   = (int)Equips[3].tpid;
                    bodyFxid = Equips[3].equipdata.stage;
                    colorid  = Equips[3].equipdata.color;
                }
                if (Equips.ContainsKey(11))
                {
                    bodyid   = ( int )Equips[11].tpid;
                    bodyFxid = Equips[11].equipdata.stage;
                    colorid  = Equips[11].equipdata.color;
                }
                int m_Weapon_LID   = 0;
                int m_Weapon_LFXID = 0;
                int m_Weapon_RID   = 0;
                int m_Weapon_RFXID = 0;

                if (Equips.ContainsKey(6))
                {
                    switch (carr)
                    {
                    case 2:
                        m_Weapon_RID   = (int)Equips[6].tpid;
                        m_Weapon_RFXID = Equips[6].equipdata.stage;
                        break;

                    case 3:
                        m_Weapon_LID   = (int)Equips[6].tpid;
                        m_Weapon_LFXID = Equips[6].equipdata.stage;
                        break;

                    case 5:
                        m_Weapon_LID   = (int)Equips[6].tpid;
                        m_Weapon_LFXID = Equips[6].equipdata.stage;
                        m_Weapon_RID   = (int)Equips[6].tpid;
                        m_Weapon_RFXID = Equips[6].equipdata.stage;
                        break;
                    }
                }
                if (Equips.ContainsKey(12))
                {
                    switch (carr)
                    {
                    case 2:
                        m_Weapon_RID   = ( int )Equips[12].tpid;
                        m_Weapon_RFXID = Equips[12].equipdata.stage;
                        break;

                    case 3:
                        m_Weapon_LID   = ( int )Equips[12].tpid;
                        m_Weapon_LFXID = Equips[12].equipdata.stage;
                        break;

                    case 5:
                        m_Weapon_LID   = ( int )Equips[12].tpid;
                        m_Weapon_LFXID = Equips[12].equipdata.stage;
                        m_Weapon_RID   = ( int )Equips[12].tpid;
                        m_Weapon_RFXID = Equips[12].equipdata.stage;
                        break;
                    }
                }
                m_proAvatar = new ProfessionAvatar();
                m_proAvatar.Init_PA(eprofession, m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, equipEff_path);
                if (active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(bodyid, true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(active_eqp.Count));
                if (fashionsshows[1] != 0)
                {
                    m_proAvatar.set_body(fashionsshows[1], 0);
                }
                else
                {
                    m_proAvatar.set_body(bodyid, bodyFxid);
                }
                if (fashionsshows[0] != 0)
                {
                    m_proAvatar.set_weaponl(fashionsshows[0], 0);
                    m_proAvatar.set_weaponr(fashionsshows[0], 0);
                }
                else
                {
                    m_proAvatar.set_weaponl(m_Weapon_LID, m_Weapon_LFXID);
                    m_proAvatar.set_weaponr(m_Weapon_RID, m_Weapon_RFXID);
                }
                m_proAvatar.set_wing(show_wing, show_wing);
                m_proAvatar.set_equip_color(colorid);
                if (m_proAvatar != null)
                {
                    m_proAvatar.FrameMove();
                }
            }
        }
Beispiel #10
0
        public void createAvatar()
        {
            if (m_SelfObj == null)
            {
                GameObject    obj_prefab;
                A3_PROFESSION eprofession = A3_PROFESSION.None;
                if (SelfRole._inst is P2Warrior)
                {
                    eprofession = A3_PROFESSION.Warrior;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(model.localPosition.x, model.localPosition.y, model.localPosition.z), model.localRotation) as GameObject;
                }
                else if (SelfRole._inst is P3Mage)
                {
                    eprofession = A3_PROFESSION.Mage;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(model.localPosition.x, model.localPosition.y, model.localPosition.z), model.localRotation) as GameObject;
                }
                else if (SelfRole._inst is P5Assassin)
                {
                    eprofession = A3_PROFESSION.Assassin;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    m_SelfObj   = GameObject.Instantiate(obj_prefab, new Vector3(model.localPosition.x, model.localPosition.y, model.localPosition.z), model.localRotation) as GameObject;
                }
                else
                {
                    return;
                }

                foreach (Transform tran in m_SelfObj.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                }

                Transform cur_model = m_SelfObj.transform.FindChild("model");

                //手上的小火球
                if (SelfRole._inst is P3Mage)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                m_proAvatar = new ProfessionAvatar();
                m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
                m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());

                obj_prefab    = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_roleinfo_ui_camera");
                m_Self_Camera = GameObject.Instantiate(obj_prefab) as GameObject;

                var lg = m_Self_Camera.GetComponentInChildren <Light>();
                if (lg != null)
                {
                    lg.color = Color.white;
                }
            }
        }
Beispiel #11
0
        public void initAvatar()
        {
            //GameObject goSkmesh_camera;
            //m_skmesh_camera.transform.localPosition = new Vector3(-129.7f, 1.34f, -124.98f);

            if (m_anim_usr == null)
            {
                //加入主角的显示
                //Variant data = muNetCleint.instance.joinWorldInfoInst.mainPlayerInfo;
                //string model_id = data["sex"]._str;

                m_selfObj = null;
                GameObject    obj_prefab;
                A3_PROFESSION eprofession = A3_PROFESSION.None;
                if (SelfRole._inst is P2Warrior)
                {
                    eprofession = A3_PROFESSION.Warrior;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    m_selfObj   = GameObject.Instantiate(obj_prefab, new Vector3(500, 0f, 1f), new Quaternion(0, 0, 0, 0)) as GameObject;

                    m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0, -20, 0));
                }
                else if (SelfRole._inst is P3Mage)
                {
                    eprofession = A3_PROFESSION.Mage;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    m_selfObj   = GameObject.Instantiate(obj_prefab, new Vector3(500, 0f, 1f), new Quaternion(0, 0, 0, 0)) as GameObject;
                    m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0, -20, 0));
                }
                else if (SelfRole._inst is P5Assassin)
                {
                    eprofession = A3_PROFESSION.Assassin;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    m_selfObj   = GameObject.Instantiate(obj_prefab, new Vector3(500, 0f, 1f), new Quaternion(0, 0, 0, 0)) as GameObject;
                    m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0, -20, 0));
                }

                Transform trans = m_selfObj.transform.FindChild("model");

                trans.localScale = new Vector3(1.3f, 1.3f, 1.3f);

                m_proAvatar = new ProfessionAvatar();

                m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, trans);

                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
                m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());
                m_anim_usr = trans.GetComponent <Animator>();

                //m_selfObj.transform.eulerAngles = Vector3.zero;


                Transform[] listT = m_selfObj.GetComponentsInChildren <Transform>();
                foreach (Transform tran in listT)
                {
                    tran.gameObject.layer = EnumLayer.LM_DEFAULT;
                }

                if (SelfRole._inst is P3Mage)
                {
                    Vector3 centervec = m_proAvatar.m_BodySkin.localBounds.center;
                    centervec.y = 1.3f;
                    Vector3 sizevec = m_proAvatar.m_BodySkin.localBounds.size;
                    m_proAvatar.m_ShoulderSkin.localBounds = m_proAvatar.m_BodySkin.localBounds = new Bounds(centervec, sizevec);

                    // usr.m_BodySkin.bounds
                }


                //GameObject skmesh_usr = GameObject.Instantiate(SelfRole._inst.m_curModel.gameObject) as GameObject;
                //m_anim_usr = skmesh_usr.GetComponent<Animator>();
                //Destroy(skmesh_usr.GetComponent<NavMeshAgent>());
                //skmesh_usr.transform.position = new Vector3(65535f, 1f, 1f);
                //skmesh_usr.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f);
                //skmesh_usr.transform.eulerAngles = Vector3.zero;
            }


            NpcRole npc = m_npc;

            if (fake_npc != null)
            {
                npc = fake_npc;
            }

            if (m_npc_obj == null && npc != null)
            {
                GameObject skmesh_npc        = GameObject.Instantiate(npc.gameObject) as GameObject;
                bool       build_npc_success = true;
                if (skmesh_npc.transform.childCount > 0)
                {
                    Transform tf_model = skmesh_npc.transform.GetChild(0).FindChild("model");
                    if (tf_model != null)
                    {
                        tf_model.localPosition = Vector3.zero;
                        m_anim_npc             = tf_model.GetComponent <Animator>();
                        m_npc_obj = skmesh_npc;
                        Destroy(skmesh_npc.GetComponent <NavMeshAgent>());
                        skmesh_npc.transform.localPosition = npc.talkOffset;
                        skmesh_npc.transform.localScale    = npc.talkScale;
                        skmesh_npc.transform.eulerAngles   = Vector3.zero;


                        debug.Log(":::::::::::::::::::::::::::::::::::::::::::::" + skmesh_npc.transform.position + " " + skmesh_npc.gameObject.name);

                        Transform[] listTN = skmesh_npc.GetComponentsInChildren <Transform>();
                        foreach (Transform tran in listTN)
                        {
                            tran.gameObject.layer = EnumLayer.LM_DEFAULT;
                        }

                        NpcRole npcrole = skmesh_npc.GetComponent <NpcRole>();
                        if (npcrole != null)
                        {
                            Destroy(npcrole);
                        }
                    }
                    else
                    {
                        build_npc_success = false;
                    }
                }
                else
                {
                    build_npc_success = false;
                }

                if (build_npc_success == false)
                {
                    Debug.LogError("创建NPC失败: " + skmesh_npc.name);
                    GameObject.Destroy(skmesh_npc);
                }
            }
        }
        //创建角色
        public void createAvatar()
        {
            if (m_SelfObj == null)
            {
                GameObject    obj_prefab;
                A3_PROFESSION eprofession = A3_PROFESSION.None;
                if (SelfRole._inst is P2Warrior)
                {
                    eprofession = A3_PROFESSION.Warrior;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                }
                else if (SelfRole._inst is P3Mage)
                {
                    eprofession = A3_PROFESSION.Mage;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                }
                else if (SelfRole._inst is P5Assassin)
                {
                    eprofession = A3_PROFESSION.Assassin;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                }
                else
                {
                    return;
                }


                m_SelfObj = GameObject.Instantiate(obj_prefab, new Vector3(-128f, 0f, 0f), Quaternion.identity) as GameObject;

                Transform cur_model = m_SelfObj.transform.FindChild("model");
                m_SelfObj.transform.SetParent(roleModle.transform, true);
                foreach (Transform tran in m_SelfObj.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                }
                m_SelfObj.transform.localPosition = Vector3.zero;
                m_SelfObj.transform.localScale    = new Vector3(1, 1, 1);
                m_SelfObj.transform.localRotation = Quaternion.Euler(0, 90, 0);
                m_SelfObj.name = "UIAvatar";
                //手上的小火球
                if (SelfRole._inst is P3Mage)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                m_proAvatar = new ProfessionAvatar();
                m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);

                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
                m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());

                cur_model.Rotate(Vector3.up, 90f);
            }
        }
Beispiel #13
0
        private void CreatAvatar()
        {
            if (wingAvatar == null)
            {
                //string path = "";
                GameObject    obj_prefab;
                A3_PROFESSION eprofession = A3_PROFESSION.None;
                if (SelfRole._inst is P2Warrior)
                {
                    eprofession = A3_PROFESSION.Warrior;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_warrior_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.06f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else if (SelfRole._inst is P3Mage)
                {
                    eprofession = A3_PROFESSION.Mage;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.06f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else if (SelfRole._inst is P5Assassin)
                {
                    eprofession = A3_PROFESSION.Assassin;
                    obj_prefab  = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_assa_avatar");
                    if (obj_prefab != null)
                    {
                        wingAvatar = GameObject.Instantiate(obj_prefab, new Vector3(-77.06f, -0.602f, 14.934f), new Quaternion(0, 90, 0, 0)) as GameObject;
                    }
                }
                else
                {
                    return;
                }

                Transform cur_model = wingAvatar.transform.FindChild("model");

                foreach (Transform tran in wingAvatar.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;// 更改物体的Layer层
                }
                //手上的小火球
                if (SelfRole._inst is P3Mage)
                {
                    Transform cur_r_finger1 = cur_model.FindChild("R_Finger1");
                    obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_mage_r_finger_fire");
                    GameObject light_fire = GameObject.Instantiate(obj_prefab) as GameObject;
                    light_fire.transform.SetParent(cur_r_finger1, false);
                }

                m_proAvatar = new ProfessionAvatar();
                int type = SelfRole._inst.get_bodyid() != 0 ? a3_BagModel.getInstance().getEquipTypeBytpId(SelfRole._inst.get_bodyid()) : 0;
                m_proAvatar.Init_PA(eprofession, SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_ROLE_INVISIBLE, EnumMaterial.EMT_EQUIP_H, cur_model, SelfRole._inst.m_strEquipEffPath);
                if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
                {
                    m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
                }
                m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEff_lvl(a3_EquipModel.getInstance().active_eqp.Count));
                m_proAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                m_proAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                m_proAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                m_proAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());

                obj_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_ride_show_scene");
                scene_Obj  = GameObject.Instantiate(obj_prefab, new Vector3(-76.98f, -0.49f, 15.1f), new Quaternion(0, 180, 0, 0)) as GameObject;
                foreach (Transform tran in scene_Obj.GetComponentsInChildren <Transform>())
                {
                    if (tran.gameObject.name == "scene_ta")
                    {
                        tran.gameObject.layer = EnumLayer.LM_FX;
                        scenceTa = tran.gameObject;
                    }
                    else if (tran.gameObject.name == "sc_tz_lg")
                    {
                        tran.gameObject.layer = EnumLayer.LM_FX;
                        scenceTzLg            = tran.gameObject;
                    }
                    else
                    {
                        tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                    }
                }
                obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_scene_ui_camera");
                avatarCamera = GameObject.Instantiate(obj_prefab) as GameObject;
                camera       = avatarCamera.GetComponentInChildren <Camera>();
                camera.transform.localPosition    = new Vector3(-76.5f, 14.67f, -18f);
                camera.transform.localEulerAngles = new Vector3(22.436f, 0.8290001f, 360.225f);
                camera.orthographicSize           = 2.27f;
                camera.cullingMask = (1 << EnumLayer.LM_FX);
            }
        }