C# Класс RagePixel2.Utility

Показать файл Открыть проект

Открытые методы

Метод Описание
CreateNewSprite ( int sizeX, int sizeY ) : Sprite
DrawDebugPoint ( Vector3 point ) : void
DrawPaintGizmo ( Vector2 screenPosition, Color color, Color shadowColor, Brush brush, Transform transform, Sprite sprite ) : void
DrawPixelLine ( Texture2D texture, Brush brush, IntVector2 p1, IntVector2 p2 ) : void
DrawRectangle ( Vector3 worldPosition1, Vector3 worldPosition2, Color color ) : void
DrawSpriteBounds ( Color color, Color shadowColor, Transform transform, Sprite sprite ) : void
GetDefaultPixels ( int sizeX, int sizeY ) : UnityEngine.Color32[]
GetNormalizedPivot ( Sprite sprite ) : Vector2
GetPixelMarqueeRect ( IntVector2 pixelA, IntVector2 pixelB ) : Rect
GetPixels ( Sprite sprite ) : Color[]
GetPixelsToUnits ( Sprite sprite ) : float
GetSceneViewCenter ( ) : Vector3
GetYReversed ( Color colors, IntVector2 size ) : Color[]
LocalToScreen ( Vector3 localPosition, Transform transform ) : Vector2
LocalToUV ( Vector3 localPosition, Sprite sprite ) : Vector2
LocalToUV ( Vector3 localPosition, Sprite sprite, bool clamp ) : Vector2
LocalToWorld ( Vector3 localPosition, Transform transform ) : Vector3
PaintColorField ( Color value, float width, float height ) : Color
PixelInBounds ( IntVector2 pixelPosition, Sprite sprite ) : bool
PixelToScreen ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector2
PixelToScreen ( IntVector2 pixelPosition, Transform transform, Sprite sprite, bool clamp ) : Vector2
PixelToUV ( IntVector2 pixel, Sprite sprite ) : Vector2
PixelToUV ( IntVector2 pixel, Sprite sprite, bool clamp ) : Vector2
PixelToWorld ( IntVector2 pixelPosition ) : Vector2
PixelToWorld ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector3
PixelToWorld ( IntVector2 pixelPosition, Transform transform, Sprite sprite, bool clamp ) : Vector3
SameColor ( Color a, Color b ) : bool
SaveImageData ( Sprite sprite, bool reimport ) : void
ScreenToLocal ( Vector2 screenPosition, Transform transform ) : Vector3
ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite ) : IntVector2
ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite ) : Vector2
ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : Vector2
ScreenToWorld ( Vector2 screenPosition ) : Vector3
ScreenToWorld ( Vector2 screenPosition, Transform transform ) : Vector3
SetPixelsClamped ( Texture2D texture, IntVector2 position, IntVector2 size, Color colors ) : void
ShowColorPicker ( Color color ) : void
UVToLocal ( Vector2 uv, Sprite sprite ) : Vector3
UVToLocal ( Vector2 uv, Sprite sprite, bool clamp ) : Vector3
UVToPixel ( Vector2 uv, Sprite sprite ) : IntVector2
UVToPixel ( Vector2 uv, Sprite sprite, bool clamp ) : IntVector2
WorldToLocal ( Vector3 worldPosition, Transform transform ) : Vector3
WorldToPixel ( Vector2 worldPosition ) : IntVector2
WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite ) : IntVector2
WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
WorldToScreen ( Vector3 worldPosition, Transform transform ) : Vector2

Приватные методы

Метод Описание
CreateDefaultSpriteTexture ( int sizeX, int sizeY ) : Texture2D
CreateNewSprite ( string path, int sizeX, int sizeY ) : Sprite
GetAlignedPivot ( SpriteAlignment alignment ) : Vector2
GetDefaultColor ( ) : Color
GetPointsOnLine ( int x0, int y0, int x1, int y1 ) : IEnumerable
GetTextureImporter ( Sprite sprite ) : TextureImporter
SetDefaultSpriteSettings ( TextureImporter &textureImporter ) : void

Описание методов

CreateNewSprite() публичный статический Метод

public static CreateNewSprite ( int sizeX, int sizeY ) : Sprite
sizeX int
sizeY int
Результат UnityEngine.Sprite

