Exemplo n.º 1
0
        public GameObject createEquipIcon(EquipConf data, float scale = 1.0f, bool istouch = false)
        {
            string     file       = "icon_equip_" + data.tpid;
            string     borderfile = "icon_itemborder_b039_0" + data.quality;
            GameObject iconPrefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_iconimage");
            GameObject root       = GameObject.Instantiate(iconPrefab) as GameObject;
            Image      icon       = root.transform.FindChild("icon").GetComponent <Image>();

            icon.sprite = GAMEAPI.ABUI_LoadSprite(file);
            Image iconborder = root.transform.FindChild("iconbor").GetComponent <Image>();

            iconborder.sprite = GAMEAPI.ABUI_LoadSprite(borderfile);
            Text numText = root.transform.FindChild("num").GetComponent <Text>();

            numText.gameObject.SetActive(false);
            root.transform.GetComponent <Button>().enabled = false;

            root.transform.localScale = new Vector3(scale, scale, 1.0f);
            root.name = "icon";

            if (istouch)
            {
                root.transform.GetComponent <Button>().enabled = true;
            }
            else
            {
                root.transform.GetComponent <Button>().enabled = false;
            }

            return(root);
        }
        //创建角色
        public void createAvatar(int id, int profession)
        {
            if (m_EquipObj == null)
            {
                GameObject obj_prefab = GAMEAPI.ABModel_LoadNow_GameObject("profession_" + getProfession(profession) + "_weaponl_l_" + id.ToString());
                if (obj_prefab == null)
                {
                    obj_prefab = GAMEAPI.ABModel_LoadNow_GameObject("profession_" + getProfession(profession) + "_weaponr_l_" + id.ToString());
                }
                if (obj_prefab == null)
                {
                    Debug.Log("无法找到模型文件."); return;
                }

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


                foreach (Transform tran in m_EquipObj.GetComponentsInChildren <Transform>())
                {
                    tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                }
                m_EquipObj.transform.localPosition = new Vector3(0, 10, 0);
                m_EquipObj.transform.localScale    = new Vector3(1, 1, 1);
                m_EquipObj.transform.localRotation = Quaternion.Euler(-90, 0, 0);
                m_EquipObj.name = "UIEquip";

                obj_prefab    = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_ui_FirstRechargeCamera");
                m_Self_Camera = GameObject.Instantiate(obj_prefab) as GameObject;
                Camera cam = m_Self_Camera.GetComponentInChildren <Camera>();
            }
        }
