private void Update() { Camera camera = this.GetComponent <Camera>(); camera.SetPixelSizeCentered(resolution.GetFillByMultiplier(ScreenExtensions.GetSize(), 2.0f)); camera.SetOrthographicSize(resolution / pixels_per_unit); }
static public void SetPixelSizeCentered(this Camera item, Vector2 size) { item.pixelRect = RectExtensions.CreateCenterRect(ScreenExtensions.GetCenter(), size); }