public void Reset() { Vector3 randomPosition = AttackingAgent.RandomPointInBounds(baseCollider.bounds); transform.position = randomPosition; gameObject.SetActive(true); }
public override void AgentReset() { // Resets him to his base rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; Vector3 randomPosition = AttackingAgent.RandomPointInBounds(defenderBase.bounds); Quaternion randomRotation = Quaternion.Euler(0, Random.Range(0, 360), 0); transform.position = randomPosition; transform.rotation = randomRotation; }
public void Update(Tuple <ObjectType, float> seenObject, int eyeIt, AttackingAgent b) { ObjectType t = seenObject.Item1; if (seenObject.Item2 > 1) { switch (t) { case ObjectType.Attacker: case ObjectType.Defender: if (b.isAlly(t)) { bits[3 * 3 + eyeIt] = '1'; } else { bits[4 * 3 + eyeIt] = '1'; } break; default: bits[(int)t * 3 + eyeIt] = '1'; break; } } else { switch (t) { case ObjectType.Attacker: case ObjectType.Defender: { if (!b.isAlly(t)) { bits[6 * 3 + eyeIt] = '1'; } break; } case ObjectType.Wall: bits[eyeIt] = '1'; bits[5 * 3 + eyeIt] = '1'; break; } } }