コード例 #1
0
 protected virtual void OnDrawGizmosSelected()
 {
     Gizmos.color = Color.yellow;
     Gizmos.matrix = transform.localToWorldMatrix;
     Vector3 origin = Vector3.zero;
     Vector3 direction = DriveAxis.GetAxisDirection(true) * (DriveLimit * 0.5f);
     Vector3 from = origin - direction;
     Vector3 to = origin + direction;
     Gizmos.DrawLine(from, to);
     Gizmos.DrawCube(from, GizmoCubeSize);
     Gizmos.DrawCube(to, GizmoCubeSize);
 }
コード例 #2
0
        protected virtual void OnDrawGizmosSelected()
        {
            Gizmos.color  = Color.yellow;
            Gizmos.matrix = transform.localToWorldMatrix;
            Vector3 origin    = HingeLocation;
            Vector3 direction = DriveAxis.GetAxisDirection(true) * (GizmoLineDistance * 0.5f);
            Vector3 from      = origin - direction;
            Vector3 to        = origin + direction;

            Gizmos.DrawLine(from, to);
            Gizmos.DrawSphere(from, GizmoSphereRadius);
            Gizmos.DrawSphere(to, GizmoSphereRadius);
        }