public void ActivateHandSlicer() { TextMeshPro[] texts = GameObject.Find("ChangeHandState").GetComponentsInChildren <TextMeshPro>(); HandSlice ctplane = GameObject.Find("CTPlane3").GetComponent <HandSlice>(); ctplane.active = true; foreach (TextMeshPro tmp in texts) { tmp.text = "Deactivate Hand Slicer"; } }
public void ChangeHandSlicerState() { Debug.Log("Change Hand State Pressed"); HandSlice ctplane = GameObject.Find("CTPlane3").GetComponent <HandSlice>(); if (ctplane.active == true) { DeactivateHandSlicer(); } else { ActivateHandSlicer(); } }
public void ChangeHandness() { Debug.Log("Change Handness pressed"); TextMeshPro[] texts = GameObject.Find("ChangeHandness").GetComponentsInChildren <TextMeshPro>(); HandSlice ctplane = GameObject.Find("CTPlane3").GetComponent <HandSlice>(); if (ctplane.leftHanded == true) { ctplane.leftHanded = false; foreach (TextMeshPro tmp in texts) { tmp.text = "Use Left Hand"; } } else { ctplane.leftHanded = true; foreach (TextMeshPro tmp in texts) { tmp.text = "Use Right Hand"; } } }
// Start is called before the first frame update void Start() { GameObject handSlicer = GameObject.Find("CTPlane3"); HandSlice hs = handSlicer.GetComponent <HandSlice>(); }