aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/FragmentRequire.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/Assets/Scripts/FragmentRequire.cs b/Assets/Scripts/FragmentRequire.cs
index 4b0ab30..f0099b6 100644
--- a/Assets/Scripts/FragmentRequire.cs
+++ b/Assets/Scripts/FragmentRequire.cs
@@ -1,8 +1,6 @@
-using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
-using UnityEngine.SceneManagement;
[RequireComponent(typeof(BoxCollider))]
[ExecuteAlways]
@@ -41,9 +39,20 @@ public class FragmentRequire : MonoBehaviour
var size = new Vector3(cs.x * ts.x, cs.y * ts.y, cs.z * ts.z);
Gizmos.matrix = transform.localToWorldMatrix;
- Gizmos.color = new Color(1f, 0.18f, 0.29f, 0.1f);
- Gizmos.DrawCube(_boxCollider.center, size);
Gizmos.color = new Color(1f, 0.18f, 0.29f);
Gizmos.DrawWireCube(_boxCollider.center, size);
}
+
+ private void OnDrawGizmosSelected()
+ {
+ if (_boxCollider == null) return;
+
+ var cs = _boxCollider.size;
+ var ts = Vector3.one;
+ var size = new Vector3(cs.x * ts.x, cs.y * ts.y, cs.z * ts.z);
+
+ Gizmos.matrix = transform.localToWorldMatrix;
+ Gizmos.color = new Color(1f, 0.18f, 0.29f, 0.4f);
+ Gizmos.DrawCube(_boxCollider.center, size);
+ }
}