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