コード例 #1
0
    private void UpdatetopInfo(SkillCellUI skillcell)
    {
        if (skillcell == null || skillcell.skillInst == null)
        {
            return;
        }
        messageObj.SetActive(true);
        kjBtn.gameObject.SetActive(true);
        forgetBtn.gameObject.SetActive(true);
        learnBtn.gameObject.SetActive(true);
        _slectSkill = skillcell;
        SkillData sData = SkillData.GetData((int)skillcell.skillInst.skillID_, (int)skillcell.skillInst.skillLevel_);

        topinfo.gameObject.SetActive(true);
        UpdateDesc(sData);
        skillLevelLab.text = skillcell.skillInst.skillLevel_.ToString();
        skillNameLab.text  = sData._Name;
        mofaLabel.text     = sData._Cost_mana.ToString();
        float num;

        if (sData._Proficiency == 0)
        {
            num         = 1;
            expLab.text = "1/1";
        }
        else
        {
            num         = ((float)skillcell.skillInst.skillExp_ / (float)sData._Proficiency);
            expLab.text = skillcell.skillInst.skillExp_ + "/" + sData._Proficiency;
        }
        //progressBar.baseClipRegion = new Vector4(progressBar.baseClipRegion.x,progressBar.baseClipRegion.y,num,progressBar.baseClipRegion.w);
        expbar.value = num;
    }
コード例 #2
0
 void ClearSkill()
 {
     if (skillCache != null)
     {
         GameObject.Destroy(skillCache.gameObject);
         skillCache = null;
     }
 }
コード例 #3
0
 void OnClicklookSkill(ButtonScript obj, object args, int param1, int param2)
 {
     skillObj.SetActive(true);
     for (int i = 0; i < _bdata.skills_.Count; i++)
     {
         //UITexture tex = items[i].GetComponentInChildren<UITexture>();
         UISprite    sp    = items[i].GetComponent <UISprite>();
         SkillData   sd    = SkillData.GetMinxiLevelData((int)_bdata.skills_[i].skillID_);
         SkillCellUI scell = UIManager.Instance.AddSkillCellUI(sp, sd);
         scell.showTips = true;
         //HeadIconLoader.Instance.LoadIcon (SkillData.GetMinxiLevelData((int)_bdata.skills_[i].skillID_)._ResIconName, tex);
     }
 }
コード例 #4
0
    private void UpdateSKillInfoLevel(string group)
    {
        _slectSkill = null;
        List <COM_Skill> skills = GamePlayer.Instance.SkillInsts;

        if (skillCellList.Count > 0)
        {
            if (skillCellList[0].GetComponent <SkillCellUI>().data._Name == group)
            {
                return;
            }
        }

        for (int k = 0; k < skillCellList.Count; k++)
        {
            skillCellList[k].transform.parent = null;
            skillCellList[k].gameObject.SetActive(false);
            skillCellPoolList.Add(skillCellList[k]);
        }
        skillCellList.Clear();

        for (int i = 0; i < skills.Count; ++i)
        {
            SkillData sData = SkillData.GetData((int)skills[i].skillID_, (int)skills[i].skillLevel_);
            if (sData._Name == group)
            {
                GameObject obj;
                if (skillCellPoolList.Count > 0)
                {
                    obj = skillCellPoolList[0];
                    skillCellPoolList.Remove(skillCellPoolList[0]);
                }
                else
                {
                    obj = Object.Instantiate(skillLvelCell.gameObject) as GameObject;
                }
                SkillCellUI sCell = obj.GetComponent <SkillCellUI>();
                sCell.data            = sData;
                sCell.skillInst       = skills[i];
                sCell.SkillName.text  = sData._Name;
                sCell.SkillLevel.text = sData._Level.ToString();
                obj.transform.Find("MP").GetComponent <UILabel>().text = "  " + sData._Cost_mana.ToString() + "MP";
                UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnClicKindSkill, 0, 0);
                obj.transform.parent = skillinfoGrid.transform;
                obj.SetActive(true);
                skillCellList.Add(obj);
                obj.transform.localScale = Vector3.one;
            }
        }
        skillinfoGrid.Reposition();
    }
