|
|
|
|
|
|
m_Damage = 0f; |
|
|
|
m_Heal = .7f; |
|
|
|
m_MoveSpeed = 10f; |
|
|
|
m_turnSpeed = 150f; |
|
|
|
m_TurnSpeed = 150f; |
|
|
|
m_Cooldown = .2f; |
|
|
|
} |
|
|
|
else if (role == Role.DPS) |
|
|
|
|
|
|
m_Heal = 0f; |
|
|
|
m_MoveSpeed = 10f; |
|
|
|
m_turnSpeed = 200f; |
|
|
|
m_TurnSpeed = 200f; |
|
|
|
m_Cooldown = .25f; |
|
|
|
} |
|
|
|
else if (role == Role.Tank) |
|
|
|
|
|
|
m_Heal = .2f; |
|
|
|
m_MoveSpeed = 6f; |
|
|
|
m_turnSpeed = 100f; |
|
|
|
m_TurnSpeed = 100f; |
|
|
|
m_Cooldown = .4f; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
Vector3 dirToSelf = transform.position - m_LargeAgent.transform.position; |
|
|
|
float angle = Vector3.Dot(m_LargeAgent.transform.forward.normalized, dirToSelf.normalized); |
|
|
|
sensor.AddObservation(angle); |
|
|
|
if (m_Dead) |
|
|
|
{ |
|
|
|
AddReward(-.001f * m_Bonus); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public Color32 ToColor(int hexVal) |
|
|
|
|
|
|
if (hit.collider.gameObject.CompareTag("StrongSmallAgent") || hit.collider.gameObject.CompareTag("WeakSmallAgent")) |
|
|
|
{ |
|
|
|
hit.collider.gameObject.GetComponent<SmallCubeAgent>().HealAgent(m_Heal); |
|
|
|
if (role == Role.Healer) |
|
|
|
{ |
|
|
|
AddReward(.05f); |
|
|
|
} |
|
|
|
|
|
|
|
AddReward(.1f + .4f * m_Bonus); |
|
|
|
if (role == Role.DPS) |
|
|
|
{ |
|
|
|
AddReward(.1f); |
|
|
|
} |
|
|
|
else if (role == Role.Tank) |
|
|
|
{ |
|
|
|
AddReward(.05f); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
myLaser.isFired = true; |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
else // Dead
|
|
|
|
{ |
|
|
|
// AddReward(-.1f * m_Bonus);
|
|
|
|
m_Dead = true; |
|
|
|
EndEpisode(); |
|
|
|
gameObject.SetActive(false); |
|
|
|
|
|
|
m_Dead = false; |
|
|
|
m_Shoot = false; |
|
|
|
m_ShootTime = -.5f; |
|
|
|
//m_Bonus = Academy.Instance.FloatProperties.GetPropertyWithDefault("bonus", 0);
|
|
|
|
m_Bonus = .2f;//SideChannelUtils.GetSideChannel<FloatPropertiesChannel>().GetPropertyWithDefault("bonus", 0);
|
|
|
|
m_AgentRb.velocity = Vector3.zero; |
|
|
|
|
|
|
|
float smallRange = 50f * m_MyArea.range; |
|
|
|