using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.Events;
|
using UnityEngine.XR.Interaction.Toolkit;
|
public class XRButton : XRBaseInteractable
|
{
|
|
|
|
//[SerializeField]
|
//float m_PressDistance = 1f;
|
|
//[SerializeField]
|
//float speed = 1f;
|
|
//bool m_Pressed = false;
|
|
//Vector3 m_PressedButtonOffset;
|
//Vector3 m_ButtonOffset;
|
|
//private void Start()
|
//{
|
// m_PressedButtonOffset = m_Button.localPosition;
|
// m_PressedButtonOffset.z = -m_PressDistance;
|
// m_ButtonOffset = m_Button.localPosition;
|
//}
|
|
//protected override void OnHoverEntered(HoverEnterEventArgs args)
|
//{
|
// base.OnHoverEntered(args);
|
|
// m_Pressed = true;
|
//}
|
|
|
|
//protected override void OnHoverExited(HoverExitEventArgs args)
|
//{
|
// base.OnHoverExited(args);
|
// m_Pressed = false;
|
//}
|
|
|
//private void Update()
|
//{
|
// if(m_Pressed)
|
// {
|
// UpdateValue(m_PressedButtonOffset);
|
// } else
|
// {
|
|
// UpdateValue(m_ButtonOffset);
|
// }
|
//}
|
|
|
|
//void UpdateValue(Vector3 value) {
|
// m_Button.localPosition = Vector3.Lerp(m_Button.localPosition, value, Time.deltaTime * speed);
|
//}
|
|
|
|
|
|
//void OnDrawGizmosSelected()
|
//{
|
// var pressStartPoint = Vector3.zero;
|
|
// if (m_Button != null)
|
// {
|
// pressStartPoint = m_Button.localPosition;
|
// }
|
|
// pressStartPoint.y += m_ButtonOffset - (m_PressDistance * 0.5f);
|
|
// Gizmos.color = Color.green;
|
// Gizmos.matrix = transform.localToWorldMatrix;
|
// Gizmos.DrawWireCube(pressStartPoint, new Vector3(1, m_PressDistance, 1));
|
//}
|
|
}
|