コード例 #5
0
    void UpdateSkill()
    {
        if (GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx] == null ||
            GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx].suitSkill == null)
        {
            ClearSkill();
            ClearEffect();
            return;
        }

        SkillData sData = SkillData.GetData((int)GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx].suitSkill.skillID_, (int)GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx].suitSkill.skillLevel_);

        skillCache          = UIManager.Instance.AddSkillCellUI(skillSp, sData);
        skillCache.showTips = true;

        ShowEffect(GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx].isHighestSuitSkill);
    }
コード例 #6
0
    private void OnClickMainSkill(ButtonScript obj, object args, int param1, int param2)
    {
        SkillCellUI lCell = obj.GetComponent <SkillCellUI>();

        if (curCell != null)
        {
            curCell.back.gameObject.SetActive(false);
            curCell.buleBack0.gameObject.SetActive(false);
            //curCell.buleBack1.gameObject.SetActive (false);
        }

        curCell = lCell;
        lCell.back.gameObject.SetActive(true);
        curCell.buleBack0.gameObject.SetActive(true);
        //curCell.buleBack1.gameObject.SetActive (true);
        //UpdateSKillInfoLevel (obj.name);
        UpdatetopInfo(obj.GetComponent <SkillCellUI> ());
    }
コード例 #7
0
    void OnSkillExpEnevt(int id)
    {
        curCell.skillInst = GamePlayer.Instance.GetSkillById((int)curCell.skillInst.skillID_);
        UpdatetopInfo(curCell);
        for (int i = 0; i < _mainSkillList.Count; i++)
        {
            SkillCellUI cellUI = _mainSkillList[i].GetComponent <SkillCellUI> ();
            cellUI.skillInst       = GamePlayer.Instance.GetSkillById((int)cellUI.skillInst.skillID_);
            cellUI.SkillLevel.text = cellUI.skillInst.skillLevel_.ToString();
            SkillData sData = SkillData.GetData((int)cellUI.skillInst.skillID_, (int)cellUI.skillInst.skillLevel_);

            cellUI.SkillName.text = sData._Name;
            ////if( skillInst.skillID_==curCell.skillInst.skillID_ )
            //{
            //SkillCellUI skcell = _mainSkillList[i].GetComponent<SkillCellUI> ();
            //skcell.SkillLevel.text = curCell.skillInst.skillLevel_.ToString();
            //break;
            //}//
        }
    }
コード例 #8
0
    public SkillCellUI AddSkillCellUI(UISprite parent, SkillData data, float offsetX = 0f, float offsetY = 0f, float scale = 1f)
    {
        SkillCellUI[] cells = parent.gameObject.GetComponentsInChildren <SkillCellUI>(true);
        SkillCellUI   cell  = null;

        if (cells == null || cells.Length == 0)
        {
            cell = InstantiateSkillCellUIObj();
            if (data._Id != 0)
            {
                cell.cellPane.transform.parent        = parent.gameObject.transform;
                cell.cellPane.depth                   = parent.depth + 1;
                cell.cellPane.transform.localPosition = new Vector2(offsetX, offsetY);
                cell.cellPane.transform.localScale    = Vector3.one;
            }
        }
        else
        {
            cell = cells[0];
        }
        cell.data  = data;
        cell.scale = scale;
        return(cell);
    }
