Пример #1
0
        private static void SetOffset(Vector2 offset, pb_Axis2d axis, pb_Object[] sel)
        {
            pbUndo.RecordObjects(sel, "Offset UVs");

            for (int i = 0; i < sel.Length; i++)
            {
                foreach (pb_Face q in sel[i].SelectedFaces)
                {
                    switch (axis)
                    {
                    case pb_Axis2d.XY:
                        q.uv.offset = offset;
                        break;

                    case pb_Axis2d.X:
                        q.uv.offset.x = offset.x;
                        break;

                    case pb_Axis2d.Y:
                        q.uv.offset.y = offset.y;
                        break;
                    }
                }
            }
        }
Пример #2
0
        private static void SetScale(Vector2 scale, pb_Axis2d axis, pb_Object[] sel)
        {
            pbUndo.RecordObjects(sel, "Scale UVs");
            for (int i = 0; i < sel.Length; i++)
            {
                foreach (pb_Face q in sel[i].SelectedFaces)
                {
                    switch (axis)
                    {
                    case pb_Axis2d.XY:
                        q.uv.scale = scale;
                        break;

                    case pb_Axis2d.X:
                        q.uv.scale.x = scale.x;
                        break;

                    case pb_Axis2d.Y:
                        q.uv.scale.y = scale.y;
                        break;
                    }
                }
            }
        }
Пример #3
0
		private static void SetScale(Vector2 scale, pb_Axis2d axis, pb_Object[] sel)
		{
			pbUndo.RecordObjects(sel, "Scale UVs");
			for(int i = 0; i < sel.Length; i++)
			{
				foreach(pb_Face q in sel[i].SelectedFaces) {
					switch(axis)
					{
						case pb_Axis2d.XY:
							q.uv.scale = scale;
							break;
						case pb_Axis2d.X:
							q.uv.scale.x = scale.x;
							break;
						case pb_Axis2d.Y:
							q.uv.scale.y = scale.y;
							break;
					}
				}
			}		
		}
Пример #4
0
		private static void SetOffset(Vector2 offset, pb_Axis2d axis, pb_Object[] sel)
		{
			pbUndo.RecordObjects(sel, "Offset UVs");

			for(int i = 0; i < sel.Length; i++)
			{
				foreach(pb_Face q in sel[i].SelectedFaces) {
					switch(axis)
					{
						case pb_Axis2d.XY:
							q.uv.offset = offset;
							break;
						case pb_Axis2d.X:
							q.uv.offset.x = offset.x;
							break;
						case pb_Axis2d.Y:
							q.uv.offset.y = offset.y;
							break;
					}
				}
			}		
		}