-
-
Save GarethIW/46e6f46cdbd5474e77aebc37bd4a827a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PicaVoxel; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class BuildSomethingBig : MonoBehaviour { | |
// Use this for initialization | |
void Start () | |
{ | |
Debug.Log("Started Build at " + Time.realtimeSinceStartup); | |
var vol = GetComponent<Volume>(); | |
vol.XSize = 320; | |
vol.YSize = 320; | |
vol.ZSize = 320; | |
vol.Frames[0].XSize = vol.XSize; | |
vol.Frames[0].YSize = vol.YSize; | |
vol.Frames[0].ZSize = vol.ZSize; | |
vol.Frames[0].Voxels = new Voxel[vol.XSize*vol.YSize*vol.ZSize]; | |
for(int i=0;i<vol.Frames[0].Voxels.Length;i++) | |
vol.Frames[0].Voxels[i] = new Voxel() | |
{ | |
Color = new Color(Random.Range(0f,1f), Random.Range(0f, 1f), Random.Range(0f, 1f)), | |
State = VoxelState.Active, | |
}; | |
vol.CreateChunks(); | |
Debug.Log("Finished Build at " + Time.realtimeSinceStartup); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment