using UnityEngine;
namespace Nxr.Internal
{
///
///
///
public class NxrDragableItem : MonoBehaviour
{
public bool IsDraging { set; get; }
Transform mTransform;
Collider mCollider;
// Start is called before the first frame update
void Start()
{
mCollider = GetComponent();
mTransform = transform;
IsDraging = false;
}
///
/// On begin drag game object
///
///
public void OnBeginDrag(Transform parent)
{
mTransform.SetParent(parent);
mCollider.enabled = false;
IsDraging = true;
}
///
/// On end drag game object
///
///
public void OnEndDrag(Transform parent)
{
mTransform.SetParent(parent);
mCollider.enabled = true;
IsDraging = false;
}
}
}