void Initialize() { crt = GetComponent <CreateReflectionTexture>(); if (crt == null) { gameObject.AddComponent <CreateReflectionTexture>(); crt = GetComponent <CreateReflectionTexture>(); } CreatePlaneMesh(); randomXZ = new ComputeBuffer(width * depth, 8); setRandomDisplacementBuffer(); CreateMesh(); initValuesSWE(); initBuffersSWE(); }
void Initialize() { crt = GetComponent <CreateReflectionTexture>(); if (crt == null) { gameObject.AddComponent <CreateReflectionTexture>(); crt = GetComponent <CreateReflectionTexture>(); } mainCam.depthTextureMode = DepthTextureMode.Depth; CreatePlaneMesh(); initHeightField(); randomXZ = new ComputeBuffer(width * depth, 8); setRandomDisplacementBuffer(); CreateMesh(); initBuffers(); currentCollision = 1; }