12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System.Collections;
- using Blue;
- using SC.XR.Unity.Module_InputSystem;
- using UnityEngine;
- using UnityEngine.UI;
- public class Patch_VideoController : AbstractController
- {
- [SerializeField] private BoundingBox boundingBox;
- [SerializeField] private ManipulationHandler manipulationHandler;
- [SerializeField] private GameObject obj_BoundingBox;
- void Start()
- {
- if (GetComponent<ManipulationHandler>() != null)
- {
- Destroy(manipulationHandler);
- }
-
- toggle = GameObject.Find("SetBtn/Canvas/Parent/EditorBtn/Toggle").GetComponent<Toggle>();
- }
- private Toggle toggle;
- private bool des;
- private void Update()
- {
- if(!toggle.isOn)
- {
- if(des)
- {
- if (transform.Find("BoundingBox").gameObject != null)
- Destroy(transform.Find("BoundingBox").gameObject);
- boundingBox.enabled = false;
- Destroy(manipulationHandler);
- des = false;
- }
- }
- else
- {
- if(!des)
- {
- manipulationHandler = gameObject.AddComponent<ManipulationHandler>();
-
- boundingBox.enabled = true;
- manipulationHandler.enabled = true;
- des = true;
- }
- }
- }
- }
|