Esempio n. 1
0
    public void IncreaseFlockSize()
    {
        for (int i = 0; i < increaseFlockByCount; ++i)
        {
            FlockingAgent agent = Instantiate(prey);
            agent.transform.position = GameManager.RandomInRectWorldPosition();
            agent.RandomizeWeights();
            agent.GetComponent <CircleCollider2D>().enabled = false;

            FlockManager.Instance.AddAgent(agent);
        }

        FlockSize += increaseFlockByCount;
    }
Esempio n. 2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag.Equals(Tag.Player))
        {
            int amountToBeSpawned = Random.Range(50, 100);

            for (int i = 0; i < amountToBeSpawned; ++i)
            {
                FlockingAgent agent = GameManager.Instance.CreateNewPrey();
                agent.RandomizeWeights();
            }

            Destroy(gameObject);
        }
    }