コード例 #9
0
    void Start()
    {
        iconName_ = new List <string>();
        GlobalValue.Get(Constant.C_SkillExpItem, out itemid);
        kjBtn.gameObject.SetActive(false);
        messageObj.SetActive(false);
        UIManager.SetButtonEventHandler(kjBtn.gameObject, EnumButtonEvent.OnClick, OnkjBtn, 0, 0);
        UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClose, 0, 0);
        UIManager.SetButtonEventHandler(forgetBtn.gameObject, EnumButtonEvent.OnClick, OnForgetBtn, 0, 0);
        UIManager.SetButtonEventHandler(learnBtn.gameObject, EnumButtonEvent.OnClick, OnLearnBtn, 0, 0);
        UIManager.SetButtonEventHandler(wenhaoBtn.gameObject, EnumButtonEvent.OnClick, OnWenhaoBtn, 0, 0);

        UIManager.SetButtonEventHandler(battleBtn.gameObject, EnumButtonEvent.OnClick, OnBattleBtn, 0, 0);
        UIManager.SetButtonEventHandler(liftBtn.gameObject, EnumButtonEvent.OnClick, OnLiftBtn, 0, 0);


        GamePlayer.Instance.SkillExpEnvet += new RequestEventHandler <int> (OnSkillExpEnevt);


        List <COM_Skill> skills = GetMianSkillList();

        skillNumLab.text = skills.Count + "/10";
        expLab.text      = "";
        _profType        = GamePlayer.Instance.GetIprop(PropertyType.PT_Profession);
        _profLevel       = GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel);
        _profData        = Profession.get((JobType)_profType, _profLevel);
        zhiyeLab.text    = _profData.jobName_;
        OpenPanelAnimator.PlayOpenAnimation(this.panel, () => {
            for (int i = 0; i < skills.Count; i++)
            {
                GameObject obj = Object.Instantiate(skillCell.gameObject) as GameObject;
                obj.SetActive(true);
                SkillData sData       = SkillData.GetData((int)skills[i].skillID_, (int)skills[i].skillLevel_);
                SkillCellUI sCell     = obj.GetComponent <SkillCellUI>();
                obj.name              = sData._Name;
                sCell.SkillName.text  = sData._Name;
                sCell.SkillLevel.text = sData._Level.ToString();
                HeadIconLoader.Instance.LoadIcon(sData._ResIconName, obj.GetComponent <SkillCellUI>().SkillIcon);
                if (!iconName_.Contains(sData._ResIconName))
                {
                    iconName_.Add(sData._ResIconName);
                }
                sCell.data      = sData;
                sCell.skillInst = skills[i];

                if (_profData.isProudSkill(_profType, (int)skills[i].skillID_, _profLevel))
                {
                    obj.transform.FindChild("deyi").GetComponent <UISprite>().gameObject.SetActive(true);
                }

                UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnClickMainSkill, 0, 0);
                skillGrid.AddChild(obj.transform);
                _mainSkillList.Add(obj);
                obj.transform.localScale = Vector3.one;
            }

            expbar.gameObject.SetActive(true);

            forgetBtn.gameObject.SetActive(false);
            learnBtn.gameObject.SetActive(false);
            curCell = null;
            if (_mainSkillList.Count > 0)
            {
                //	UpdateSKillInfoLevel (_mainSkillList[0].name);
                curCell = _mainSkillList[0].GetComponent <SkillCellUI> ();
                curCell.back.gameObject.SetActive(true);
                //curCell.buleBack0.gameObject.SetActive (true);
                //curCell.buleBack1.gameObject.SetActive (true);
                UpdatetopInfo(_mainSkillList[0].GetComponent <SkillCellUI> ());
            }

            if (skillType_ != 0)
            {
                liftBtn.isEnabled = false;
                skillObj.gameObject.SetActive(false);
                gatherObj.gameObject.SetActive(true);
                gatherObj.GetComponent <GatherUI> ().ShowMe(minType_, minId_);
            }
            else
            {
                battleBtn.isEnabled = false;
            }
            GamePlayer.Instance.forgetSkillEnvet += new RequestEventHandler <uint> (OnForgetEnvet);
        });
    }
