Init
This commit is contained in:
15
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/DrawLine.cs
vendored
Normal file
15
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/DrawLine.cs
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DestroyIt
|
||||
{
|
||||
public class DrawLine : MonoBehaviour
|
||||
{
|
||||
public bool isActive = true;
|
||||
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
if (isActive)
|
||||
Gizmos.DrawLine(transform.position, transform.position + transform.forward * 10f);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/DrawLine.cs.meta
vendored
Normal file
8
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/DrawLine.cs.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5b614943b0745545887eb8b2678f44f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
35
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/EditorGizmos.cs
vendored
Normal file
35
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/EditorGizmos.cs
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Put this script on your _GameManager gameObject to have it draw gizmos for DestroyIt features (like cling points, support
|
||||
/// points, and structural joints). NOTE: This script is designed to only run in Editor mode, for performance reasons.
|
||||
/// </summary>
|
||||
namespace DestroyIt
|
||||
{
|
||||
public class EditorGizmos : MonoBehaviour
|
||||
{
|
||||
public bool showJointAnchors = true;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
// Checks
|
||||
if (Application.isPlaying) return;
|
||||
|
||||
// JOINT ANCHORS
|
||||
if (showJointAnchors)
|
||||
{
|
||||
Joint[] joints = Object.FindObjectsOfType<Joint>();
|
||||
if (joints.Length > 0)
|
||||
{
|
||||
foreach (Joint jnt in joints)
|
||||
{
|
||||
Vector3 pos = jnt.transform.TransformPoint(jnt.anchor);
|
||||
Gizmos.DrawWireSphere(pos, 0.05f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
8
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/EditorGizmos.cs.meta
vendored
Normal file
8
Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Gizmos/EditorGizmos.cs.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3da395340588a1e4cbbecab69ae47adc
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
Reference in New Issue
Block a user