Exemplo n.º 1
0
    void SetPlayerInfo()
    {
        //TitleLabel.text = "";
        //RaceLabel.text = PlayerData.GetData(playerInst.Properties [(int)PropertyType.PT_TableId]).Race_;
        GradeLabel.text = /*Grade.ToString()*/ playerInst.Properties [(int)PropertyType.PT_Level].ToString();
        //PrestigeLabel.text = /*Prestige.ToString()*/ playerInst.Properties [(int)PropertyType.PT_Reputation].ToString();
        RecordLabel.text = playerInst.InstId.ToString();
        string guildName = "";

        if (GuildSystem.Mguild != null)
        {
            guildName = GuildSystem.Mguild.guildName_;
        }
        else
        {
            guildName = LanguageManager.instance.GetValue("wu");
        }
        FamilyLabel.text     = guildName;
        OccupationLable.text = /*Occupation*/ Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)).jobName_;

//		HpSlider.value = playerInst.Properties [(int)PropertyType.PT_HpCurr]/playerInst.Properties [(int)PropertyType.PT_HpMax];
//		MoliSlider.value = playerInst.Properties [(int)PropertyType.PT_MpCurr]/playerInst.Properties [(int)PropertyType.PT_MpMax];

        RaceLabel.text    = LanguageManager.instance.GetValue(PlayerData.GetData(playerInst.GetIprop(PropertyType.PT_TableId)).Race_.ToString());
        curExp            = (long)playerInst.Properties[(int)PropertyType.PT_Exp];
        pcurExp           = playerInst.Properties[(int)PropertyType.PT_Exp];
        maxExp            = ExpData.GetPlayerMaxExp(playerInst.GetIprop(PropertyType.PT_Level));
        expSlider.value   = (pcurExp / maxExp) * 1f;
        LandSlider.value  = /*LandValue/10f*/ playerInst.Properties [(int)PropertyType.PT_Land] / 10f;
        waterSlider.value = /*waterValue/10f*/ playerInst.Properties [(int)PropertyType.PT_Water] / 10f;
        fireSlider.value  = /*fireValue/10f*/ playerInst.Properties [(int)PropertyType.PT_Fire] / 10f;
        windSlider.value  = /*windValue/10f*/ playerInst.Properties [(int)PropertyType.PT_Wind] / 10f;
    }
Exemplo n.º 2
0
    public void UpdateInfo()
    {
        hpLabel.text = ((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_HpCurr]) + "/" + ((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_HpMax]);
        mpLabel.text = ((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_MpCurr]) + "/" + ((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_MpMax]);
        curExp       = (long)playerInst.Properties[(int)PropertyType.PT_Exp];
        pcurExp      = playerInst.Properties[(int)PropertyType.PT_Exp];
        int  l = playerInst.GetIprop(PropertyType.PT_Level);
        long m = ExpData.GetPlayerMaxExp(l);

        maxExp = ExpData.GetPlayerMaxExp(playerInst.GetIprop(PropertyType.PT_Level));
        chucunExpLable.text = GamePlayer.Instance.GetIprop(PropertyType.PT_ConvertExp).ToString();
        if (playerInst.GetIprop(PropertyType.PT_Level) > 1)
        {
            oldLevel = (playerInst.GetIprop(PropertyType.PT_Level) - 1);
        }
        else
        {
            oldExp = 0;
        }
        oldExp = ExpData.GetPlayerMaxExp(oldLevel);
        long s = curExp - oldExp;

        if (s < 0)
        {
            s = 0;
        }
        expSlider.value = (s * 1f) / ((maxExp - oldExp) * 1f);
        expLabel.text   = s + "/" + ((long)maxExp - (long)oldExp);
    }
Exemplo n.º 3
0
    void Start()
    {
        sItem.SetActive(false);
        dItem.SetActive(false);
        if (GamePlayer.Instance.BattleBaby != null)
        {
            if (!GamePlayer.Instance.BattleBaby.isDead)
            {
                babykuang.SetActive(true);
                //babyExpLabel.text = "+"+ Battle.Instance.BattleBabyExp.ToString();
                HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)GamePlayer.Instance.BattleBaby.Properties[(int)PropertyType.PT_AssetId]).assetsIocn_, babyIcon);
                HeadIconLoader.Instance.LoadIcon(BabyData.GetData((int)GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_TableId))._RaceIcon, RaceIcon);
                BabyExp.value     = (float)GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_Exp) / ExpData.GetBabyMaxExp(GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_Level));
                babyExpLabel.text = Battle.Instance.BattleBabyExp.ToString();
                //StartCoroutine(NumScrollEffect((int)Battle.Instance.BattleBabyExp,babyExpLabel));
            }
        }
        else
        {
            babykuang.SetActive(false);
        }

        playerExpLabel.text = Battle.Instance.BattleReward.playExp_.ToString();
        //StartCoroutine(NumScrollEffect((int)Battle.Instance.BattleReward.playExp_,playerExpLabel));
        MoneyLabel.text = Battle.Instance.BattleReward.money_.ToString();
        //StartCoroutine(NumScrollEffect((int)Battle.Instance.BattleReward.money_,MoneyLabel));

        HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_AssetId]).assetsIocn_, playerIcon);

        long curExp   = (long)GamePlayer.Instance.Properties [(int)PropertyType.PT_Exp];
        long macExp   = ExpData.GetPlayerMaxExp(GamePlayer.Instance.GetIprop(PropertyType.PT_Level));
        long valueExp = curExp / macExp;

        playerExp.value = (float)valueExp;


