private void Start()
    {
        HP = GameMaster.PartyStats1.GetStat <Stat_Vital>(Base_Stat_Type.HP);
        MP = GameMaster.PartyStats1.GetStat <Stat_Vital>(Base_Stat_Type.MP);

        HPDisplay.text = "HP: " + HP.StatCurrentValue + "/" + HP.StatBaseValue;
        MPDisplay.text = "MP: " + MP.StatCurrentValue + "/" + MP.StatBaseValue;
    }
Esempio n. 2
0
    void OnStatValueChange(object sender, EventArgs args)
    {
        Stat_Vital vital = (Stat_Vital)sender;

        if (vital != null)
        {
            Debug.Log(string.Format("Vital {0}'s OnStatValueChange event was triggered", vital.StatName));
        }
    }
    private void Awake()
    {
        HP = GameMaster.PartyStats1.GetStat <Stat_Vital>(Base_Stat_Type.HP);
        MP = GameMaster.PartyStats1.GetStat <Stat_Vital>(Base_Stat_Type.MP);

        HPText.text = "HP: " + HP.StatCurrentValue + "/" + HP.StatBaseValue;
        MPText.text = "MP: " + MP.StatCurrentValue + "/" + MP.StatBaseValue;

        BarWidth = 100 * (HP.StatCurrentValue / HP.StatBaseValue);
        HealthBar.rectTransform.sizeDelta = new Vector2(BarWidth, HealthBar.rectTransform.sizeDelta.y);

        BarWidth = 100 * (MP.StatCurrentValue / MP.StatBaseValue);
        ManaBar.rectTransform.sizeDelta = new Vector2(BarWidth, HealthBar.rectTransform.sizeDelta.y);
    }
Esempio n. 4
0
 void DisplayStatValues()
 {
     ForEachEnum <Base_Stat_Type>((statType) => {
         Base_Stat stat = stats.GetStat((Base_Stat_Type)statType);
         if (stat != null)
         {
             Stat_Vital vital = stat as Stat_Vital;
             if (vital != null)
             {
                 Debug.Log(string.Format("Stat {0}'s value is {1}/{2}",
                                         stat.StatName, vital.StatCurrentValue, stat.StatValue));
             }
             else
             {
                 Debug.Log(string.Format("Stat {0}'s value is {1}",
                                         stat.StatName, stat.StatValue));
             }
         }
     });
 }