|
|
|
|
|
|
bool m_Shoot; |
|
|
|
float m_FrozenTime; |
|
|
|
float m_EffectTime; |
|
|
|
float m_CooldownTime; |
|
|
|
Rigidbody m_AgentRb; |
|
|
|
float m_LaserLength; |
|
|
|
// Speed of agent rotation.
|
|
|
|
|
|
|
|
|
|
|
// Speed of agent movement.
|
|
|
|
public float moveSpeed = 2; |
|
|
|
|
|
|
|
public float cooldownTime = 0.5f; |
|
|
|
public Material normalMaterial; |
|
|
|
public Material badMaterial; |
|
|
|
public Material goodMaterial; |
|
|
|
|
|
|
sensor.AddObservation(localVelocity.z); |
|
|
|
sensor.AddObservation(m_Frozen); |
|
|
|
sensor.AddObservation(m_Shoot); |
|
|
|
sensor.AddObservation((Time.time - m_CooldownTime) / cooldownTime); |
|
|
|
sensor.AddObservation((Time.time - m_CooldownTime) / cooldownTime); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
m_AgentRb.velocity *= 0.95f; |
|
|
|
} |
|
|
|
|
|
|
|
if (m_Shoot) |
|
|
|
if (m_Shoot && (Time.time > m_CooldownTime + cooldownTime)) |
|
|
|
{ |
|
|
|
var myTransform = transform; |
|
|
|
//m_Laser.transform.localScale = new Vector3(1f, 1f, m_LaserLength);
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
m_CooldownTime = Time.time; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|