//		levelup.gameObject.SetActive(false);
//		clevelup.gameObject.SetActive (false);
        hasDestroyed = false;
        //babyL.gameObject.SetActive (false);
        //playerL.gameObject.SetActive (false);
        GlobalInstanceFunction.Instance.Invoke(() => { OnClickclose(null, null, 0, 0); }, 5f);
        //skillItem.SetActive (false);
        //iItem.SetActive (false);
        bool isFlag = true;

        // Battle.Instance.BattleReward.skills_;

        for (int i = 0; i < Battle.Instance.BattleReward.skills_.Length; i++)
        {
            if (i < 5)
            {
                cskills.Add(Battle.Instance.BattleReward.skills_[i]);
            }
        }

        List <COM_Skill> tmpsk = new List <COM_Skill>();

        for (int i = 0; i < cskills.Count; ++i)
        {
            if (tmpsk.Count == 0)
            {
                tmpsk.Add(cskills[i]);
            }
            else
            {
                for (int j = 0; j < tmpsk.Count; ++j)
                {
                    if (tmpsk[j].skillID_ == cskills[i].skillID_)
                    {
                        tmpsk[j].skillExp_  += cskills[i].skillExp_;
                        tmpsk[j].skillLevel_ = cskills[i].skillLevel_;
                        isFlag = false;
                    }
                }
                if (isFlag)
                {
                    tmpsk.Add(cskills[i]);
                    isFlag = true;
                }
            }
        }

        AddSkillItems(tmpsk);
        item = Battle.Instance.BattleReward.items_;
        AddPropsItems(item);
//			for(int i = 0 ;i <item.Length;i++)
//			{
//				ItemData idata = ItemData.GetData((int)item[i]);
//				itemDa.Add(idata);
//			}
//		    PlayerName = GamePlayer.Instance.InstName;
//			PlayerExp = Battle.Instance.BattleReward.playExp_.ToString ();
//			playerL.text = PlayerName;
//			playerE.text = PlayerExp;
//		   moneyLabel.text = Battle.Instance.BattleReward.money_.ToString ();
        //HeadIconLoader.Instance.LoadIcon (EntityAssetsData.GetData((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_AssetId]).assetsIocn_, icon);


//		    if (GamePlayer.Instance.BattleBaby != null)
//			{
//				if(!GamePlayer.Instance.BattleBaby.isDead)
//				{
//				    chongObj.gameObject.SetActive(true);
//					if(GamePlayer.Instance.BattleBaby.isLevelUp_)
//					{
//					clevelup.gameObject.SetActive(true);
//					    //PopText.Instance.Show (levelup.mainTexture);
//						EffectAPI.PlayUIEffect((EFFECT_ID)GlobalValue.EFFECT_PlayerLvUpOnUI, transform);
//					}
//					babyL.gameObject.SetActive(true);
//					babyE.gameObject.SetActive(true);
//					fuhaoSp.gameObject.SetActive(true);
//					//textSp.gameObject.SetActive(true);
//					babyName = GamePlayer.Instance.BattleBaby.InstName;
//					babyExp = Battle.Instance.BattleBabyExp.ToString();
//                    Battle.Instance.BattleBabyExp = 0;
//					babyL.text = babyName;
//					babyE.text = babyExp;
//				HeadIconLoader.Instance.LoadIcon (EntityAssetsData.GetData((int)GamePlayer.Instance.BattleBaby.Properties[(int)PropertyType.PT_AssetId]).assetsIocn_, cicon);
//				HeadIconLoader.Instance.LoadIcon (BabyData.GetData((int)GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_TableId)).RaceIcon_, raceIcon);
//			   }
//
//			}
//			else
//			{
//				babyL.gameObject.SetActive(false);
//				babyE.gameObject.SetActive(false);
//				fuhaoSp.gameObject.SetActive(false);
//			    chongObj.gameObject.SetActive(false);
//
//			}



        GamePlayer.Instance.OpenSystemEnvetString += new RequestEventHandler <int> (UpdateOpenSystemStr);

        //GameManager.Instance.GetActorClone((ENTITY_ID)GamePlayer.Instance.Properties[(int)PropertyType.PT_AssetId], (ENTITY_ID)GamePlayer.Instance.WeaponAssetID, AssetLoadCallBack, new ParamData(GamePlayer.Instance.InstId), "UI");

        UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClickclose, 0, 0);

        GuideManager.Instance.RegistGuideAim(closeBtn.gameObject, GuideAimType.GAT_BattleRewardClose);

        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_BattleOverRewardOpen);
    }