Exemple #1
0
    public virtual void SetExpProgressBar()
    {
        if (!isMyShip())
        {
            return;
        }

        GameObject exp_bar = Trans.FindObj(Camera.main.gameObject, "expIcon");

        if (exp_bar == null)
        {
            Debug.LogError("exp_bar not found!!");
            return;
        }

        if (_attri.EXP_Max >= _attri.Exp && _attri.EXP_Max > 0)
        {
            //           Debug.Log(name + "::Hp :" + Hp + ",HP_MAX:" + HP_MAX);

            float exp_percent = _attri.Exp / (_attri.EXP_Max * 1.0f) * ExpBar.expbar_count;

            ExpBar exp_script = exp_bar.GetComponent <ExpBar>();

            exp_script.SetExpProcessBar((int)exp_percent);
        }
    }