spriterenderer专题

Unity 关于SpriteRenderer 和正交相机缩放

float oldWidth = 750f;float oldHeight = 1334f;float newWidth = Screen.width;float newHeight = Screen.height;float oldAspect = oldWidth / oldHeight;float newAspect = newWidth / newHeight;//水平方向缩放float

Unity 关于SpriteRenderer 和正交相机缩放

float oldWidth = 750f;float oldHeight = 1334f;float newWidth = Screen.width;float newHeight = Screen.height;float oldAspect = oldWidth / oldHeight;float newAspect = newWidth / newHeight;//水平方向缩放float

Unity 2D SpriteRenderer filled Shader实现

最近遇到个需求需要将2D图片SpriteRenderer支持类似UGUI的Image Filled填充功能,搜了下百度居然搜不到(=_=),然后就自己研究了下Shader,下边直接上代码 目前只支持水平和垂直方向的fill填充,暂时不需要角度填充,所以这里就懒得加了,后面有机会补上角度填充功能 Shader "Sprite/Filled"{Properties{[PerRendererDat