27 lines
759 B
C#
27 lines
759 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class VolumeLightDrawer : MonoBehaviour
|
|
{
|
|
public Vector3 BoundMinPos = new Vector3(0, 0, 0);
|
|
public Vector3 BoundMaxPos = new Vector3(1, 1, 1);
|
|
[HideInInspector]public Vector3 center = Vector3.zero;
|
|
[HideInInspector]public Vector3 size = new Vector3(2, 1, 0); // Z设为0表示2D矩形
|
|
public Color lineColor = Color.green;
|
|
|
|
private void Update()
|
|
{
|
|
Shader.SetGlobalVector("_BoundMin",BoundMinPos);
|
|
Shader.SetGlobalVector("_BoundMax",BoundMaxPos);
|
|
}
|
|
|
|
void OnDrawGizmos()
|
|
{
|
|
//Gizmos.color = lineColor;
|
|
//Gizmos.DrawWireCube(transform.position + center, size);
|
|
}
|
|
}
|