Exemplo n.º 3
0
        void createAvatar_body(int objid, float size)
        {
            GameObject obj_prefab;

            obj_prefab = GAMEAPI.ABModel_LoadNow_GameObject("monster_" + objid);
            m_SelfObj  = Instantiate(obj_prefab, new Vector3(-75.26f, -0.561f, 14.91f), new Quaternion(0, 90, 0, 0)) as GameObject;
            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 (objid == 10070)
            {
                cur_model.FindChild("body/FX_idle").gameObject.SetActive(false);
            }
            cur_model.localScale = new Vector3(size, size, size);
            cur_model.gameObject.AddComponent <Summon_Base_Event>();
            if (cur_model != null)
            {
                var animm = cur_model.GetComponent <Animator>();
                if (animm != null)
                {
                    animm.Rebind();
                }
                animm.cullingMode = AnimatorCullingMode.AlwaysAnimate;
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        private IEnumerator LoadScene()
        {
            if (fg != null)
            {
                fg.SetActive(true);
            }

            GAMEAPI.LoadAsset_Async("select_role_scene.assetbundle", "select_role_scene");
            while (GAMEAPI.Res_Async_Loaded() == false)
            {
                yield return(new WaitForSeconds(0.1f));
            }

            async = SceneManager.LoadSceneAsync("select_role_scene");
            yield return(async);

            if (MediaClient.instance._curMusicUrl != "audio_map_music_0")
            {
                MediaClient.instance.PlayMusicUrl("audio_map_music_0", null, true);

                Application.DontDestroyOnLoad(GameObject.Find("Audio"));
            }

            GAMEAPI.Unload_Asset("select_role_scene.assetbundle");

            if (fg != null)
            {
                fg.SetActive(false);
            }
        }
        public void initm_minimap_camara()
        {
            camGo = GameObject.Find("camera_camera_minimap(Clone)");
            if (m_minimap_camara == null)
            {
                GameObject temogo = GAMEAPI.ABUI_LoadPrefab("camera_camera_minimap");
                camGo = GameObject.Instantiate(temogo) as GameObject;
                Application.DontDestroyOnLoad(camGo);
                SceneCamera.refreshMiniMapCanvas();  //临时
            }
            m_minimap_camara = camGo.transform.FindChild("camera").GetComponent <Camera>();

            RectTransform trans = GameObject.Find("camcon").GetComponent <RectTransform>();

            Vector3 pos0 = trans.position;

            camGo.transform.SetParent(this.transform);
            camGo.transform.SetAsFirstSibling();
            float   w    = (Baselayer.uiWidth + trans.anchoredPosition.x - trans.rect.width) / Baselayer.uiWidth;
            float   h    = (Baselayer.uiHeight + trans.anchoredPosition.y - trans.rect.height) / Baselayer.uiHeight;
            Vector3 pos1 = InterfaceMgr.ui_Camera_cam.WorldToScreenPoint(pos0);

            m_minimap_camara.rect = new UnityEngine.Rect(w, h, trans.sizeDelta.x / Baselayer.uiWidth, trans.sizeDelta.y / Baselayer.uiHeight);

            refreshMiniCam();
        }
Exemplo n.º 7
0
        //图片
        void GetImage(int id, Image image)
        {
            string file = "icon_achievement_title_ui_" + id;

            image.sprite = GAMEAPI.ABUI_LoadSprite(file);
            image.SetNativeSize();
        }
Exemplo n.º 8
0
        public void createSence()
        {
            GameObject obj_prefab;

            obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_scene_ui_camera");
            scene_Camera = GameObject.Instantiate(obj_prefab) as GameObject;

            scene_Camera.transform.FindChild("Main_Avatar_Camera").GetComponent <Camera>().orthographicSize = 0.86f;
            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层
                }
            }
            scene_Obj.transform.FindChild("scene_ta").localPosition = new Vector3(-1.08f, 0.39f, -0.166f);
            scene_Obj.transform.FindChild("scene_ta").localScale    = new Vector3(0.6f, 0.6f, 0.6f);
            scene_Obj.transform.FindChild("sc_tz_lg").localPosition = new Vector3(-1.08f, 0.39f, -0.166f);
            scene_Obj.transform.FindChild("sc_tz_lg").localScale    = new Vector3(1, 1, 1);
            scene_Obj.transform.FindChild("fx_sc").localPosition    = new Vector3(-1.08f, 0.461f, -0.32f);
            scene_Obj.transform.FindChild("fx_sc").localScale       = new Vector3(0.6f, 0.6f, 0.6f);
        }