コード例 #10
0
    void OnForgetEnvet(uint skId)
    {
        List <COM_Skill> skills = GetMianSkillList();

        skillNumLab.text = skills.Count + "/10";

        for (int i = 0; i < _mainSkillList.Count; ++i)
        {
            // if (_mainSkillList[i].GetComponent<SkillCellUI>().data.id_ == (int)skId)
            //{
            //UpdateSKillInfoLevel(x.GetComponent<SkillCellUI>().SkillTabData.name_);
            //_mainSkillList.Remove(_mainSkillList[i]);
            _mainSkillList[i].transform.parent = null;
            skillGrid.RemoveChild(_mainSkillList[i].transform);
            Destroy(_mainSkillList[i]);
            // break;
            // }
        }
        _mainSkillList.Clear();

        for (int k = 0; k < skillCellList.Count; k++)
        {
            skillCellList[k].transform.parent = null;
            skillCellList[k].gameObject.SetActive(false);
            skillCellPoolList.Add(skillCellList[k]);
        }
        skillCellList.Clear();

        skillGrid.Reposition();


        for (int i = 0; i < skills.Count; i++)
        {
            GameObject obj = Object.Instantiate(skillCell.gameObject) as GameObject;
            obj.SetActive(true);
            SkillData   sData = SkillData.GetData((int)skills[i].skillID_, (int)skills[i].skillLevel_);
            SkillCellUI sCell = obj.GetComponent <SkillCellUI>();
            obj.name              = sData._Name;
            sCell.SkillName.text  = sData._Name;
            sCell.SkillLevel.text = sData._Level.ToString();
            HeadIconLoader.Instance.LoadIcon(sData._ResIconName, obj.GetComponent <SkillCellUI>().SkillIcon);
            if (!iconName_.Contains(sData._ResIconName))
            {
                iconName_.Add(sData._ResIconName);
            }
            sCell.data      = sData;
            sCell.skillInst = skills[i];

            if (_profData.isProudSkill(_profType, (int)skills[i].skillID_, _profLevel))
            {
                obj.transform.FindChild("deyi").GetComponent <UISprite>().gameObject.SetActive(true);
            }

            UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnClickMainSkill, 0, 0);
            skillGrid.AddChild(obj.transform);
            _mainSkillList.Add(obj);
            obj.transform.localScale = Vector3.one;
        }



        skillDesc.text     = "";
        nextDescLabel.text = "";
        expLab.text        = "";
        forgetBtn.gameObject.SetActive(false);
        learnBtn.gameObject.SetActive(false);
        topinfo.gameObject.SetActive(false);
        kjBtn.gameObject.SetActive(false);
        messageObj.SetActive(false);
        PopText.Instance.Show(LanguageManager.instance.GetValue("yiwangskill"));

        curCell = null;
        if (_mainSkillList.Count > 0)
        {
            curCell = _mainSkillList[0].GetComponent <SkillCellUI> ();
            curCell.back.gameObject.SetActive(true);
            //curCell.buleBack0.gameObject.SetActive (true);
            //curCell.buleBack1.gameObject.SetActive (true);
            UpdatetopInfo(_mainSkillList[0].GetComponent <SkillCellUI> ());
        }
    }
