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,32 @@
using UnityEngine;
public class BouncingBallMgr : MonoBehaviour
{
[SerializeField] private Transform trackingspace;
[SerializeField] private GameObject rightControllerPivot;
[SerializeField] private OVRInput.RawButton actionBtn;
[SerializeField] private GameObject ball;
private GameObject currentBall;
private bool ballGrabbed = false;
private void Update()
{
if (!ballGrabbed && OVRInput.GetDown(actionBtn))
{
currentBall = Instantiate(ball, rightControllerPivot.transform.position, Quaternion.identity);
currentBall.transform.parent = rightControllerPivot.transform;
ballGrabbed = true;
}
if (ballGrabbed && OVRInput.GetUp(actionBtn))
{
currentBall.transform.parent = null;
var ballPos = currentBall.transform.position;
var vel = trackingspace.rotation * OVRInput.GetLocalControllerVelocity(OVRInput.Controller.RTouch);
var angVel = OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.RTouch);
currentBall.GetComponent<BouncingBallLogic>().Release(ballPos, vel, angVel);
ballGrabbed = false;
}
}
}