C# Class RagePixel2.Utility

Exibir arquivo Open project: JuhaKiili/RagePixel2

Public Methods

Method Description
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

Private Methods

Method Description
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

Method Details

CreateNewSprite() public static method

public static CreateNewSprite ( int sizeX, int sizeY ) : Sprite
sizeX int
sizeY int
return UnityEngine.Sprite

DrawDebugPoint() public static method

public static DrawDebugPoint ( Vector3 point ) : void
point Vector3
return void

DrawPaintGizmo() public static method

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
return void

DrawPixelLine() public static method

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
return void

DrawRectangle() public static method

public static DrawRectangle ( Vector3 worldPosition1, Vector3 worldPosition2, Color color ) : void
worldPosition1 Vector3
worldPosition2 Vector3
color Color
return void

DrawSpriteBounds() public static method

public static DrawSpriteBounds ( Color color, Color shadowColor, Transform transform, Sprite sprite ) : void
color Color
shadowColor Color
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return void

GetDefaultPixels() public static method

public static GetDefaultPixels ( int sizeX, int sizeY ) : UnityEngine.Color32[]
sizeX int
sizeY int
return UnityEngine.Color32[]

GetNormalizedPivot() public static method

public static GetNormalizedPivot ( Sprite sprite ) : Vector2
sprite UnityEngine.Sprite
return Vector2

GetPixelMarqueeRect() public static method

public static GetPixelMarqueeRect ( IntVector2 pixelA, IntVector2 pixelB ) : Rect
pixelA Assets.RagePixel2.Editor.Utility.IntVector2
pixelB Assets.RagePixel2.Editor.Utility.IntVector2
return UnityEngine.Rect

GetPixels() public static method

public static GetPixels ( Sprite sprite ) : Color[]
sprite UnityEngine.Sprite
return Color[]

GetPixelsToUnits() public static method

public static GetPixelsToUnits ( Sprite sprite ) : float
sprite UnityEngine.Sprite
return float

GetSceneViewCenter() public static method

public static GetSceneViewCenter ( ) : Vector3
return Vector3

GetYReversed() public static method

public static GetYReversed ( Color colors, IntVector2 size ) : Color[]
colors Color
size Assets.RagePixel2.Editor.Utility.IntVector2
return Color[]

LocalToScreen() public static method

public static LocalToScreen ( Vector3 localPosition, Transform transform ) : Vector2
localPosition Vector3
transform UnityEngine.Transform
return Vector2

LocalToUV() public static method

public static LocalToUV ( Vector3 localPosition, Sprite sprite ) : Vector2
localPosition Vector3
sprite UnityEngine.Sprite
return Vector2

LocalToUV() public static method

public static LocalToUV ( Vector3 localPosition, Sprite sprite, bool clamp ) : Vector2
localPosition Vector3
sprite UnityEngine.Sprite
clamp bool
return Vector2

LocalToWorld() public static method

public static LocalToWorld ( Vector3 localPosition, Transform transform ) : Vector3
localPosition Vector3
transform UnityEngine.Transform
return Vector3

PaintColorField() public static method

public static PaintColorField ( Color value, float width, float height ) : Color
value Color
width float
height float
return Color

PixelInBounds() public static method

public static PixelInBounds ( IntVector2 pixelPosition, Sprite sprite ) : bool
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
return bool

PixelToScreen() public static method

public static PixelToScreen ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return Vector2

PixelToScreen() public static method

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
return Vector2

PixelToUV() public static method

public static PixelToUV ( IntVector2 pixel, Sprite sprite ) : Vector2
pixel Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
return Vector2

PixelToUV() public static method

public static PixelToUV ( IntVector2 pixel, Sprite sprite, bool clamp ) : Vector2
pixel Assets.RagePixel2.Editor.Utility.IntVector2
sprite UnityEngine.Sprite
clamp bool
return Vector2

PixelToWorld() public static method

public static PixelToWorld ( IntVector2 pixelPosition ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
return Vector2

PixelToWorld() public static method

public static PixelToWorld ( IntVector2 pixelPosition, Transform transform, Sprite sprite ) : Vector3
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return Vector3

PixelToWorld() public static method

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
return Vector3

SameColor() public static method

public static SameColor ( Color a, Color b ) : bool
a Color
b Color
return bool

SaveImageData() public static method

public static SaveImageData ( Sprite sprite, bool reimport ) : void
sprite UnityEngine.Sprite
reimport bool
return void

ScreenToLocal() public static method

public static ScreenToLocal ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
return Vector3

ScreenToPixel() public static method

public static ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite ) : IntVector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return Assets.RagePixel2.Editor.Utility.IntVector2

ScreenToPixel() public static method

public static ScreenToPixel ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
return Assets.RagePixel2.Editor.Utility.IntVector2

ScreenToUV() public static method

public static ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite ) : Vector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return Vector2

ScreenToUV() public static method

public static ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp ) : Vector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
return Vector2

ScreenToWorld() public static method

public static ScreenToWorld ( Vector2 screenPosition ) : Vector3
screenPosition Vector2
return Vector3

ScreenToWorld() public static method

public static ScreenToWorld ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
return Vector3

SetPixelsClamped() public static method

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
return void

ShowColorPicker() public static method

public static ShowColorPicker ( Color color ) : void
color Color
return void

UVToLocal() public static method

public static UVToLocal ( Vector2 uv, Sprite sprite ) : Vector3
uv Vector2
sprite UnityEngine.Sprite
return Vector3

UVToLocal() public static method

public static UVToLocal ( Vector2 uv, Sprite sprite, bool clamp ) : Vector3
uv Vector2
sprite UnityEngine.Sprite
clamp bool
return Vector3

UVToPixel() public static method

public static UVToPixel ( Vector2 uv, Sprite sprite ) : IntVector2
uv Vector2
sprite UnityEngine.Sprite
return Assets.RagePixel2.Editor.Utility.IntVector2

UVToPixel() public static method

public static UVToPixel ( Vector2 uv, Sprite sprite, bool clamp ) : IntVector2
uv Vector2
sprite UnityEngine.Sprite
clamp bool
return Assets.RagePixel2.Editor.Utility.IntVector2

WorldToLocal() public static method

public static WorldToLocal ( Vector3 worldPosition, Transform transform ) : Vector3
worldPosition Vector3
transform UnityEngine.Transform
return Vector3

WorldToPixel() public static method

public static WorldToPixel ( Vector2 worldPosition ) : IntVector2
worldPosition Vector2
return Assets.RagePixel2.Editor.Utility.IntVector2

WorldToPixel() public static method

public static WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite ) : IntVector2
worldPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
return Assets.RagePixel2.Editor.Utility.IntVector2

WorldToPixel() public static method

public static WorldToPixel ( Vector2 worldPosition, Transform transform, Sprite sprite, bool clamp ) : IntVector2
worldPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
clamp bool
return Assets.RagePixel2.Editor.Utility.IntVector2

WorldToScreen() public static method

public static WorldToScreen ( Vector3 worldPosition, Transform transform ) : Vector2
worldPosition Vector3
transform UnityEngine.Transform
return Vector2