|
@@ -1,6 +1,3 @@
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Collections;
|
|
|
-using Blue;
|
|
|
using SC.XR.Unity.Module_InputSystem;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
@@ -10,7 +7,7 @@ public class Patch_VideoController : AbstractController
|
|
|
{
|
|
|
[SerializeField] private BoundingBox boundingBox;
|
|
|
[SerializeField] private ManipulationHandler manipulationHandler;
|
|
|
- [SerializeField] private GameObject obj_BoundingBox;
|
|
|
+
|
|
|
void Start()
|
|
|
{
|
|
|
if (GetComponent<ManipulationHandler>() != null)
|
|
@@ -22,26 +19,7 @@ public class Patch_VideoController : AbstractController
|
|
|
{
|
|
|
Destroy(boundingBox);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- this.RegisterEvent<Patch_VideoEvent>(e=>
|
|
|
- {
|
|
|
- if(e.set)
|
|
|
- {
|
|
|
- manipulationHandler = gameObject.AddComponent<ManipulationHandler>();
|
|
|
-
|
|
|
- boundingBox.enabled = true;
|
|
|
- manipulationHandler.enabled = true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (transform.Find("BoundingBox").gameObject != null)
|
|
|
- Destroy(transform.Find("BoundingBox").gameObject);
|
|
|
- boundingBox.enabled = false;
|
|
|
- Destroy(manipulationHandler);
|
|
|
- }
|
|
|
- });
|
|
|
- */
|
|
|
+
|
|
|
toggle = GameObject.Find("SetBtn/Canvas/Parent/EditorBtn/Toggle").GetComponent<Toggle>();
|
|
|
}
|
|
|
|
|
@@ -50,45 +28,27 @@ public class Patch_VideoController : AbstractController
|
|
|
{
|
|
|
if(!toggle.isOn)
|
|
|
{
|
|
|
- if (transform.Find("BoundingBox").gameObject != null)
|
|
|
- Destroy(transform.Find("BoundingBox").gameObject);
|
|
|
if(manipulationHandler!=null)
|
|
|
Destroy(manipulationHandler);
|
|
|
- if(boundingBox!=null)
|
|
|
+ if (boundingBox != null)
|
|
|
+ {
|
|
|
Destroy(boundingBox);
|
|
|
+ if (transform.Find("BoundingBox").gameObject != null)
|
|
|
+ Destroy(transform.Find("BoundingBox").gameObject);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (manipulationHandler == null)
|
|
|
{
|
|
|
manipulationHandler = gameObject.AddComponent<ManipulationHandler>();
|
|
|
- if(manipulationHandler.enabled==false)
|
|
|
- {
|
|
|
- manipulationHandler.enabled = true;
|
|
|
- }
|
|
|
}
|
|
|
if (boundingBox == null)
|
|
|
{
|
|
|
boundingBox = gameObject.AddComponent<BoundingBox>();
|
|
|
- if(boundingBox.enabled==false)
|
|
|
- {
|
|
|
- boundingBox.enabled = true;
|
|
|
- StartCoroutine(Set());
|
|
|
- Debug.LogError(boundingBox.ActiveHandle);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- boundingBox.FlattenAxis = FlattenModeType.FlattenZ;
|
|
|
- boundingBox.ActiveHandle = HandleType.Rotation | HandleType.Scale;
|
|
|
- }
|
|
|
+ boundingBox.FlattenAxis = FlattenModeType.FlattenZ;
|
|
|
+ boundingBox.ActiveHandle = HandleType.Rotation | HandleType.Scale;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- private IEnumerator Set()
|
|
|
- {
|
|
|
- yield return null;
|
|
|
- boundingBox.FlattenAxis = FlattenModeType.FlattenZ;
|
|
|
- boundingBox.ActiveHandle = HandleType.Rotation | HandleType.Scale;
|
|
|
- }
|
|
|
}
|