Example #1
0
    public void PrintBar()
    {
        GameInfo  kGameInfo = GameMgr.Inst.m_GameInfo;
        ActorInfo kActor    = kGameInfo.m_ActorInfo;
        int       curHP     = kActor.m_HP;
        int       maxHP     = kActor.CalculateMaxHP();

        m_bar.fillAmount = (float)curHP / maxHP;
        m_txtHP.text     = kActor.m_HP.ToString();
    }
Example #2
0
    public int CalculateScore()
    {
        int curHP  = m_ActorInfo.m_HP;
        int maxHP  = m_ActorInfo.CalculateMaxHP();
        int nScore = (int)((float)curHP / maxHP) * Config.DMAX_SCORE;

        if (nScore < Config.DMIN_SCORE)
        {
            nScore = Config.DMIN_SCORE;
        }
        return(nScore);
    }