Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- namespace StrongExtensions
- {
- public static class UnityObjectExtensions
- {
- public static TObject Instantiate<TObject>(this TObject value)
- where TObject : Object
- => Object.Instantiate(value);
- public static TObject Instantiate<TObject>(this TObject value, Transform parent)
- where TObject : Object
- => Object.Instantiate(value, parent);
- public static TObject Instantiate<TObject>(this TObject value, Transform parent, bool worldPositionStays)
- where TObject : Object
- => Object.Instantiate(value, parent, worldPositionStays);
- public static TObject Instantiate<TObject>(this TObject value, Vector3 position, Quaternion rotation)
- where TObject : Object
- => Object.Instantiate(value, position, rotation);
- public static TObject Instantiate<TObject>(this TObject value, Vector3 position, Quaternion rotation, Transform parent)
- where TObject : Object
- => Object.Instantiate(value, position, rotation, parent);
- public static void Destroy(this Object value)
- => Object.Destroy(value);
- public static void DestroyImmediate(this Object value)
- => Object.DestroyImmediate(value);
- public static void DontDestroyOnLoad(this Object value)
- => Object.DontDestroyOnLoad(value);
- }
- }
Add Comment
Please, Sign In to add comment