public void Spawn(int id) { if (agentManager == null) { return; } for (int i = 0; i < spawnCount; i++) { if (!agentManager.Spawn(new AgentData { pos = Random.insideUnitCircle.normalized * spawnRadius + (Vector2)transform.position , life = spawnLife , vel = Vector2.zero , targetIndex = phosphorManager.getRandomPhosphorIndex() , playerID = -id })) { break; } } }
public void Spawn(int id) { if (agentManager == null) { return; } for (int i = 0; i < spawnCount; i++) { Vector3 p = Random.insideUnitSphere * spawnRadius + transform.position; if (isCharGrounded) { p.y = yMag; } if (!agentManager.Spawn(new AgentData { pos = p , life = spawnLife , vel = Vector3.zero })) { break; } } }