Beispiel #1
0
 public OCChunkRenderer GetChunkRendererInstance()
 {
     if (chunkRenderer == null)
     {
         chunkRenderer = OCChunkRenderer.CreateChunkRenderer(position, map, this);
     }
     return(chunkRenderer);
 }
Beispiel #2
0
        public static OCChunkRenderer CreateChunkRenderer(Vector3i pos, OpenCog.Map.OCMap map, OCChunk chunk)
        {
            UnityEngine.GameObject go = new UnityEngine.GameObject("(" + pos.x + " " + pos.y + " " + pos.z + ")", typeof(UnityEngine.MeshFilter), typeof(UnityEngine.MeshRenderer), typeof(OpenCog.Map.OCChunkRenderer));
            go.transform.parent        = map.transform;
            go.transform.localPosition = new UnityEngine.Vector3(pos.x * OpenCog.Map.OCChunk.SIZE_X, pos.y * OpenCog.Map.OCChunk.SIZE_Y, pos.z * OpenCog.Map.OCChunk.SIZE_Z);
            go.transform.localRotation = UnityEngine.Quaternion.identity;
            go.transform.localScale    = UnityEngine.Vector3.one;

            OCChunkRenderer chunkRenderer = go.GetComponent <OCChunkRenderer>();

            chunkRenderer.BlockSet = map.GetBlockSet();
            chunkRenderer.Chunk    = chunk;

            go.renderer.castShadows    = false;
            go.renderer.receiveShadows = false;

            return(chunkRenderer);
        }
		public OCChunkRenderer GetChunkRendererInstance() {
			if(chunkRenderer == null) chunkRenderer = OCChunkRenderer.CreateChunkRenderer(position, map, this);
			return chunkRenderer;
		}