Exemplo n.º 9
0
        private void RefreshMailList()
        {
            SortMailList();

            GameObject prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_mail_title");

            GameObject listCon = transform.FindChild("left/scroll_view/contain").gameObject;

            listCon.transform.DetachChildren();
            for (int i = 0; i < sortedList.Count; i++)
            {
                uint       id = sortedList[i].id;
                GameObject go = null;
                title_gos.TryGetValue(id, out go);
                if (go == null)
                {
                    go            = GameObject.Instantiate(prefab) as GameObject;
                    title_gos[id] = go;

                    BaseButton btn = new BaseButton(go.transform);
                    btn.onClick = OnMailTitleClick;
                }
                go.transform.localScale = new Vector3(1, 1, 1);
                go.name = id.ToString();
                go.transform.SetParent(listCon.transform, false);
                RefreshMailTitle(id);
            }
            RefreshMailCnt();
        }
        void setGetAvator(int tpid)
        {
            if (getSummonWin().avatorobj != null)
            {
                getSummonWin().avatorobj.SetActive(false);
            }
            if (getSummonWin().avator_look != null)
            {
                GameObject.Destroy(getSummonWin().avator_look);
            }
            SXML       xml        = sumXml.GetNode("callbeast", "id==" + tpid);
            int        mid        = xml.getInt("mid");
            SXML       mxml       = XMLMgr.instance.GetSXML("monsters.monsters", "id==" + mid);
            int        objid      = mxml.getInt("obj");
            GameObject obj_prefab = GAMEAPI.ABModel_LoadNow_GameObject("monster_" + objid);

            getSummonWin().avator_look = GameObject.Instantiate(obj_prefab, new Vector3(-153.81f, 0.778f, 0f), Quaternion.identity) as GameObject;
            foreach (Transform tran in getSummonWin().avator_look.GetComponentsInChildren <Transform>())
            {
                tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
            }
            Transform cur_model = getSummonWin().avator_look.transform.FindChild("model");
            var       animm     = cur_model.GetComponent <Animator>();

            animm.cullingMode = AnimatorCullingMode.AlwaysAnimate;
            cur_model.gameObject.AddComponent <Summon_Base_Event>();
            cur_model.Rotate(Vector3.up, 270 - mxml.getInt("smshow_face"));
            float scale = mxml.getFloat("smshow_scale");

            if (scale < 0)
            {
                scale = 0.5f;
            }
            cur_model.transform.localScale = new Vector3(scale, scale, scale);
        }
Exemplo n.º 11
0
 public void show(INameObj dropObj, string name)
 {
     if (!dItem.ContainsKey(dropObj))
     {
         DropItemUI item;
         if (lPool.Count == 0)
         {
             GameObject temp = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_dropItemUI");
             GameObject go   = GameObject.Instantiate(temp) as GameObject;
             go.transform.SetParent(dropItemUILayer, false);
             item = new DropItemUI(go.transform);
         }
         else
         {
             item          = lPool[0];
             item.visiable = true;
             lPool.RemoveAt(0);
         }
         item.refresh(dropObj, name);
         lItem.Add(item);
         dItem[dropObj] = item;
         if (dropObj is DropItem)
         {
             item.refresShowName(showTime);
         }
     }
     else
     {
         dItem[dropObj].refresh(dropObj, name);
         dItem[dropObj].refresShowName(showTime);
     }
 }
Exemplo n.º 12
0
        public override void onShowed()
        {
            ResetLvLProxy.getInstance().addEventListener(ResetLvLProxy.EVENT_RESETLVL, onResetLvLSucc);

            lab_fightingCapacityValue.text = PlayerModel.getInstance().combpt.ToString();
            lab_level.text = ContMgr.getCont("a3_resetlvl_lv", new List <string>()
            {
                PlayerModel.getInstance().up_lvl.ToString(), PlayerModel.getInstance().lvl.ToString()
            });
            profession = PlayerModel.getInstance().profession;
            zhuan      = PlayerModel.getInstance().up_lvl;
            uint lvl        = PlayerModel.getInstance().lvl;
            uint exp        = ResetLvLModel.getInstance().getExpByResetLvL(profession, zhuan, lvl);
            uint currentExp = PlayerModel.getInstance().exp > ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan)?ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan):PlayerModel.getInstance().exp;

            lab_experience.text       = string.Format("{0}/{1}", currentExp, ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan));// 玩家经验/当前转等级经验
            sliderExperience.maxValue = ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan);
            sliderExperience.value    = PlayerModel.getInstance().exp;
            statusPointStr            = ResetLvLModel.getInstance().getAwardAttrPointByZhuan(profession, zhuan).ToString();
            createNum(uint.Parse(statusPointStr));
            lab_waradEquip.text     = getAwardDescStr(zhuan);
            lab_consumeGolds.text   = ResetLvLModel.getInstance().getNeedGoldsByZhuan(profession, zhuan).ToString();
            lab_consumeGolds.color  = getGoldsColor();
            txt_currentZhuan.sprite = GAMEAPI.ABUI_LoadSprite("icon_resetlvl_" + zhuan);       // zhuan.ToString()+"转";
            txt_targetZhuan.sprite  = GAMEAPI.ABUI_LoadSprite("icon_resetlvl_" + (zhuan + 1)); //(zhuan + 1).ToString() + "转";
            nextZhuanLvl.text       = ContMgr.getCont("a3_resetlvl_lv", new List <string>()
            {
                (zhuan + 1).ToString(), ResetLvLModel.getInstance().getNextLvLByZhuan(profession, zhuan, currentExp).ToString()
            });
            createAvatar();
            btn_description.addEvent();
            btn_reincarnation.addEvent();
            btn_close.addEvent();
            touchBG.addEvent();
        }