DrawDebugPoint() публичный статический Метод

public static DrawDebugPoint ( Vector3 point ) : void
point Vector3
Результат void

DrawPaintGizmo() публичный статический Метод

public static DrawPaintGizmo ( Vector2 screenPosition, Color color, Color shadowColor, Brush brush, Transform transform, Sprite sprite ) : void
screenPosition Vector2
color Color
shadowColor Color
brush Brush
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат void

DrawPixelLine() публичный статический Метод

public static DrawPixelLine ( Texture2D texture, Brush brush, IntVector2 p1, IntVector2 p2 ) : void
texture UnityEngine.Texture2D
brush Brush
p1 Assets.RagePixel2.Editor.Utility.IntVector2
p2 Assets.RagePixel2.Editor.Utility.IntVector2
Результат void

DrawRectangle() публичный статический Метод

public static DrawRectangle ( Vector3 worldPosition1, Vector3 worldPosition2, Color color ) : void
worldPosition1 Vector3
worldPosition2 Vector3
color Color
Результат void

DrawSpriteBounds() публичный статический Метод

public static DrawSpriteBounds ( Color color, Color shadowColor, Transform transform, Sprite sprite ) : void
color Color
shadowColor Color
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат void

GetDefaultPixels() публичный статический Метод

public static GetDefaultPixels ( int sizeX, int sizeY ) : UnityEngine.Color32[]
sizeX int
sizeY int
Результат UnityEngine.Color32[]

GetNormalizedPivot() публичный статический Метод

public static GetNormalizedPivot ( Sprite sprite ) : Vector2
sprite UnityEngine.Sprite
Результат Vector2

GetPixelMarqueeRect() публичный статический Метод

public static GetPixelMarqueeRect ( IntVector2 pixelA, IntVector2 pixelB ) : Rect
pixelA Assets.RagePixel2.Editor.Utility.IntVector2
pixelB Assets.RagePixel2.Editor.Utility.IntVector2
Результат UnityEngine.Rect

GetPixels() публичный статический Метод

public static GetPixels ( Sprite sprite ) : Color[]
sprite UnityEngine.Sprite
Результат Color[]

GetPixelsToUnits() публичный статический Метод

public static GetPixelsToUnits ( Sprite sprite ) : float
sprite UnityEngine.Sprite
Результат float

GetSceneViewCenter() публичный статический Метод

public static GetSceneViewCenter ( ) : Vector3
Результат Vector3

GetYReversed() публичный статический Метод

public static GetYReversed ( Color colors, IntVector2 size ) : Color[]
colors Color
size Assets.RagePixel2.Editor.Utility.IntVector2
Результат Color[]

LocalToScreen() публичный статический Метод

public static LocalToScreen ( Vector3 localPosition, Transform transform ) : Vector2
localPosition Vector3
transform UnityEngine.Transform
Результат Vector2

LocalToUV() публичный статический Метод

public static LocalToUV ( Vector3 localPosition, Sprite sprite ) : Vector2
localPosition Vector3
sprite UnityEngine.Sprite
Результат Vector2

LocalToUV() публичный статический Метод

public static LocalToUV ( Vector3 localPosition, Sprite sprite, bool clamp ) : Vector2
localPosition Vector3
sprite UnityEngine.Sprite
clamp bool
Результат Vector2

LocalToWorld() публичный статический Метод

public static LocalToWorld ( Vector3 localPosition, Transform transform ) : Vector3
localPosition Vector3
transform UnityEngine.Transform
Результат Vector3

PaintColorField() публичный статический Метод

public static PaintColorField ( Color value, float width, float height ) : Color
value Color
width float
height float
Результат Color

PixelInBounds() публичный статический Метод

public static PixelInBounds ( IntVector2 pixelPosition, Sprite sprite ) : bool
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
Результат bool

PixelToScreen() публичный статический Метод

public static PixelToScreen ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат Vector2

PixelToScreen() публичный статический Метод

