Beispiel #1
0
        /*界面中自己模型更改*/
        public void Show_this_Fashion()
        {
            int body_id = 0;
            int eqp_id  = 0;
            /* SelfRole._inst*/
            Dictionary <int, fashionshow_date> dic = A3_FashionShowModel.getInstance().Dic_AllData;

            if (nowchooseid_body == 0)
            {
                if (A3_FashionShowModel.getInstance().nowfs[1] == 0)
                {
                    body_id = 0;
                }
                else
                {
                    body_id = A3_FashionShowModel.getInstance().nowfs[1];
                }
            }
            else
            {
                body_id = nowchooseid_body;
            }
            if (nowchooseid_eqp == 0)
            {
                if (A3_FashionShowModel.getInstance().nowfs[0] == 0)
                {
                    eqp_id = 0;
                }
                else
                {
                    eqp_id = A3_FashionShowModel.getInstance().nowfs[0];
                }
            }
            else
            {
                eqp_id = nowchooseid_eqp;
            }


            if (body_id != 0)
            {
                m_proAvatar.set_body(body_id, 0);
            }
            if (eqp_id != 0)
            {
                switch (PlayerModel.getInstance().profession)
                {
                case 2:
                case 3:
                    m_proAvatar.set_weaponr(eqp_id, 0);
                    break;

                case 5:
                    m_proAvatar.set_weaponl(eqp_id, 0);
                    m_proAvatar.set_weaponr(eqp_id, 0);
                    break;
                }
            }
        }
        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);
        }
Beispiel #3
0
        private GameObject createMagaAvatar(ChaOutInfo info)
        {
            GameObject       original         = Resources.Load <GameObject>("profession/avatar_ui/mage_avatar");
            GameObject       gameObject       = UnityEngine.Object.Instantiate(original, this.standPoint.transform.position, Quaternion.identity) as GameObject;
            Transform        transform        = gameObject.transform.FindChild("model");
            ProfessionAvatar professionAvatar = new ProfessionAvatar();

            professionAvatar.Init("profession/mage/", "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, transform.transform, "Fx/armourFX/mage/");
            professionAvatar.set_body(info.bodyID, info.bodyInte);
            professionAvatar.set_weaponl(info.weaponLID, info.weaponLInte);
            professionAvatar.set_weaponr(info.weaponRID, info.weaponRInte);
            professionAvatar.set_wing(info.wingID, info.wingInte);
            professionAvatar.set_equip_color((uint)info.colorID);
            bool addeff = info.addeff;

            if (addeff)
            {
                professionAvatar.set_equip_eff(info.bodyID, true);
            }
            this.m_curProAvatar = professionAvatar;
            Transform parent = gameObject.transform.FindChild("model/R_Finger1");

            original = Resources.Load <GameObject>("profession/avatar_ui/mage_r_finger_fire");
            GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(original);

            gameObject2.transform.SetParent(parent, false);
            return(gameObject);
        }
        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);
        }
        public void set_body(int id, int fxlevel)
        {
            if (viewType != VIEW_TYPE_ALL)
            {
                m_roleDta.m_BodyID   = id;
                m_roleDta.m_BodyFXID = fxlevel;
                return;
            }

            m_proAvatar.set_body(id, fxlevel);
        }
Beispiel #6
0
    public void SetSkin()
    {
        SXML        sXML     = XMLMgr.instance.GetSXML("mlzd", "");
        int         num      = SelfRole._inst.zhuan * 10 + SelfRole._inst.lvl;
        int         num2     = 2;
        int         num3     = 3;
        List <SXML> nodeList = sXML.GetNodeList("stage", "");

        foreach (SXML current in nodeList)
        {
            string @string = current.getString("lvl");
            int    num4    = int.Parse(@string.Split(new char[]
            {
                ','
            })[0]);
            int num5 = int.Parse(@string.Split(new char[]
            {
                ','
            })[1]);
            bool flag = num <= num4 * 10 + num5;
            if (flag)
            {
                num2 = current.getInt("waiguan");
                break;
            }
        }
        GameObject gameObject  = this.m_curModel.parent.gameObject;
        string     avatar_path = "profession/assa/";

        Transform[] componentsInChildren = gameObject.GetComponentsInChildren <Transform>();
        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            Transform transform = componentsInChildren[i];
            transform.gameObject.layer = EnumLayer.LM_SELFROLE;
        }
        Transform        transform2       = gameObject.transform.FindChild("model");
        ProfessionAvatar professionAvatar = new ProfessionAvatar();

        professionAvatar.Init(avatar_path, "l_", this.m_curGameObj.layer, EnumMaterial.EMT_EQUIP_L, this.m_curModel, "");
        professionAvatar.set_body(num3 * 100 + num2 * 10 + 3, 0);
        professionAvatar.set_weaponl(num3 * 100 + num2 * 10 + 6, 0);
        professionAvatar.set_weaponr(num3 * 100 + num2 * 10 + 6, 0);
        professionAvatar.set_wing(0, 0);
        this.m_curPhy = this.m_curModel.transform.FindChild("physics");
        try
        {
            this.m_curPhy.gameObject.layer = EnumLayer.LM_BT_FIGHT;
        }
        catch (Exception var_18_1F5)
        {
        }
    }