Exemplo n.º 13
0
        private void SetRideData(GameObject go, RideConfigVo vo)
        {
            Image icon = go.transform.FindChild("Image/icon").GetComponent <Image>();

            var image_Lock = go.transform.FindChild("Image/Image_Lock").gameObject;

            icon.sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + vo.icon);

            BaseButton btn = new BaseButton(go.transform.FindChild("Image"));

            btn.onClick = ItemBtnHandle;

            _btnLst.Add(btn);

            icon.transform.parent.gameObject.name = vo.id.ToString();

            go.SetActive(true);

            go.transform.SetParent(_parentitemGo.transform);

            go.transform.localScale = new Vector3(1, 1, 1);

            var rideInfo = A3_RideModel.getInstance().GetRideInfo();

            var mapping = rideInfo.ridedressMapiping;

            image_Lock.SetActive(!mapping.ContainsKey((uint)vo.id));

            if (_goMapping != null)
            {
                _goMapping[vo.id] = go;
            }
        }
Exemplo n.º 14
0
        public GameObject createMoneyIcon(string type, float scale = 1.0f, int num = -1)
        {
            string     file       = "icon_comm_" + type;
            string     borderfile = "icon_itemborder_b039_02";
            GameObject iconPrefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_iconimage");
            GameObject root       = GameObject.Instantiate(iconPrefab) as GameObject;
            Image      icon       = root.transform.FindChild("icon").GetComponent <Image>();

            icon.sprite = GAMEAPI.ABUI_LoadSprite(file);
            Image iconborder = root.transform.FindChild("iconbor").GetComponent <Image>();

            iconborder.sprite = GAMEAPI.ABUI_LoadSprite(borderfile);
            Text numText = root.transform.FindChild("num").GetComponent <Text>();

            if (num != -1)
            {
                numText.text = num.ToString();
                numText.gameObject.SetActive(true);
            }
            else
            {
                numText.gameObject.SetActive(false);
            }
            root.transform.GetComponent <Button>().enabled = false;
            root.transform.localScale = new Vector3(scale, scale, 1.0f);
            return(root);
        }
Exemplo n.º 15
0
    public void onSK(string param)
    {//技能蓄力时间
        string[] arr = param.Split(',');
        if (arr.Length < 5)
        {
            return;
        }
        m_monRole.FreezeAni(float.Parse(arr[0]), float.Parse(arr[1]));
        int type = int.Parse(arr[2]);

        GameObject obj_prefab = GAMEAPI.ABFight_LoadPrefab("FX_monsterSFX_com_yujing_" + type.ToString());

        if (obj_prefab != null)
        {
            GameObject fx_inst = GameObject.Instantiate(obj_prefab, transform.position, transform.rotation) as GameObject;
            float      scale   = float.Parse(arr[4]);
            fx_inst.transform.localScale = new Vector3(scale, scale, scale);
            fx_inst.transform.SetParent(U3DAPI.FX_POOL_TF, false);
            GameObject.Destroy(fx_inst, float.Parse(arr[0]));
        }

        int fx_id = int.Parse(arr[3]);

        if (fx_id > 0)
        {
            GameObject fx_prefab = GAMEAPI.ABFight_LoadPrefab("FX_monsterSFX_com_FX_monster_" + fx_id.ToString());
            GameObject fx_inst   = GameObject.Instantiate(fx_prefab, transform.position, transform.rotation) as GameObject;
            fx_inst.transform.SetParent(U3DAPI.FX_POOL_TF, false);
            GameObject.Destroy(fx_inst, float.Parse(arr[0]));
        }
    }
