void Start()
    {
        player        = GameManager.Instance.player;
        healthBar     = gameObject.transform.Find("HP Bar").GetComponent <Slider>();
        healthBarText = healthBar.transform.Find("HP Amount").GetComponent <Text>();
        manaBar       = gameObject.transform.Find("MP Bar").GetComponent <Slider>();
        manaBarText   = manaBar.transform.Find("MP Amount").GetComponent <Text>();
        expBar        = gameObject.transform.Find("EXP Bar").GetComponent <Slider>();
        expBarText    = expBar.transform.Find("EXP Amount").GetComponent <Text>();
        shieldBar     = gameObject.transform.Find("Shield Bar").GetComponent <Slider>();
        Transform playerDesc = gameObject.transform.Find("Player Description");

        mingZi       = playerDesc.Find("Name").GetComponent <Text>();
        job          = playerDesc.Find("Job").GetComponent <Text>();
        currentLevel = playerDesc.Find("Current Level").GetComponent <Text>();
        nextLevel    = playerDesc.Find("Next Level").GetComponent <Text>();
        //UpdateStatusBar();
        UIEventHandler.OnPlayerHealthChanged += UpdateHealthBar;
        UIEventHandler.OnPlayerExpChanged    += UpdateExpBar;
        UIEventHandler.OnPlayerManaChanged   += UpdateManaBar;
        UIEventHandler.ExpChanged();
        player.StatsUpdate();
        player.HealFullHP();
        player.HealFullMP();
        UpdateDescription();
    }
Exemple #2
0
 public static void ExpAdded(int amount)
 {
     EventNotifier.Instance.MakeEventNotifier(string.Format("Gained: ({0}) EXP", amount));
     OnExpAdded(amount);
     UIEventHandler.ExpChanged();
 }