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.
20 lines
498 B
C#
20 lines
498 B
C#
using UnityEngine;
|
|
|
|
public static class SRInstantiate
|
|
{
|
|
public static T Instantiate<T>(T prefab) where T : Component
|
|
{
|
|
return (T) Object.Instantiate(prefab);
|
|
}
|
|
|
|
public static GameObject Instantiate(GameObject prefab)
|
|
{
|
|
return (GameObject) Object.Instantiate(prefab);
|
|
}
|
|
|
|
public static T Instantiate<T>(T prefab, Vector3 position, Quaternion rotation) where T : Component
|
|
{
|
|
return (T) Object.Instantiate(prefab, position, rotation);
|
|
}
|
|
}
|