Exemplo n.º 16
0
        void Refresh(GameEvent e = null)
        {
            Variant v = e.data;

            if (v["grade"] <= 0)
            {
                return;
            }
            top_saiji.text = ContMgr.getCont("di") + v["tour_time"] + ContMgr.getCont("saiji");
            SXML Xml = XMLMgr.instance.GetSXML("jjc.reward", "grade==" + v["grade"]);

            duanwei.text = ContMgr.getCont("duanwei") + Xml.getString("name");
            if (v["grade"] < 10)
            {
                rank.sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_00" + v["grade"]);
            }
            else
            {
                rank.sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_0" + v["grade"]);
            }

            setGift();
            refCount();
            refStar(v["score"]);
            reffind();
        }
Exemplo n.º 17
0
        public void show(INameObj avatar, string msg)
        {
            if (!dItem.ContainsKey(avatar))
            {
                PlayerChatItem item;
                if (lPool.Count == 0)
                {
                    GameObject temp = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_chat_user");
                    GameObject go   = GameObject.Instantiate(temp) as GameObject;
                    go.transform.SetParent(playerChatLayer, false);
                    item = new PlayerChatItem(go.transform);
                }
                else
                {
                    item          = lPool[0];
                    item.visiable = true;
                    lPool.RemoveAt(0);
                }

                item.refresh(avatar, msg);
                lItem.Add(item);
                dItem[avatar] = item;

                if (avatar is ProfessionRole)
                {
                    item.refresShowChat(4);
                }
            }
            else
            {
                dItem[avatar].refresh(avatar, msg);
                dItem[avatar].refresShowChat(3);
            }
        }
Exemplo n.º 18
0
        void createAvatar()
        {
            //Vector3 pos = new Vector3(-152.89f, 1.652f, -1.472f);
            //Vector3 roa = new Vector3(-71.72f, 90, 0);
            Vector3 pos = Vector3.zero;
            Vector3 roa = Vector3.zero;

            for (int i = 1; i < 10; i++)
            {
                string     position = XMLMgr.instance.GetSXML("holicware.holic", "id==" + i).getString("pos");
                string     rotation = XMLMgr.instance.GetSXML("holicware.holic", "id==" + i).getString("roa");
                string[]   s_pos    = position.Split(',');
                string[]   s_rot    = rotation.Split(',');
                GameObject avater   = GAMEAPI.ABModel_LoadNow_GameObject("Item_sq_0" + i);
                avater.SetActive(false);
                pos = new Vector3(float.Parse(s_pos[0]), float.Parse(s_pos[1]), float.Parse(s_pos[2]));
                roa = new Vector3(float.Parse(s_rot[0]), float.Parse(s_rot[1]), float.Parse(s_rot[2]));
                //switch (i)
                //{
                //    case 1:
                //        break;
                //    case 2:
                //        break;
                //    case 3:
                //        pos = new Vector3(-152.681f, 1.6359f, 0.51f);
                //        roa = new Vector3(-107.394f, 270, -90);
                //        break;
                //    case 4:
                //        pos = new Vector3(-152.91f, 1.6f, -1.3f);
                //        roa = new Vector3(-90.3f, -6.5f, 85.8f);
                //        break;
                //    case 5:
                //        pos = new Vector3(-152.8f, 1.56f, -0.4f);
                //        roa = new Vector3(-80.45f, 90, 0);
                //        break;
                //    case 6:
                //        pos = new Vector3(-152.78f, 1.4f, 0.9f);
                //        roa = new Vector3(-71.242f, 90, -90);
                //        break;
                //    case 7:
                //        pos = new Vector3(-153f, 1.652f, -1.4f);
                //        roa = new Vector3(90f, -90, 0);
                //        break;
                //    case 8:
                //        pos = new Vector3(-152.74f, 1.45f, 0.31f);
                //        break;
                //    case 9:
                //        pos = new Vector3(-152.89f, 1.45f, 1.1f);
                //        break;
                //}

                avatars_old_position.Add(pos);
                GameObject avater_prefab = GameObject.Instantiate(avater, pos, Quaternion.Euler(roa)) as GameObject;
                lst_avatars.Add(avater_prefab);
                avater_prefab.layer = EnumLayer.LM_FX;
            }
            GameObject camera = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_roleinfo_ui_camera");

            camera_prefab = GameObject.Instantiate(camera) as GameObject;
        }
