Edit: Fixed a semicolon.
using UnityEngine;
public class ExpandRenderBox : MonoBehaviour {
public float boundSize = 1000;
private void Start () {
Mesh mesh = GetComponent<MeshFilter>().mesh;
Vector3[] verts = mesh.vertices;
int origCount = mesh.vertexCount;
System.Array.Resize<Vector3>(
Bounds bound = new Bounds(Vector3.zero, Vector3.one * boundSize);
verts[origCount] = bound.min;
verts[origCount + 1] = bound.max;
mesh.vertices = verts;
mesh.RecalculateBounds();
Destroy(this);
}
private void OnDrawGizmos()
{
Gizmos.DrawWireCube(transform.
}
}
}
No comments:
Post a Comment