コード例 #11
0
    public void SetData(PetActivityData data, int index)
    {
        if (itemPool_ == null)
        {
            itemPool_ = new List <GameObject>();
        }

        padata_ = data;
        BabyData baby = BabyData.GetData(data.monsterID_);

        if (baby != null)
        {
            name_.text = baby._Name;
            desc_.text = baby._Desc;
            GameManager.Instance.GetActorClone((ENTITY_ID)baby._AssetsID, (ENTITY_ID)0, EntityType.ET_Baby, (GameObject go, ParamData pData) =>
            {
                if (destroyed_)
                {
                    Destroy(go);
                    return;
                }
                go.transform.parent        = modelRoot_;
                go.transform.localScale    = Vector3.one * EntityAssetsData.GetData(pData.iParam).zoom_ * 0.7f;
                go.transform.localPosition = new Vector3(0f, 0f, -150f);
                go.transform.Rotate(Vector3.up, 180f);
                disableMask_.transform.localPosition = new Vector3(0f, 0f, go.transform.localPosition.z * 2f);
            }, new ParamData(baby._AssetsID), "UI");
        }

        string[]    skills  = data.skillIDs_;
        SkillData   skill   = null;
        GameObject  skillGo = null;
        SkillCellUI icon    = null;

        for (int i = 0; i < skills.Length; ++i)
        {
            skill = SkillData.GetMinxiLevelData(int.Parse(skills[i]));
            if (skill == null)
            {
                continue;
            }

            if (i >= itemPool_.Count)
            {
                skillGo = new GameObject("Skill_" + skill._Id);
                skillGo.AddComponent <UISprite>().depth = 0;
                icon                         = UIManager.Instance.AddSkillCellUI(skillGo.GetComponent <UISprite>(), skill, 0f, 0f, 0.7f);
                icon.showTips                = true;
                skillGo.transform.parent     = skillGrid_.transform;
                skillGo.transform.localScale = Vector3.one;
                itemPool_.Add(skillGo);
            }
            else
            {
                itemPool_[i].name = "Skill_" + skill._Id;
                icon          = UIManager.Instance.AddSkillCellUI(itemPool_[i].GetComponent <UISprite>(), skill);
                icon.showTips = true;
            }
        }
        skillGrid_.GetComponent <UIGrid>().Reposition();

        bool   todayOpen = false;
        string desc      = "";

        for (int i = 0; i < data.openTimeDesc_.Length; ++i)
        {
            desc += "周" + ConvertUpper(int.Parse(data.openTimeDesc_[i]));
            int compareDay = int.Parse(data.openTimeDesc_[i]);
            if (compareDay == 7)
            {
                compareDay = 0;
            }
            if ((int)System.DateTime.Today.DayOfWeek == compareDay)
            {
                todayOpen = true;
            }
        }
        desc           += "开启";
        timeBegin_.text = string.Format("[b]{0}[-]", desc);
        disableMask_.SetActive(!todayOpen);

        index_ = index;
    }