Exemplo n.º 19
0
        void Refresh(GameEvent gg = null)
        {
            //==1
            string file = "icon_achievement_title_ui_" + a3_RankModel.now_id;

            nowtitle.sprite = GAMEAPI.ABUI_LoadSprite(file);
            nowtitle.SetNativeSize();

            //==2
            SetExpValue();

            //==3
            SetShowonText();

            //==4
            nowshow = Mathf.Max(1, a3_RankModel.now_id);
            if (a3_RankModel.now_id == 0)
            {
                SetFocus(1);
            }
            else
            {
                SetFocus(a3_RankModel.now_id);
            }

            //==5
            SetDark();
        }
Exemplo n.º 20
0
        public override void onShowed()
        {
            a3_BagModel bag = a3_BagModel.getInstance();

            itmdata = bag.getItemDataById(itm_tpid);

            Image icon = getComponentByPath <Image>("iconimage/icon");

            icon.sprite = GAMEAPI.ABUI_LoadSprite(itmdata.file);

            Image iconborder = getComponentByPath <Image>("iconimage/iconborder");

            iconborder.sprite = GAMEAPI.ABUI_LoadSprite(itmdata.borderfile);

            getComponentByPath <Text>("nimg/name").text = itmdata.item_name;
            getComponentByPath <Text>("desc").text      = itmdata.desc;

            slider.minValue = min_num;
            slider.maxValue = max_num;

            uint num = (uint)slider.value;

            getComponentByPath <Text>("num").text = num.ToString();

            long money = num * itmdata.on_sale;

            getComponentByPath <Text>("money").text = money.ToString();
        }
        override public void init()
        {
            mInstance = this;
            inText();
            m_ItemCurrentTeamInfoDic = new Dictionary <uint, ItemCurrentTeamInfo>();
            friend                = getTransformByPath("contant/friend/friend");
            root                  = this.transform;
            mMaterialGrey         = U3DAPI.U3DResLoad <Material>("uifx/uiGray");
            mContant              = transform.FindChild("contant");
            itemCurrentInfoPrefab = transform.FindChild("temp/itemMemberInfo");

            leaveOnLineSprite = GAMEAPI.ABUI_LoadSprite("icon_comm_icon_notice");//TODO:临时离线图片资源替代
            deadSprite        = GAMEAPI.ABUI_LoadSprite("icon_job_icon_boss");
            new BaseButton(getTransformByPath("contant/friend/friend/go")).onClick = (GameObject go) =>
            {
                if (GRMap.instance.m_nCurMapID >= 3333)
                {
                    flytxt.instance.fly(ContMgr.getCont("a3_currentTeamInfo_cant_invite_inFb"));
                    return;
                }
                ArrayList array = new ArrayList();
                array.Add(2);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SHEJIAO, array);
            };
        }