public static PixelToScreen ( IntVector2 pixelPosition, Transform transform, Sprite sprite, bool clamp ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
Результат Vector2

PixelToUV() публичный статический Метод

public static PixelToUV ( IntVector2 pixel, Sprite sprite ) : Vector2
pixel Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
Результат Vector2

PixelToUV() публичный статический Метод

public static PixelToUV ( IntVector2 pixel, Sprite sprite, bool clamp ) : Vector2
pixel Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
clamp bool
Результат Vector2

PixelToWorld() публичный статический Метод

public static PixelToWorld ( IntVector2 pixelPosition ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
Результат Vector2

PixelToWorld() публичный статический Метод

public static PixelToWorld ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector3
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат Vector3

PixelToWorld() публичный статический Метод

public static PixelToWorld ( IntVector2 pixelPosition, Transform transform, Sprite sprite, bool clamp ) : Vector3
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
Результат Vector3

SameColor() публичный статический Метод

public static SameColor ( Color a, Color b ) : bool
a Color
b Color
Результат bool

SaveImageData() публичный статический Метод

public static SaveImageData ( Sprite sprite, bool reimport ) : void
sprite UnityEngine.Sprite
reimport bool
Результат void

ScreenToLocal() публичный статический Метод

public static ScreenToLocal ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
Результат Vector3

ScreenToPixel() публичный статический Метод

public static ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite ) : IntVector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат Assets.RagePixel2.Editor.Utility.IntVector2

ScreenToPixel() публичный статический Метод

public static ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
Результат Assets.RagePixel2.Editor.Utility.IntVector2

ScreenToUV() публичный статический Метод

public static ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite ) : Vector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат Vector2

ScreenToUV() публичный статический Метод

public static ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : Vector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
Результат Vector2

ScreenToWorld() публичный статический Метод

public static ScreenToWorld ( Vector2 screenPosition ) : Vector3
screenPosition Vector2
Результат Vector3

ScreenToWorld() публичный статический Метод

public static ScreenToWorld ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
Результат Vector3

SetPixelsClamped() публичный статический Метод

public static SetPixelsClamped ( Texture2D texture, IntVector2 position, IntVector2 size, Color colors ) : void
texture UnityEngine.Texture2D
position Assets.RagePixel2.Editor.Utility.IntVector2
size Assets.RagePixel2.Editor.Utility.IntVector2
colors Color
Результат void

ShowColorPicker() публичный статический Метод

public static ShowColorPicker ( Color color ) : void
color Color
Результат void

UVToLocal() публичный статический Метод

public static UVToLocal ( Vector2 uv, Sprite sprite ) : Vector3
uv Vector2
sprite UnityEngine.Sprite
Результат Vector3

UVToLocal() публичный статический Метод

public static UVToLocal ( Vector2 uv, Sprite sprite, bool clamp ) : Vector3
uv Vector2
sprite UnityEngine.Sprite
clamp bool
Результат Vector3

UVToPixel() публичный статический Метод

public static UVToPixel ( Vector2 uv, Sprite sprite ) : IntVector2
uv Vector2
sprite UnityEngine.Sprite
Результат Assets.RagePixel2.Editor.Utility.IntVector2

UVToPixel() публичный статический Метод

public static UVToPixel ( Vector2 uv, Sprite sprite, bool clamp ) : IntVector2
uv Vector2
sprite UnityEngine.Sprite
clamp bool
Результат Assets.RagePixel2.Editor.Utility.IntVector2

WorldToLocal() публичный статический Метод

public static WorldToLocal ( Vector3 worldPosition, Transform transform ) : Vector3
worldPosition Vector3
transform UnityEngine.Transform
Результат Vector3

WorldToPixel() публичный статический Метод

public static WorldToPixel ( Vector2 worldPosition ) : IntVector2
worldPosition Vector2
Результат Assets.RagePixel2.Editor.Utility.IntVector2

WorldToPixel() публичный статический Метод

public static WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite ) : IntVector2
worldPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Результат Assets.RagePixel2.Editor.Utility.IntVector2

WorldToPixel() публичный статический Метод

public static WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
worldPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
Результат Assets.RagePixel2.Editor.Utility.IntVector2

WorldToScreen() публичный статический Метод

public static WorldToScreen ( Vector3 worldPosition, Transform transform ) : Vector2
worldPosition Vector3
transform UnityEngine.Transform
Результат Vector2