Skip to content

Instantly share code, notes, and snippets.

View JonRurka's full-sized avatar

jon Rurka JonRurka

View GitHub Profile
public override bool Equals(object obj) {
if (obj is Vector3Int)
{
return Equals((Vector3Int)obj);
}
return false;
}
public bool Equals(Vector3Int other)
{
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
Chunk[] chunkTemp = GameObject.FindObjectsOfType<Chunk>();
watch.Stop();
Debug.Log("time: " + watch.Elapsed.ToString() + ", chunks found: " + chunkTemp.Length);
public IEnumerator AddTrees()
{
ClearTrees();
int height = _terrain.terrainData.heightmapWidth;
int width = _terrain.terrainData.heightmapWidth;
float[,] heights = _terrain.terrainData.GetHeights(0, 0, width, height);
float[, ,] map = _terrain.terrainData.GetAlphamaps(0, 0, width - 1, height - 1);
Perlin perlin = new Perlin();
perlin.Seed = seed;
Noise2D noisePlane = new Noise2D(width, height, perlin);
testObject = new GameObject("__TestObject__");
testObject.AddComponent<WebTestComponent>();
Type testType = Assembly.GetCallingAssembly().GetType("WebTestComponent", false, true);
if (testType == null)
PConsole.LogWarning("Still null...");
public object Call_CMD(params string[] args)
{
if (args.Length >= 3)
{
Type compType = null;
foreach (Assembly assm in Assemblies.Values)
{
Type testType = assm.GetType(args[1]);
if (testType != null)
{
public void flush()
{
this.vertexBuffer.flip();
this.texCoordBuffer.flip();
this.colorBuffer.flip();
GL11.glVertexPointer(3, 0, this.vertexBuffer);
if (this.hasTexture) {
GL11.glTexCoordPointer(2, 0, this.texCoordBuffer);
}
public void Flush()
{
try
{
unsafe
{
fixed (float* pVert = vertexBuffer, pTex = texCoordBuffer, pCol = ColorBuffer)
{
GL.VertexPointer(3, 0, 0, (IntPtr)pVert);
if (hasTexture)
MemoryStream stream = new MemoryStream();
WebClient client = new WebClient();
byte[] bytes = client.DownloadData("http://nug700.github.io");
stream.Write(bytes, 0, bytes.Length);
Console.WriteLine(Encoding.ASCII.GetString(stream.ToArray()));
HtmlDocument doc = new HtmlDocument();
doc.Load(stream, Encoding.ASCII);
doc.Save("test.html"); // nothing written to file.
private enum Direction{
N ((byte)1),
W ((byte)2);
private final byte index;
Direction(byte _index){
index = _index;
}
public class Maze
{
public enum Direction
{
N = 1,
W = 2
}
Stack s_stack;
Random rand;