123456789101112131415161718192021222324252627282930313233 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using ChivaXR.VR;
- public class CVR_PutDownElement : MonoBehaviour
- {
- private IVR_Interactable interactable;
- private Vector3 _putWorldPos;
- private Quaternion _putWorldRot;
- private void Start()
- {
- interactable = this.GetComponent<IVR_Interactable>();
- interactable.CVR_InteractableObjectPreUnGrabbed += UnGrab;
- _putWorldPos = this.transform.position;
- _putWorldRot = this.transform.rotation;
- }
- public void UnGrab(object sender, CVR_InteractableObjectEventArgs e)
- {
- if (PutDownBoxManager.Instance.TestBounds(this.transform.position))
- {
- InitObj();
- }
- }
- public void InitObj()
- {
- this.transform.position = _putWorldPos;
- this.transform.rotation = _putWorldRot;
- }
- }
|