Exemple #1
0
    //-------------------------------------------------------------------------------------------------
    private void SpawnBabiesWith(PreyController otherPrey)
    {
        //If mating then spawn babies
        if (m_isMating || otherPrey.m_isMating)
        {
            AudioManager.Play(eSoundType.BUNNY_SEXY_TIMES);

            //Spawn setup
            int     spawnTotal    = GameManager.GetInstance().m_babySpawnTotal;
            Vector2 spawnLocation = (transform.position + otherPrey.transform.position) / 2;
            Vector3 babyLocation  = spawnLocation;
            babyLocation.z = GameManager.GAME_Z;

            //Spawn babies
            for (int babyIndex = 0; babyIndex < spawnTotal; ++babyIndex)
            {
                Instantiate(GameManager.GetInstance().m_preyPrefab, babyLocation, Quaternion.identity);
            }

            //Spawn Explosion
            Vector3 explosionLocation = babyLocation;
            explosionLocation.y -= 0.5f;             //Appear slightly below mate location
            Instantiate(GameManager.GetInstance().m_explosionPrefab, explosionLocation, Quaternion.identity);

            StopHop();
            otherPrey.StopHop();
        }
    }