This file contains hidden or 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
| public override bool Equals(object obj) { | |
| if (obj is Vector3Int) | |
| { | |
| return Equals((Vector3Int)obj); | |
| } | |
| return false; | |
| } | |
| public bool Equals(Vector3Int other) | |
| { |
This file contains hidden or 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
| 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); |
This file contains hidden or 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
| 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); |
This file contains hidden or 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
| testObject = new GameObject("__TestObject__"); | |
| testObject.AddComponent<WebTestComponent>(); | |
| Type testType = Assembly.GetCallingAssembly().GetType("WebTestComponent", false, true); | |
| if (testType == null) | |
| PConsole.LogWarning("Still null..."); |
This file contains hidden or 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
| 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) | |
| { |
This file contains hidden or 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
| 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); | |
| } |
This file contains hidden or 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
| public void Flush() | |
| { | |
| try | |
| { | |
| unsafe | |
| { | |
| fixed (float* pVert = vertexBuffer, pTex = texCoordBuffer, pCol = ColorBuffer) | |
| { | |
| GL.VertexPointer(3, 0, 0, (IntPtr)pVert); | |
| if (hasTexture) |
This file contains hidden or 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
| 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. |
This file contains hidden or 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
| private enum Direction{ | |
| N ((byte)1), | |
| W ((byte)2); | |
| private final byte index; | |
| Direction(byte _index){ | |
| index = _index; | |
| } | |
This file contains hidden or 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
| public class Maze | |
| { | |
| public enum Direction | |
| { | |
| N = 1, | |
| W = 2 | |
| } | |
| Stack s_stack; | |
| Random rand; |