Exemplo n.º 22
0
        public void refreshVipLv(uint viplv)
        {
            if (viplv == 0)
            {
                if (vipIcon.gameObject.active)
                {
                    vipIcon.gameObject.SetActive(false);
                }
            }
            else
            {
                if (curName == null)
                {
                    return;
                }

                vipIcon.gameObject.SetActive(true);
                vipIcon.sprite = GAMEAPI.ABUI_LoadSprite("icon_vip_" + (viplv));
                vipIcon.transform.SetParent(curName.transform, false);
                Vector2 vec = rectVipIcon.anchoredPosition;

                Vector2 size = rectVipIcon.sizeDelta;
                //if (viplv > 9)
                //    size.x = wVip * 1.3f;
                //else
                //    size.x = wVip;
                //rectVipIcon.sizeDelta = size;
            }
        }
Exemplo n.º 23
0
        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);
        }
Exemplo n.º 24
0
        public void refreshInfo()
        {
            if (open_id < 0)
            {
                return;
            }

            if (!GameRoomMgr.getInstance().checkCityRoom())
            {
                return;
            }

            this.gameObject.SetActive(true);

            ig_icon  = transform.FindChild("mover/icon").GetComponent <Image>();
            ig_icon1 = transform.FindChild("icon").GetComponent <Image>();
            string file = "icon_skill_" + open_id;

            ig_icon.sprite  = GAMEAPI.ABUI_LoadSprite(file);
            ig_icon1.sprite = GAMEAPI.ABUI_LoadSprite(file);
            ig_icon.gameObject.SetActive(true);

            CancelInvoke("timeGo");
            Invoke("timeGo", 3.3f);

            runAni(x, y);

            if (a3_expbar.instance != null)
            {
                a3_expbar.instance.On_Btn_Up();
            }

            open_id = -1;
        }
Exemplo n.º 25
0
        public void openzhanji(Dictionary <int, info_teamPlayer> data)
        {
            Transform Con = this.transform.FindChild("scroll_rect/contain");

            if (Con.childCount > 0)
            {
                for (int i = 0; i < Con.childCount; i++)
                {
                    Destroy(Con.GetChild(i).gameObject);
                }
            }
            GameObject one = this.transform.FindChild("scroll_rect/item_zhanli").gameObject;

            foreach (int id in data.Keys)
            {
                GameObject clon = Instantiate(one) as GameObject;
                clon.SetActive(true);
                clon.transform.SetParent(Con, false);
                clon.transform.FindChild("carricon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_hero_" + data[id].carr);
                clon.transform.FindChild("name").GetComponent <Text>().text        = data[id].name;
                clon.transform.FindChild("lvl").GetComponent <Text>().text         = ContMgr.getCont("worldmap_lv", new List <string> {
                    data[id].zhuan.ToString(), data[id].lvl.ToString()
                });
                clon.transform.FindChild("zhanji").GetComponent <Text>().text   = data[id].kill_cnt + "/" + data[id].die_cnt + "/" + data[id].assists_cnt;
                clon.transform.FindChild("dmg").GetComponent <Text>().text      = data[id].dmg.ToString();
                clon.transform.FindChild("getpiont").GetComponent <Text>().text = data[id].ach_point.ToString();
            }
        }
Exemplo n.º 26
0
        ///////////场景
        void showPKSence()
        {
            if (GRMap.GAME_CAMERA != null)
            {
                GRMap.GAME_CAMERA.SetActive(false);
            }
            if (secve_obj == null)
            {
                GameObject obj_prefab;
                obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_pk_camera");
                sence_camera = GameObject.Instantiate(obj_prefab) as GameObject;
                obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_pk_sence");
                secve_obj    = GameObject.Instantiate(obj_prefab) as GameObject;

                foreach (Transform tran in secve_obj.GetComponentsInChildren <Transform>())
                {
                    if (tran.gameObject.name == "scene_ta")
                    {
                        tran.gameObject.layer = EnumLayer.LM_ROLE_INVISIBLE;
                    }
                    else
                    {
                        tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
                    }
                }
            }
        }
