Beispiel #1
0
 public void UseResource(UnitResourceType aType, float aAmount)
 {
     switch(aType)
     {
         case UnitResourceType.HEALTH:
             ReceiveDamage(aAmount);
             break;
         case UnitResourceType.RESOURCE:
             m_Resource -= aAmount;
             m_Resource = Mathf.Clamp(m_Resource, 0.0f, m_MaxResource);
             break;
     }
 }
Beispiel #2
0
 public void RestoreResource(UnitResourceType aType, float aAmount)
 {
     switch (aType)
     {
         case UnitResourceType.RESOURCE:
             m_Resource += aAmount;
             m_Resource = Mathf.Clamp(m_Resource, 0.0f, m_MaxResource);
             break;
     }
 }