Ejemplo n.º 1
0
    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;
            }
        }
    }
Ejemplo n.º 2
0
    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;
            }
        }
    }