mirror of
https://github.com/maxartz15/VolumetricLighting.git
synced 2024-11-10 01:02:55 +01:00
31 lines
772 B
C#
31 lines
772 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
public class Wind : MonoBehaviour {
|
|||
|
|
|||
|
[MinValue(0)]
|
|||
|
public float m_Speed = 1.0f;
|
|||
|
|
|||
|
void OnDrawGizmosSelected()
|
|||
|
{
|
|||
|
Vector3[] arrow =
|
|||
|
{
|
|||
|
new Vector3(0,0,1.5f),
|
|||
|
new Vector3( 1.0f,0.0f, 0.5f), new Vector3( 0.5f,0.0f,0.5f), new Vector3( 0.5f,0.0f,-1.0f),
|
|||
|
new Vector3(-0.5f,0.0f,-1.0f), new Vector3(-0.5f,0.0f,0.5f), new Vector3(-1.0f,0.0f, 0.5f),
|
|||
|
new Vector3(0,0,1.5f)
|
|||
|
};
|
|||
|
|
|||
|
Gizmos.matrix = transform.localToWorldMatrix;
|
|||
|
int count = arrow.Length;
|
|||
|
|
|||
|
for(int i = 0; i < count; i++)
|
|||
|
Gizmos.DrawLine(arrow[i], arrow[(i + 1) % count]);
|
|||
|
|
|||
|
Gizmos.matrix = Gizmos.matrix * Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, 90), Vector3.one);
|
|||
|
|
|||
|
for(int i = 0; i < count; i++)
|
|||
|
Gizmos.DrawLine(arrow[i], arrow[(i + 1) % count]);
|
|||
|
}
|
|||
|
|
|||
|
}
|