To add this extension to your CinemachineCameras, use the Add Extension dropdown menu on the CinemachineCamera Inspector window. The extension detects the presence of the Pixel Perfect Camera component, and uses the component settings to calculate for the correct orthographic size of the CinemachineCamera that best retains the Sprites in a pixel-perfect resolution. The Cinemachine Pixel Perfect extension solves this incompatibility.Ĭinemachine Pixel Perfect is an extension for the CinemachineCamera that alters the orthographic size of the CinemachineCamera. Using these two systems together in a single Scene would cause them to fight for control over the Camera and produce unwanted results. ZoomOut() - Decrement the zoom scale to the next whole number limited to to 1.Using the Cinemachine Pixel Perfect extensionīoth the Pixel Perfect Camera and Cinemachine modify the Camera’s orthographic size.ZoomIn() - Increment the zoom scale to the next whole number capped to ZoomScaleMax.SetZoomImmediate(float) - Set the current zoom immediately skipping the smooth transition.SetZoom(float) - Set the current zoom level.SetSmoovZoomDuration(float) - Set the time in seconds it takes the zoom transition to go from the current scale to the next.SetZoomScaleMax(int) - Sets the upper limit of zoom.SetPixelsPerUnit(int) - This should be the same value used for all of the sprites in your scene.Note: Can possibly return a value between transitions instead of whole number depending on if the smooth transition is actively happening. currentZoomScale - Returns the current zoom scale. Control via codeĬache the PerfectPixelWithZoom Object with GetComponent() in your script.Ĭall any of the public properties and methods in your script to adjust the Camera. Select functions (methods) from the PerfectPixelWithZoom list. Link the Camera containing the PerfectPixelWithZoom component. Control via Button/Toggle triggersīe sure an Event System is in place or the buttons won't work.Īdd an On Click () or On Value Changed (boolean) to the list in the inspector. Advanced Info:Īttach the PerfectPixelWithZoom.cs as a component to the desired Camera. Smoov Zoom Duration - The time in seconds it takes the zoom transition to go from the current scale to the next.Įnter Play mode and scroll the mouse wheel back and forth.Smoov Zoom - Toggle on/off the smooth transition between zoom levels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |