using UnityEngine; namespace VRSDK { public static class GameObjectExtension { /// /// VR Shooter Kit extension method just try to get a component, if the component is no found we add one /// public static T GetOrAddComponent(this GameObject go) where T : Component { T component = go.GetComponent(); if (component == null) component = go.AddComponent(); return component; } } }