You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
613 B
C#
28 lines
613 B
C#
1 week ago
|
using UnityEngine;
|
||
|
|
||
|
namespace Unity.BossRoom.Utils
|
||
|
{
|
||
|
public class PrefabSpawner : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
bool m_UseLocalPosition;
|
||
|
|
||
|
[SerializeField]
|
||
|
bool m_UseLocalRotation;
|
||
|
|
||
|
[SerializeField]
|
||
|
GameObject m_Prefab;
|
||
|
|
||
|
[SerializeField]
|
||
|
Vector3 m_CustomPosition;
|
||
|
|
||
|
[SerializeField]
|
||
|
Quaternion m_CustomRotation;
|
||
|
|
||
|
public void Spawn()
|
||
|
{
|
||
|
Instantiate(m_Prefab, m_UseLocalPosition ? transform.position : m_CustomPosition, m_UseLocalRotation ? transform.rotation : m_CustomRotation);
|
||
|
}
|
||
|
}
|
||
|
}
|