Пример #1
0
    public static Transform Spawn(Vector3 position, Quaternion rotation)
    {
        GameObject ammo = ammoManagerSingleton.ammoPool.Dequeue();

        ammo.transform.position      = position;
        ammo.transform.localRotation = rotation;
        ammo.SetActive(true);

        ammoManagerSingleton.ammoPool.Enqueue(ammo);

        ammoManagerSingleton.GetComponent <AudioSource>().Play();

        return(ammo.transform);
    }