C# Class SimpleSprite, marblemadness

Inheritance: MonoBehaviour
Mostrar archivo Open project: MtvnGames/marblemadness Class Usage Examples

Public Properties

Property Type Description
lowerLeftPixel Vector2
pixelDimensions Vector2

Protected Properties

Property Type Description
nullCamera bool

Public Methods

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

Protected Methods

Method Description
Awake ( ) : void
Init ( ) : void

Method Details

Awake() protected method

protected Awake ( ) : void
return void

Clear() public method

public Clear ( ) : void
return void

Copy() public method

Copies all the attributes of another sprite.
public Copy ( SpriteRoot, s ) : void
s SpriteRoot, A reference to the sprite to be copied.
return void

Create() static public method

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.
return SimpleSprite,

Create() static public method

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.
return SimpleSprite,

DoMirror() public method

public DoMirror ( ) : void
return void

GetDefaultPixelSize() public method

public GetDefaultPixelSize ( PathFromGUIDDelegate guid2Path, AssetLoaderDelegate loader ) : Vector2
guid2Path PathFromGUIDDelegate
loader AssetLoaderDelegate
return Vector2

GetStateIndex() public method

public GetStateIndex ( string stateName ) : int
stateName string
return int

Init() protected method

protected Init ( ) : void
return void

InitUVs() public method

public InitUVs ( ) : void
return void

SetLowerLeftPixel() public method

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

SetLowerLeftPixel() public method

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

SetPixelDimensions() public method

Sets the pixel dimensions of the sprite. See pixelDimensions
public SetPixelDimensions ( Vector2 size ) : void
size Vector2 Dimensions of the sprite in pixels.
return void

SetPixelDimensions() public method

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

SetState() public method

public SetState ( int index ) : void
index int
return void

Setup() public method

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

Setup() public method

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

Start() public method

public Start ( ) : void
return void

Property Details

lowerLeftPixel public_oe property

Position of the lower-left pixel of the sprite when no animation has been played.
public Vector2 lowerLeftPixel
return Vector2

nullCamera protected_oe property

protected bool nullCamera
return bool

pixelDimensions public_oe property

Dimensions, in pixels, of the sprite when no animation has been played.
public Vector2 pixelDimensions
return Vector2