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.
CrowdControl/Assets/3rd/StompyRobot/SRF/Scripts/Helpers/SRInstantiate.cs

20 lines
498 B
C#

3 months ago
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);
}
}