C# Класс SimpleSprite, marblemadness

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
lowerLeftPixel Vector2
pixelDimensions Vector2

Защищенные свойства (Protected)

Свойство Тип Описание
nullCamera bool

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

Метод Описание
Clear ( ) : void
Copy ( SpriteRoot, s ) : void

Copies all the attributes of another sprite.

Create ( string name, Vector3 pos ) : SimpleSprite,

Creates a GameObject and attaches this component type to it.

Create ( string name, Vector3 pos, Quaternion rotation ) : SimpleSprite,

Creates a GameObject and attaches this component type to it.

DoMirror ( ) : void
GetDefaultPixelSize ( PathFromGUIDDelegate guid2Path, AssetLoaderDelegate loader ) : Vector2
GetStateIndex ( string stateName ) : int
InitUVs ( ) : void
SetLowerLeftPixel ( Vector2 lowerLeft ) : void

Sets the lower-left pixel of the sprite. See lowerLeftPixel

SetLowerLeftPixel ( int x, int y ) : void

Sets the lower-left pixel of the sprite. See lowerLeftPixel

SetPixelDimensions ( Vector2 size ) : void

Sets the pixel dimensions of the sprite. See pixelDimensions

SetPixelDimensions ( int x, int y ) : void

Sets the pixel dimensions of the sprite. See pixelDimensions

SetState ( int index ) : void
Setup ( float w, float h, Vector2 lowerleftPixel, Vector2 pixeldimensions ) : void

Sets up the essential elements of a sprite.

Setup ( float w, float h, Vector2 lowerleftPixel, Vector2 pixeldimensions, Material material ) : void

Sets up the essential elements of a sprite.

Start ( ) : void

Защищенные методы

Метод Описание
Awake ( ) : void
Init ( ) : void

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

Awake() защищенный Метод

protected Awake ( ) : void
Результат void

Clear() публичный Метод

public Clear ( ) : void
Результат void

Copy() публичный Метод

Copies all the attributes of another sprite.
public Copy ( SpriteRoot, s ) : void
s SpriteRoot, A reference to the sprite to be copied.
Результат void

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

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos ) : SimpleSprite,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
Результат SimpleSprite,

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

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos, Quaternion rotation ) : SimpleSprite,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
rotation Quaternion Rotation of the object.
Результат SimpleSprite,

DoMirror() публичный Метод

public DoMirror ( ) : void
Результат void

GetDefaultPixelSize() публичный Метод

public GetDefaultPixelSize ( PathFromGUIDDelegate guid2Path, AssetLoaderDelegate loader ) : Vector2
guid2Path PathFromGUIDDelegate
loader AssetLoaderDelegate
Результат Vector2

GetStateIndex() публичный Метод

public GetStateIndex ( string stateName ) : int
stateName string
Результат int

Init() защищенный Метод

protected Init ( ) : void
Результат void

InitUVs() публичный Метод

public InitUVs ( ) : void
Результат void

SetLowerLeftPixel() публичный Метод

Sets the lower-left pixel of the sprite. See lowerLeftPixel
public SetLowerLeftPixel ( Vector2 lowerLeft ) : void
lowerLeft Vector2 Pixel coordinate of the lower-left corner of the sprite.
Результат void

SetLowerLeftPixel() публичный Метод

Sets the lower-left pixel of the sprite. See lowerLeftPixel
public SetLowerLeftPixel ( int x, int y ) : void
x int X pixel coordinate.
y int Y pixel coordinate.
Результат void

SetPixelDimensions() публичный Метод

Sets the pixel dimensions of the sprite. See pixelDimensions
public SetPixelDimensions ( Vector2 size ) : void
size Vector2 Dimensions of the sprite in pixels.
Результат void

SetPixelDimensions() публичный Метод

Sets the pixel dimensions of the sprite. See pixelDimensions
public SetPixelDimensions ( int x, int y ) : void
x int X size in pixels.
y int Y size in pixels.
Результат void

SetState() публичный Метод

public SetState ( int index ) : void
index int
Результат void

Setup() публичный Метод

Sets up the essential elements of a sprite.
public Setup ( float w, float h, Vector2 lowerleftPixel, Vector2 pixeldimensions ) : void
w float The width, in local space, of the sprite.
h float The height, in local space, of the sprite.
lowerleftPixel Vector2 The coordinate of the lower-left pixel of the desired sprite on the sprite atlas.
pixeldimensions Vector2 The X and Y dimensions, in pixels, of the sprite.
Результат void

Setup() публичный Метод

Sets up the essential elements of a sprite.
public Setup ( float w, float h, Vector2 lowerleftPixel, Vector2 pixeldimensions, Material material ) : void
w float The width, in local space, of the sprite.
h float The height, in local space, of the sprite.
lowerleftPixel Vector2 The coordinate of the lower-left pixel of the desired sprite on the sprite atlas.
pixeldimensions Vector2 The X and Y dimensions, in pixels, of the sprite.
material Material The material to use for the sprite.
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Описание свойств

lowerLeftPixel публичное свойство

Position of the lower-left pixel of the sprite when no animation has been played.
public Vector2 lowerLeftPixel
Результат Vector2

nullCamera защищенное свойство

protected bool nullCamera
Результат bool

pixelDimensions публичное свойство

Dimensions, in pixels, of the sprite when no animation has been played.
public Vector2 pixelDimensions
Результат Vector2