mirror of
https://github.com/OMGeeky/GameDevGameJamV2.git
synced 2026-01-15 07:52:41 +01:00
Movement & Attaching etc.
also cleanup
This commit is contained in:
26
Assets/Scripts/GizmosExtended.cs
Normal file
26
Assets/Scripts/GizmosExtended.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public static class GizmosExtended
|
||||
{
|
||||
public static void DrawCubeWithLocalSpace( Vector3 center , float size , Transform transform )
|
||||
{
|
||||
var s = new Vector3( size , size , -1 );
|
||||
Gizmos.matrix = Matrix4x4.TRS( transform.TransformPoint( Vector3.zero ) , transform.rotation , transform.lossyScale );
|
||||
Gizmos.DrawCube( Vector3.zero , Vector3.one + s );
|
||||
|
||||
|
||||
// var pUR = (Vector2) center + new Vector2( size.x , size.y );
|
||||
// var pUL = (Vector2) center + new Vector2( -size.x , size.y );
|
||||
// var pDR = (Vector2) center + new Vector2( size.x , -size.y );
|
||||
// var pDL = (Vector2) center + new Vector2( -size.x , -size.y );
|
||||
}
|
||||
}
|
||||
|
||||
public static class Vector2Extension
|
||||
{
|
||||
public static Vector2 Rotate( this Vector2 v , float degrees )
|
||||
{
|
||||
return Quaternion.Euler( 0 , 0 , degrees ) * v;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user