diff --git a/Scripts/Utilities/ExtentionMethods.cs b/Scripts/Utilities/ExtentionMethods.cs index 68220c4..cb39962 100644 --- a/Scripts/Utilities/ExtentionMethods.cs +++ b/Scripts/Utilities/ExtentionMethods.cs @@ -1,14 +1,15 @@ -using UnityEngine; - -public static class ExtentionMethods +namespace UnityEngine.UI.Extensions { - public static T GetOrAddComponent(this GameObject child) where T : Component + public static class ExtentionMethods { - T result = child.GetComponent(); - if (result == null) + public static T GetOrAddComponent(this GameObject child) where T : Component { - result = child.AddComponent(); + T result = child.GetComponent(); + if (result == null) + { + result = child.AddComponent(); + } + return result; } - return result; } }