// Use this for initialization void Start() { _width = Screen.width; _height = Screen.height; _splats0 = new List<Splat>(); _splats1 = new List<Splat>(); _rectangle = new Mesh(); _wetMap = new WetMap(_width, _height); _threadLock = new object(); _nWetMapUpdateWorkers = 0; Application.targetFrameRate = 30; GetComponent<Camera>().orthographicSize = 0.5f * _height; var pos = GetComponent<Camera>().transform.position; pos.x = 0.5f * _width; pos.y = 0.5f * _height; GetComponent<Camera>().transform.position = pos; _rectangle.MarkDynamic(); _rectangle.vertices = new Vector3[]{ new Vector3(-1e6f, -1e6f, 0f), new Vector3(1e6f, -1e6f, 0f), new Vector3(-1e6f, 1e6f, 0f), new Vector3(1e6f, 1e6f, 0f) }; var triangles = new int[6]; triangles[0] = 0; triangles[1] = 3; triangles[2] = 1; triangles[3] = 0; triangles[4] = 2; triangles[5] = 3; _rectangle.triangles = triangles; _rectangle.bounds = new Bounds(Vector3.zero, float.MaxValue * Vector3.one); }
// Use this for initialization void Start() { _width = Screen.width; _height = Screen.height; _splats0 = new List <Splat>(); _splats1 = new List <Splat>(); _rectangle = new Mesh(); _wetMap = new WetMap(_width, _height); _threadLock = new object(); _nWetMapUpdateWorkers = 0; Application.targetFrameRate = 30; GetComponent <Camera>().orthographicSize = 0.5f * _height; var pos = GetComponent <Camera>().transform.position; pos.x = 0.5f * _width; pos.y = 0.5f * _height; GetComponent <Camera>().transform.position = pos; _rectangle.MarkDynamic(); _rectangle.vertices = new Vector3[] { new Vector3(-1e6f, -1e6f, 0f), new Vector3(1e6f, -1e6f, 0f), new Vector3(-1e6f, 1e6f, 0f), new Vector3(1e6f, 1e6f, 0f) }; var triangles = new int[6]; triangles[0] = 0; triangles[1] = 3; triangles[2] = 1; triangles[3] = 0; triangles[4] = 2; triangles[5] = 3; _rectangle.triangles = triangles; _rectangle.bounds = new Bounds(Vector3.zero, float.MaxValue * Vector3.one); }