コード例 #12
0
    // Use this for initialization
    void Start()
    {
        HeadIconLoader.Instance.LoadIcon("remenhuoban1", back);
        hasDestroy_           = false;
        buyBtnLab.text        = LanguageManager.instance.GetValue("buyBtnLab");
        needMaonylab.text     = LanguageManager.instance.GetValue("Guild_XiaoHao");
        haveNumLab.text       = LanguageManager.instance.GetValue("havenum");
        employeeSkillLab.text = LanguageManager.instance.GetValue("partnerSkill");

        UIManager.SetButtonEventHandler(buyBtn_.gameObject, EnumButtonEvent.OnClick, OnBuy, 0, 0);

        MoreActivityData.TestHotRoleData();

        COM_ADHotRoleContent data = MoreActivityData.GetHotRoleData();

        if (data.type_ == EntityType.ET_Emplyee)
        {
            EmployeeData empData = EmployeeData.GetData((int)data.roleId_);
            roleName.text = empData.name_;
            roleProf.text = string.Format("{0}:{1}", LanguageManager.instance.GetValue("zhiye"), LanguageManager.instance.GetValue(empData.professionType_.ToString()));
            roleDesc.text = empData.desc_;

            whoSkill.text = LanguageManager.instance.GetValue("partnerSkill");

            SkillData skill = null;
            for (int i = 0; i < skills.Length; ++i)
            {
                skills[i].icon.gameObject.SetActive(false);
            }
            int j = 0;
            for (int i = 0; i < skills.Length; ++i)
            {
                if (empData.skills_.Count == 0)
                {
                    break;
                }

                if (i < empData.skills_.Count)
                {
                    for (; j < empData.skills_.Count; ++j)
                    {
                        skill = SkillData.GetData((int)empData.skills_[j].skillID_, (int)empData.skills_[j].skillLevel_);
                        if (skill._SkillType == SkillType.SKT_DefaultActive ||
                            skill._SkillType == SkillType.SKT_DefaultPassive ||
                            skill._SkillType == SkillType.SKT_DefaultSecActive ||
                            skill._SkillType == SkillType.SKT_DefaultSecPassive)
                        {
                            continue;
                        }

                        skill = SkillData.GetData((int)empData.skills_[i].skillID_, (int)empData.skills_[i].skillLevel_);
                        SkillCellUI cell = UIManager.Instance.AddSkillCellUI(skills[i].icon, skill);
                        cell.showTips = true;
                        skills[i].icon.gameObject.SetActive(true);
                        j++;
                        break;
                    }
                }
            }

            GameManager.Instance.GetActorClone((ENTITY_ID)empData.asset_id, (ENTITY_ID)0, EntityType.ET_Emplyee, (GameObject go, ParamData pdata) =>
            {
                if (hasDestroy_)
                {
                    Destroy(go);
                    return;
                }
                EntityAssetsData ead       = EntityAssetsData.GetData(empData.asset_id);
                go.transform.parent        = modsRoot;
                go.transform.localScale    = Vector3.one * ead.zoom_;
                go.transform.localPosition = new Vector3(0f, -130f, 0f);
                go.transform.localRotation = Quaternion.identity;
                ActorRotate ar             = modsRoot.gameObject.AddComponent <ActorRotate>();
                ar.modelRoot_ = modsRoot;
            }, null, "UI");
        }
        else
        {
            BabyData bbData = BabyData.GetData((int)data.roleId_);
            roleName.text = bbData._Name;
            roleProf.text = string.Format("{0}:{1}", LanguageManager.instance.GetValue("BabyInfo_BabyInfoRace"), LanguageManager.instance.GetValue(bbData._RaceType.ToString()));
            roleDesc.gameObject.SetActive(false);

            whoSkill.text = LanguageManager.instance.GetValue("babySkill");

            SkillData skill = null;
            for (int i = 0; i < skills.Length; ++i)
            {
                skills[i].icon.gameObject.SetActive(false);
            }
            int j = 0;
            for (int i = 0; i < skills.Length; ++i)
            {
                if (bbData.skills_.Count == 0)
                {
                    break;
                }

                if (i < bbData.skills_.Count)
                {
                    for (; j < bbData.skills_.Count; ++j)
                    {
                        skill = SkillData.GetData((int)bbData.skills_[j].skillID_, (int)bbData.skills_[j].skillLevel_);
                        if (skill._SkillType == SkillType.SKT_DefaultActive ||
                            skill._SkillType == SkillType.SKT_DefaultPassive ||
                            skill._SkillType == SkillType.SKT_DefaultSecActive ||
                            skill._SkillType == SkillType.SKT_DefaultSecPassive)
                        {
                            continue;
                        }

                        SkillCellUI cell = UIManager.Instance.AddSkillCellUI(skills[i].icon, skill);
                        cell.showTips = true;
                        skills[i].icon.gameObject.SetActive(true);
                        j++;
                        break;
                    }
                }
            }

            GameManager.Instance.GetActorClone((ENTITY_ID)bbData._AssetsID, (ENTITY_ID)0, EntityType.ET_Baby, (GameObject go, ParamData pdata) =>
            {
                if (hasDestroy_)
                {
                    Destroy(go);
                    return;
                }
                EntityAssetsData ead       = EntityAssetsData.GetData(bbData._AssetsID);
                go.transform.parent        = modsRoot;
                go.transform.localScale    = Vector3.one * ead.zoom_;
                go.transform.localPosition = new Vector3(0f, -130f, 0f);
                go.transform.localRotation = Quaternion.identity;
                ActorRotate ar             = modsRoot.gameObject.AddComponent <ActorRotate>();
                ar.modelRoot_ = modsRoot;
            }, null, "UI");
        }

        UpdateBuyNumBtn();
        //ItemData item = ItemData.GetData((int)data.itemId_);
        //itemName.text = item.name_;
        itemCost.text = data.price_.ToString();
        //ItemCellUI icell = UIManager.Instance.AddItemCellUI(itemIcon, data.itemId_);
        //icell.showTips = true;
    }