|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Role role; |
|
|
|
float[] m_RoleObs; |
|
|
|
m_RoleObs = new float[3]; |
|
|
|
m_RoleObs[0] = 1f; |
|
|
|
m_HitPoints = .7f; |
|
|
|
m_Damage = 0f; |
|
|
|
m_Heal = .7f; |
|
|
|
|
|
|
} |
|
|
|
else if (role == Role.DPS) |
|
|
|
{ |
|
|
|
m_RoleObs[1] = 1f; |
|
|
|
m_HitPoints = .6f; |
|
|
|
m_Damage = .05f; |
|
|
|
m_Heal = 0f; |
|
|
|
|
|
|
} |
|
|
|
else if (role == Role.Tank) |
|
|
|
{ |
|
|
|
m_RoleObs[2] = 1f; |
|
|
|
m_HitPoints = 1f; |
|
|
|
m_Damage = .02f; |
|
|
|
m_Heal = .2f; |
|
|
|
|
|
|
Vector3 dirToSelf = transform.position - m_LargeAgent.transform.position; |
|
|
|
float angle = Vector3.Dot(m_LargeAgent.transform.forward.normalized, dirToSelf.normalized); |
|
|
|
sensor.AddObservation(angle); |
|
|
|
sensor.AddObservation(m_RoleObs); |
|
|
|
} |
|
|
|
|
|
|
|
public Color32 ToColor(int hexVal) |
|
|
|