コード例 #1
0
 void seteqp_eff()
 {
     if (m_proAvatar != null)
     {
         m_proAvatar.clear_oldeff();
         if (a3_EquipModel.getInstance().active_eqp.Count >= 10)
         {
             m_proAvatar.set_equip_eff(a3_EquipModel.getInstance().GetEqpIdbyType(3), true);
         }
     }
 }
コード例 #2
0
        /*自己*/
        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;
        }