From 2c9b7bb2b0df9b71a81ac9afc3a88b2407374320 Mon Sep 17 00:00:00 2001 From: Samrendra Roy <67054877+roysamren@users.noreply.github.com> Date: Mon, 29 May 2023 16:19:23 -0500 Subject: [PATCH] physics test --- Project/Assets/onsqueeze.cs | 23 ++++++++++++++++++++++- Project/Assets/test physics.cs | 23 +++++++++++++++++++++++ Project/Assets/test physics.cs.meta | 11 +++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 Project/Assets/test physics.cs create mode 100644 Project/Assets/test physics.cs.meta diff --git a/Project/Assets/onsqueeze.cs b/Project/Assets/onsqueeze.cs index 1eccbc6d..e2103888 100644 --- a/Project/Assets/onsqueeze.cs +++ b/Project/Assets/onsqueeze.cs @@ -1,11 +1,13 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; - +using UnityEngine.XR.Interaction.Toolkit; public class onsqueeze : MonoBehaviour { public GameObject waterpour; public GameObject dropper; + public bool squeez; + public bool sdw; private int state = 0; private Vector3 rot; // Start is called before the first frame update @@ -23,6 +25,25 @@ public class onsqueeze : MonoBehaviour waterpour.SetActive(false); gameObject.transform.eulerAngles = rot; } + + + if(gameObject.transform.localEulerAngles.z > 45 && squeez) + { + waterpour.SetActive(true); + } + else + { + waterpour.SetActive(false); + } + } + + public void OnButtonPress(XRBaseInteractor interactor) + { + squeez = true; + } + public void OnButtonRelease(XRBaseInteractor interactor) + { + squeez = false; } private void OnMouseOver() { diff --git a/Project/Assets/test physics.cs b/Project/Assets/test physics.cs new file mode 100644 index 00000000..26af9445 --- /dev/null +++ b/Project/Assets/test physics.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class testphysics : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + void Abc() + { + //physics + + } +} diff --git a/Project/Assets/test physics.cs.meta b/Project/Assets/test physics.cs.meta new file mode 100644 index 00000000..88544fd1 --- /dev/null +++ b/Project/Assets/test physics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88a7d9c80c1c58c499990200550cf64e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- GitLab