static void FillVertical(VertexBuffer vb, Rect vertRect, OriginVertical origin, float amount) { float a = vertRect.height * amount; if (origin == OriginVertical.Bottom) { vertRect.y += (vertRect.height - a); } vertRect.height = a; vb.AddQuad(vertRect); vb.AddTriangles(); }
public static void FillVertical(OriginVertical origin, float amount, Rect vertRect, Rect uvRect, Vector3[] verts, Vector2[] uv) { if (origin == OriginVertical.Bottom) { vertRect.y += vertRect.height * (1 - amount); vertRect.height = vertRect.height * amount; uvRect.height = uvRect.height * amount; } else { vertRect.height = vertRect.height * amount; uvRect.y += uvRect.height * (1 - amount); uvRect.height = uvRect.height * amount; } NGraphics.FillVertsOfQuad(verts, 0, vertRect); NGraphics.FillUVOfQuad(uv, 0, uvRect); }
/// <summary> /// /// </summary> /// <param name="origin"></param> /// <param name="amount"></param> /// <param name="vertRect"></param> /// <param name="uvRect"></param> /// <param name="verts"></param> /// <param name="uv"></param> public static void FillVertical(OriginVertical origin, float amount, Rect vertRect, Rect uvRect, Vector3[] verts, Vector2[] uv) { if (origin == OriginVertical.Bottom) { vertRect.y += vertRect.height * (1 - amount); vertRect.height = vertRect.height * amount; uvRect.height = uvRect.height * amount; } else { vertRect.height = vertRect.height * amount; uvRect.y += uvRect.height * (1 - amount); uvRect.height = uvRect.height * amount; } NGraphics.FillVertsOfQuad(verts, 0, vertRect); NGraphics.FillUVOfQuad(uv, 0, uvRect); }