Ejemplo n.º 1
0
        private void Start()
        {
            Player         player  = PlayerManager.Instance.Player;
            AbilityFactors ability = player.AbilityFactors;

            addHpButton.onClick.AddListener(() => { player.AbilityPoint--; ability.MaxHP += 40; ability.HP += 40; });
            addSpButton.onClick.AddListener(() => { player.AbilityPoint--; ability.MaxSP += 20; ability.SP += 20; });
            addPowerButton.onClick.AddListener(() => { player.AbilityPoint--; ability.Power++; });
            addMagicButton.onClick.AddListener(() => { player.AbilityPoint--; ability.Magic++; });
            addAgileButton.onClick.AddListener(() => { player.AbilityPoint--; ability.Agile++; });
            addSensibilityButton.onClick.AddListener(() => { player.AbilityPoint--; ability.Sensibility++; });

            unloadHeadEquipmentButton.onClick.AddListener(() => { player.Inventory.AddItem(player.HeadEquipment, 1); player.HeadEquipment = null; });
            unloadBodyEquipmentButton.onClick.AddListener(() => { player.Inventory.AddItem(player.BodyEquipment, 1); player.BodyEquipment = null; });
            unloadWeaponEquipmentButton.onClick.AddListener(() => { player.Inventory.AddItem(player.Weapon, 1); player.Weapon = null; });
            unloadFootEquipmentButton.onClick.AddListener(() => { player.Inventory.AddItem(player.FootEquipment, 1); player.FootEquipment = null; });
            unloadAccessoryEquipmentButton.onClick.AddListener(() => { player.Inventory.AddItem(player.Accessory, 1); player.Accessory = null; });

            player.OnNameChange         += (value) => RenderPlayer(player);
            player.OnEXP_Change         += (value) => RenderPlayer(player);
            player.OnLevelUpEXPChange   += (value) => RenderPlayer(player);
            player.OnAbilityPointChange += (value) => RenderPlayer(player);

            ability.OnLevelChange       += (value1, value2) => RenderPlayer(player);
            ability.OnHPChange          += (value) => RenderPlayer(player);
            ability.OnMaxHPChange       += (value) => RenderPlayer(player);
            ability.OnSPChange          += (value) => RenderPlayer(player);
            ability.OnMaxSPChange       += (value) => RenderPlayer(player);
            ability.OnPowerChange       += (value) => RenderPlayer(player);
            ability.OnMagicChange       += (value) => RenderPlayer(player);
            ability.OnAgileChange       += (value) => RenderPlayer(player);
            ability.OnSensibilityChange += (value) => RenderPlayer(player);

            player.Inventory.OnItemChange += (value) => RenderPlayer(player);

            ability.OnLevelChange += (abilityFactors, level) =>
            {
                player.AbilityPoint  += 3;
                player.LevelUpEXP     = LevelEXPTable.GetLevelUpEXP(abilityFactors.Level);
                abilityFactors.MaxHP += 30;
                abilityFactors.HP    += 30;
                abilityFactors.MaxSP += 15;
                abilityFactors.SP    += 15;
            };

            player.OnLearnSkill += (value) => RenderPlayer(player);

            RenderPlayer(player);
        }
Ejemplo n.º 2
0
 public void UpdatePlayerInfo(Player player)
 {
     if (player != null)
     {
         int remainedEXP;
         int level  = LevelEXPTable.GetLevel(player.EXP, out remainedEXP);
         int maxEXP = LevelEXPTable.EXPForUpgrade(player.Level);
         levelText.text = level.ToString();
         experiencePointsSlider.maxValue = maxEXP;
         experiencePointsSlider.value    = remainedEXP;
         expText.text       = string.Format("{0}/{1}", remainedEXP, maxEXP);
         cakeCountText.text = player.CakeCount.ToString();
         OnProfilePhotoChangeAction(IANTGame.ProfilePhoto);
         OnProfileChangeAction(IANTGame.ProfileResult);
     }
 }
Ejemplo n.º 3
0
 private void OnLevelChangeAction(int level)
 {
     levelText.text = level.ToString();
     experiencePointsSlider.maxValue = LevelEXPTable.EXPForUpgrade(level);
 }