Car/Assets/StompyRobot/SRF/Scripts/Helpers/SRInstantiate.cs

20 lines
498 B
C#
Raw Permalink Normal View History

2025-01-02 11:32:58 +08:00
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);
}
}