Skip to content

Instantly share code, notes, and snippets.

@GarethIW
Last active August 18, 2017 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GarethIW/46e6f46cdbd5474e77aebc37bd4a827a to your computer and use it in GitHub Desktop.
Save GarethIW/46e6f46cdbd5474e77aebc37bd4a827a to your computer and use it in GitHub Desktop.
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