C# Class RagePixel2.Utility

Afficher le fichier Open project: JuhaKiili/RagePixel2

Méthodes publiques

Méthode 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

Méthode 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 méthode

public static CreateNewSprite ( int sizeX, int sizeY ) : Sprite
sizeX int
sizeY int
Résultat UnityEngine.Sprite

DrawDebugPoint() public static méthode

public static DrawDebugPoint ( Vector3 point ) : void
point Vector3
Résultat void

DrawPaintGizmo() public static méthode

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
Résultat void

DrawPixelLine() public static méthode

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
Résultat void

DrawRectangle() public static méthode

public static DrawRectangle ( Vector3 worldPosition1, Vector3 worldPosition2, Color color ) : void
worldPosition1 Vector3
worldPosition2 Vector3
color Color
Résultat void

DrawSpriteBounds() public static méthode

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

GetDefaultPixels() public static méthode

public static GetDefaultPixels ( int sizeX, int sizeY ) : UnityEngine.Color32[]
sizeX int
sizeY int
Résultat UnityEngine.Color32[]

GetNormalizedPivot() public static méthode

public static GetNormalizedPivot ( Sprite sprite ) : Vector2
sprite UnityEngine.Sprite
Résultat Vector2

GetPixelMarqueeRect() public static méthode

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

GetPixels() public static méthode

public static GetPixels ( Sprite sprite ) : Color[]
sprite UnityEngine.Sprite
Résultat Color[]

GetPixelsToUnits() public static méthode

public static GetPixelsToUnits ( Sprite sprite ) : float
sprite UnityEngine.Sprite
Résultat float

GetSceneViewCenter() public static méthode

public static GetSceneViewCenter ( ) : Vector3
Résultat Vector3

GetYReversed() public static méthode

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

LocalToScreen() public static méthode

public static LocalToScreen ( Vector3 localPosition, Transform transform ) : Vector2
localPosition Vector3
transform UnityEngine.Transform
Résultat Vector2

LocalToUV() public static méthode

public static LocalToUV ( Vector3 localPosition, Sprite sprite ) : Vector2
localPosition Vector3
sprite UnityEngine.Sprite
Résultat Vector2

LocalToUV() public static méthode

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

LocalToWorld() public static méthode

public static LocalToWorld ( Vector3 localPosition, Transform transform ) : Vector3
localPosition Vector3
transform UnityEngine.Transform
Résultat Vector3

PaintColorField() public static méthode

public static PaintColorField ( Color value, float width, float height ) : Color
value Color
width float
height float
Résultat Color

PixelInBounds() public static méthode

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

PixelToScreen() public static méthode

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

PixelToScreen() public static méthode

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
Résultat Vector2

PixelToUV() public static méthode

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

PixelToUV() public static méthode

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

PixelToWorld() public static méthode

public static PixelToWorld ( IntVector2 pixelPosition ) : Vector2
pixelPosition Assets.RagePixel2.Editor.Utility.IntVector2
Résultat Vector2

PixelToWorld() public static méthode

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

PixelToWorld() public static méthode

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
Résultat Vector3

SameColor() public static méthode

public static SameColor ( Color a, Color b ) : bool
a Color
b Color
Résultat bool

SaveImageData() public static méthode

public static SaveImageData ( Sprite sprite, bool reimport ) : void
sprite UnityEngine.Sprite
reimport bool
Résultat void

ScreenToLocal() public static méthode

public static ScreenToLocal ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
Résultat Vector3

ScreenToPixel() public static méthode

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

ScreenToPixel() public static méthode

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

ScreenToUV() public static méthode

public static ScreenToUV ( Vector2 screenPosition, Transform transform, Sprite sprite ) : Vector2
screenPosition Vector2
transform UnityEngine.Transform
sprite UnityEngine.Sprite
Résultat Vector2

ScreenToUV() public static méthode

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

ScreenToWorld() public static méthode

public static ScreenToWorld ( Vector2 screenPosition ) : Vector3
screenPosition Vector2
Résultat Vector3

ScreenToWorld() public static méthode

public static ScreenToWorld ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
Résultat Vector3

SetPixelsClamped() public static méthode

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
Résultat void

ShowColorPicker() public static méthode

public static ShowColorPicker ( Color color ) : void
color Color
Résultat void

UVToLocal() public static méthode

public static UVToLocal ( Vector2 uv, Sprite sprite ) : Vector3
uv Vector2
sprite UnityEngine.Sprite
Résultat Vector3

UVToLocal() public static méthode

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

UVToPixel() public static méthode

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

UVToPixel() public static méthode

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

WorldToLocal() public static méthode

public static WorldToLocal ( Vector3 worldPosition, Transform transform ) : Vector3
worldPosition Vector3
transform UnityEngine.Transform
Résultat Vector3

WorldToPixel() public static méthode

public static WorldToPixel ( Vector2 worldPosition ) : IntVector2
worldPosition Vector2
Résultat Assets.RagePixel2.Editor.Utility.IntVector2

WorldToPixel() public static méthode

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

WorldToPixel() public static méthode

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

WorldToScreen() public static méthode

public static WorldToScreen ( Vector3 worldPosition, Transform transform ) : Vector2
worldPosition Vector3
transform UnityEngine.Transform
Résultat Vector2