Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- // ReSharper disable once CheckNamespace
- namespace UnityEngine
- {
- public static class GameObjectExtensions
- {
- public static Component AddComponentFromString(this GameObject obj, string newComponent)
- {
- return obj.AddComponent(Type.GetType(newComponent));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement