Initial Commit

This commit is contained in:
2025-07-04 20:33:06 +03:00
commit 8f09347ae0
9219 changed files with 2447903 additions and 0 deletions
@@ -0,0 +1,59 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GrabObject : MonoBehaviour
{
[TextArea]
public string ObjectName;
[TextArea]
public string ObjectInstructions;
public enum ManipulationType
{
Default,
ForcedHand,
DollyHand,
DollyAttached,
HorizontalScaled,
VerticalScaled,
Menu
};
public ManipulationType objectManipulationType = ManipulationType.Default;
public bool showLaserWhileGrabbed = false;
[HideInInspector]
public Quaternion grabbedRotation = Quaternion.identity;
// only handle grab/release
// other button input is handled by another script on the object
public delegate void GrabbedObject(OVRInput.Controller grabHand);
public GrabbedObject GrabbedObjectDelegate;
public delegate void ReleasedObject();
public ReleasedObject ReleasedObjectDelegate;
public delegate void SetCursorPosition(Vector3 cursorPosition);
public SetCursorPosition CursorPositionDelegate;
public void Grab(OVRInput.Controller grabHand)
{
grabbedRotation = transform.rotation;
GrabbedObjectDelegate?.Invoke(grabHand);
}
public void Release()
{
ReleasedObjectDelegate?.Invoke();
}
public void CursorPos(Vector3 cursorPos)
{
CursorPositionDelegate?.Invoke(cursorPos);
}
}