Beispiel #7
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 #8
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) {
        }
    }
Beispiel #9
0
        private GameObject createAssassinAvatar(ChaOutInfo info)
        {
            GameObject       original         = Resources.Load <GameObject>("profession/avatar_ui/assa_avatar");
            GameObject       gameObject       = UnityEngine.Object.Instantiate(original, this.standPoint.transform.position, Quaternion.identity) as GameObject;
            Transform        cur_model        = gameObject.transform.FindChild("model");
            ProfessionAvatar professionAvatar = new ProfessionAvatar();

            professionAvatar.Init("profession/assa/", "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, cur_model, "Fx/armourFX/assa/");
            professionAvatar.set_body(info.bodyID, info.bodyInte);
            professionAvatar.set_weaponl(info.weaponLID, info.weaponLInte);
            professionAvatar.set_weaponr(info.weaponRID, info.weaponRInte);
            professionAvatar.set_wing(info.wingID, info.wingInte);
            professionAvatar.set_equip_color((uint)info.colorID);
            bool addeff = info.addeff;

            if (addeff)
            {
                professionAvatar.set_equip_eff(info.bodyID, true);
            }
            this.m_curProAvatar = professionAvatar;
            return(gameObject);
        }
Beispiel #10
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);
            }
        }
Beispiel #11
0
        public void initAvatar()
        {
            bool flag = this.m_anim_usr == null;

            if (flag)
            {
                this.m_selfObj = null;
                bool flag2 = SelfRole._inst is P2Warrior;
                if (flag2)
                {
                    GameObject original = Resources.Load <GameObject>("profession/avatar_ui/warrior_avatar");
                    this.m_selfObj = (UnityEngine.Object.Instantiate(original, new Vector3(500f, 0f, 1f), new Quaternion(0f, 0f, 0f, 0f)) as GameObject);
                    this.m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0f, -20f, 0f));
                }
                else
                {
                    bool flag3 = SelfRole._inst is P3Mage;
                    if (flag3)
                    {
                        GameObject original = Resources.Load <GameObject>("profession/avatar_ui/mage_avatar");
                        this.m_selfObj = (UnityEngine.Object.Instantiate(original, new Vector3(500f, 0f, 1f), new Quaternion(0f, 0f, 0f, 0f)) as GameObject);
                        this.m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0f, -20f, 0f));
                    }
                    else
                    {
                        bool flag4 = SelfRole._inst is P5Assassin;
                        if (flag4)
                        {
                            GameObject original = Resources.Load <GameObject>("profession/avatar_ui/assa_avatar");
                            this.m_selfObj = (UnityEngine.Object.Instantiate(original, new Vector3(500f, 0f, 1f), new Quaternion(0f, 0f, 0f, 0f)) as GameObject);
                            this.m_selfObj.transform.FindChild("model").localRotation = Quaternion.Euler(new Vector3(0f, -20f, 0f));
                        }
                    }
                }
                Transform transform = this.m_selfObj.transform.FindChild("model");
                transform.localScale = new Vector3(1.3f, 1.3f, 1.3f);
                ProfessionAvatar professionAvatar = new ProfessionAvatar();
                professionAvatar.Init(SelfRole._inst.m_strAvatarPath, "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, transform, "");
                this.m_proAvatar = professionAvatar;
                bool flag5 = ModelBase <a3_EquipModel> .getInstance().active_eqp.Count >= 10;

                if (flag5)
                {
                    this.m_proAvatar.set_equip_eff(ModelBase <a3_EquipModel> .getInstance().GetEqpIdbyType(3), true);
                }
                professionAvatar.set_body(SelfRole._inst.get_bodyid(), SelfRole._inst.get_bodyfxid());
                professionAvatar.set_weaponl(SelfRole._inst.get_weaponl_id(), SelfRole._inst.get_weaponl_fxid());
                professionAvatar.set_weaponr(SelfRole._inst.get_weaponr_id(), SelfRole._inst.get_weaponr_fxid());
                professionAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                professionAvatar.set_equip_color(SelfRole._inst.get_equip_colorid());
                this.m_anim_usr = transform.GetComponent <Animator>();
                Transform[] componentsInChildren = this.m_selfObj.GetComponentsInChildren <Transform>();
                Transform[] array = componentsInChildren;
                for (int i = 0; i < array.Length; i++)
                {
                    Transform transform2 = array[i];
                    transform2.gameObject.layer = EnumLayer.LM_DEFAULT;
                }
                bool flag6 = SelfRole._inst is P3Mage;
                if (flag6)
                {
                    Vector3 center = professionAvatar.m_BodySkin.localBounds.center;
                    center.y = 1.3f;
                    Bounds              localBounds = professionAvatar.m_BodySkin.localBounds;
                    Vector3             size        = localBounds.size;
                    SkinnedMeshRenderer arg_3BE_0   = professionAvatar.m_ShoulderSkin;
                    SkinnedMeshRenderer arg_3B6_0   = professionAvatar.m_BodySkin;
                    localBounds           = new Bounds(center, size);
                    arg_3B6_0.localBounds = localBounds;
                    arg_3BE_0.localBounds = localBounds;
                }
            }
            NpcRole npc   = dialog.m_npc;
            bool    flag7 = dialog.fake_npc != null;

            if (flag7)
            {
                npc = dialog.fake_npc;
            }
            bool flag8 = this.m_anim_npc == null && npc != null;

            if (flag8)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(npc.gameObject);
                this.m_anim_npc = gameObject.GetComponent <Animator>();
                UnityEngine.Object.Destroy(gameObject.GetComponent <NavMeshAgent>());
                gameObject.transform.localPosition = npc.talkOffset;
                gameObject.transform.localScale    = npc.talkScale;
                gameObject.transform.eulerAngles   = Vector3.zero;
                debug.Log(string.Concat(new object[]
                {
                    ":::::::::::::::::::::::::::::::::::::::::::::",
                    gameObject.transform.position,
                    " ",
                    gameObject.gameObject.name
                }));
                Transform[] componentsInChildren2 = gameObject.GetComponentsInChildren <Transform>();
                Transform[] array2 = componentsInChildren2;
                for (int j = 0; j < array2.Length; j++)
                {
                    Transform transform3 = array2[j];
                    transform3.gameObject.layer = EnumLayer.LM_DEFAULT;
                }
                NpcRole component = gameObject.GetComponent <NpcRole>();
                bool    flag9     = component != null;
                if (flag9)
                {
                    UnityEngine.Object.Destroy(component);
                }
            }
        }
