void Start() { if (!camera) { gameObject.AddComponent<Camera>(); } instance = this; camera.orthographic = true; camera.nearClipPlane = 0; camera.farClipPlane = viewArea; camera.depth = 1; camera.clearFlags = CameraClearFlags.Depth; camera.cullingMask = 1 << gameObject.layer; transform.position = new Vector3(0, 0, -(viewArea/2f)); }
void Start() { if (!camera) { gameObject.AddComponent <Camera>(); } instance = this; camera.orthographic = true; camera.nearClipPlane = 0; camera.farClipPlane = viewArea; camera.depth = 1; camera.clearFlags = CameraClearFlags.Depth; camera.cullingMask = 1 << gameObject.layer; transform.position = new Vector3(0, 0, -(viewArea / 2f)); }