using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace VRBeats
{
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;
}
}
}