Beispiel #12
0
    public void SetSkin()
    {
        SXML itemsXMl = XMLMgr.instance.GetSXML("mlzd");
        int  lvln     = SelfRole._inst.zhuan * 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 * b)
            {
                waiguan = v.getInt("waiguan");
                break;
            }
        }

        GameObject       m_Obj = this.m_curModel.parent.gameObject;
        ProfessionAvatar m_proAvatar;
        string           m_strAvatarPath = "";

        if (SelfRole._inst is P2Warrior)
        {
            m_strAvatarPath = "profession/warrior/";
            a_w_b_c         = 1;
        }
        else if (SelfRole._inst is P3Mage)
        {
            m_strAvatarPath = "profession/mage/";
            a_w_b_c         = 2;
        }
        else if (SelfRole._inst is P5Assassin)
        {
            m_strAvatarPath = "profession/assa/";
            a_w_b_c         = 3;
        }

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

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

        //手上的小火球
        if (SelfRole._inst.m_LockRole is P3Mage)
        {
            Transform  cur_r_finger1 = cur_model.FindChild("R_Finger1");
            var        obj_prefab    = Resources.Load <GameObject>("profession/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(m_strAvatarPath, "h_", EnumLayer.LM_FX, EnumMaterial.EMT_EQUIP_H, cur_model);

        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(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) {
        }
    }
Beispiel #13
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);
                }
            }
        }
Beispiel #14
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;
                }
            }
        }
        /*对手*/
        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 #17
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();
                }
            }
        }
        //创建角色
        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);
            }
        }