Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.tk2DIntegration Class Reference

Static Public Member Functions

static bool IsDefinePresent ()
 Checks if the 'tk2DIsPresent' preprocessor has been defined. More...
 
static bool PlayAnimation (Transform sprite, string clipName, int frame=-1)
 Plays an animation. More...
 
static bool Is2DtkSprite (GameObject spriteObject)
 Checks if a given gameobject has a tk2dSpriteAnimator component, so long as the 'tk2DIsPresent' preprocessor has been defined. More...
 
static bool PlayAnimation (Transform sprite, string clipName, bool changeWrapMode, WrapMode wrapMode, int frame=-1)
 Plays an animation. More...
 
static void StopAnimation (Transform sprite)
 Stops all animation on a Sprite. More...
 
static bool IsAnimationPlaying (Transform sprite, string clipName)
 Checks if a 2Dtk Sprite is playing a specific animation. More...
 

Detailed Description

A class the contains a number of static functions to assist with 2D Toolkit integration. To use 2D Toolkit with Adventure Creator, the 'tk2DIsPresent' preprocessor must be defined.

Member Function Documentation

◆ Is2DtkSprite()

static bool AC.tk2DIntegration.Is2DtkSprite ( GameObject  spriteObject)
static

Checks if a given gameobject has a tk2dSpriteAnimator component, so long as the 'tk2DIsPresent' preprocessor has been defined.

Parameters
spriteObjectThe gameobject to check
Returns
True if a given gameobject has a tk2dSpriteAnimator component, so long as the 'tk2DIsPresent' preprocessor has been defined.

◆ IsAnimationPlaying()

static bool AC.tk2DIntegration.IsAnimationPlaying ( Transform  sprite,
string  clipName 
)
static

Checks if a 2Dtk Sprite is playing a specific animation.

Parameters
spriteThe Transform with the 2Dtk Sprite
clipNameThe name of the animatino clip to check for
Returns
True if the 2Dtk Sprite is playing the animation

◆ IsDefinePresent()

static bool AC.tk2DIntegration.IsDefinePresent ( )
static

Checks if the 'tk2DIsPresent' preprocessor has been defined.

Returns
True if the 'tk2DIsPresent' preprocessor has been defined

◆ PlayAnimation() [1/2]

static bool AC.tk2DIntegration.PlayAnimation ( Transform  sprite,
string  clipName,
int  frame = -1 
)
static

Plays an animation.

Parameters
spriteThe Transform with the 2Dtk Sprite
clipNameThe name of the animation clip to play
frameThe frame number to play. If >= 0, then the animation will freeze at the specified frame

◆ PlayAnimation() [2/2]

static bool AC.tk2DIntegration.PlayAnimation ( Transform  sprite,
string  clipName,
bool  changeWrapMode,
WrapMode  wrapMode,
int  frame = -1 
)
static

Plays an animation.

Parameters
spriteThe Transform with the 2Dtk Sprite
clipNameThe name of the animation clip to play
changeWrapModeIf True, then the clip's wrap mode will be changed
wrapModeThe new WrapMode to use, if changeWrapMode = True
frameThe frame number to play. If >= 0, then the animation will freeze at the specified frame

◆ StopAnimation()

static void AC.tk2DIntegration.StopAnimation ( Transform  sprite)
static

Stops all animation on a Sprite.

Parameters
spriteThe Transform with the 2Dtk Sprite