Exemplo n.º 27
0
 void createAvatar()
 {
     if (scene_Obj == null)
     {
         GameObject obj_prefab;
         obj_prefab   = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_scene_ui_camera");
         scene_Camera = GameObject.Instantiate(obj_prefab) as GameObject;
         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层
             }
         }
         scene_Obj.transform.FindChild("scene_ta").localPosition = new Vector3(-2.2f, -0.112f, 0.166f);
         scene_Obj.transform.FindChild("sc_tz_lg").localPosition = new Vector3(-2.2f, -0.112f, 0.166f);
         scene_Obj.transform.FindChild("fx_sc").localPosition    = new Vector3(-2.21f, 0f, 0f);
     }
 }
Exemplo n.º 28
0
        /*身上穿的刷新*/
        public void RefreshSelfObj()
        {
            int id  = A3_FashionShowModel.getInstance().nowfs[0];
            int id1 = A3_FashionShowModel.getInstance().nowfs[1];

            if (id != 0)
            {
                xiongjia_obj.transform.FindChild("icon").gameObject.SetActive(true);
                string file = "icon_item_" + (uint)id;

                Image icon = xiongjia_obj.transform.FindChild("icon").GetComponent <Image>();
                icon.sprite = GAMEAPI.ABUI_LoadSprite(file);
            }
            else
            {
                xiongjia_obj.transform.FindChild("icon").gameObject.SetActive(false);
            }
            if (id1 != 0)
            {
                wuqi_obj.transform.FindChild("icon").gameObject.SetActive(true);
                string file = "icon_item_" + (uint)id1;
                Image  icon = wuqi_obj.transform.FindChild("icon").GetComponent <Image>();
                icon.sprite = GAMEAPI.ABUI_LoadSprite(file);
            }
            else
            {
                wuqi_obj.transform.FindChild("icon").gameObject.SetActive(false);
            }
            /* */
            if (A3_FashionShowModel.getInstance().dress_show)
            {
                Show_this_Fashion();
            }
        }
Exemplo n.º 29
0
        private void RefreshAvatar()
        {
            RawImage petAvatar = getComponentByPath <RawImage>("avatar");

            if (petTexture == null)
            {
                petTexture = new RenderTexture(380, 420, 16);
            }
            if (avatarCamera == null)
            {
                GameObject prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_avatar_ui_camera");
                avatarCamera = Object.Instantiate(prefab) as GameObject;
            }
            Camera camera = avatarCamera.GetComponentInChildren <Camera>();

            camera.targetTexture = petTexture;
            petAvatar.texture    = petTexture;

            string     avapath   = petmodel.GetPetAvatar((int)petmodel.Tpid, 0);
            GameObject petPrefab = GAMEAPI.ABModel_LoadNow_GameObject("profession_" + avapath);

            if (pet != null)
            {
                Object.Destroy(pet);
            }
            pet = GameObject.Instantiate(petPrefab, new Vector3(-128f, 0f, 0f), Quaternion.identity) as GameObject;
            pet.transform.localScale = Vector3.one;
            pet.transform.Rotate(new Vector3(20, 40, -30));
            foreach (Transform tran in pet.GetComponentsInChildren <Transform>())
            {
                tran.gameObject.layer = EnumLayer.LM_FX;
            }
        }
Exemplo n.º 30
0
        private void doChangeMap()
        {
            lgSelfPlayer.instance.doSkillPreload();
            GameCameraMgr.getInstance().clearCurCamera();
            //m_map.dispose();
            //m_map = null;
            grmap_loading = true;

            if (changeMapData != null)
            {
                debug.Log(changeMapData.dump());
            }

            Cache_MapChangeData = changeMapData;
            string an = Cache_MapChangeData["conf"]["name"];

            GAMEAPI.LoadAsset_Async(an + ".assetbundle", an);
            //Debug.Log("开始加载场景,准备进入游戏---------------------------------------------------------");
            //setChangeMapData(changeMapData["mapid"]._uint, changeMapData["conf"], changeMapData["localConf"]);

            //addLinkEffs(changeMapData["tmpLinks"]);
            //addLinkEffs(changeMapData["conf"]["l"]);

            //m_ctrl.dispatchEvent(GameEvent.Create(GAME_EVENT.MAP_LOAD_READY, null, null));
            changeMapData = null;
        }