本文整理汇总了C#中tk2dSpriteAnimator.Play方法的典型用法代码示例。如果您正苦于以下问题:C# tk2dSpriteAnimator.Play方法的具体用法?C# tk2dSpriteAnimator.Play怎么用?C# tk2dSpriteAnimator.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tk2dSpriteAnimator
的用法示例。
在下文中一共展示了tk2dSpriteAnimator.Play方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginAttack
IEnumerator BeginAttack()
{
direction facing = FindDirection();
ChooseAttackAnimation(facing);
Vector3 posDifference = Player.position - Zombie.position;
yield return new WaitForSeconds(0.1f);
if(_state.curState != ZombieSM.ZombieState.Attack){
yield break;
}
if(posDifference.x < 0){ // Left Attack
Attack = (Transform)Instantiate(LeftAttack, Player.position, Quaternion.identity);
}
else{ // RightAttack
Attack = (Transform)Instantiate(RightAttack, Player.position, Quaternion.identity);
}
Attack.transform.position += new Vector3(0, 0, -1);
Attack.parent = transform;
AttackAnim = Attack.GetComponent<tk2dSpriteAnimator>();
PlayRandomAttackSound();
AttackAnim.Play();
_timeSinceLastAttack = Time.time + _attackDelay; // Delays attack
StartCoroutine(RemoveAttackAnimation()); // Remove attack animation when finished
//print ("between 2 coroutines");
StartCoroutine(MovementPause(1f)); // FIX, stop when out of detection range, but in chase mode.
}
示例2: Start
// Use this for initialization
void Start()
{
anim = GetComponent<tk2dSpriteAnimator>();
anim.Play("walking");
distToGround = collider.bounds.extents.y;
gravityTotal = gravity;
sprite = GetComponent<tk2dSprite>();
}
示例3: WalkUp
public static void WalkUp(tk2dSpriteAnimator curAnim)
{
curAnim.Play("walkingBackward");
}
示例4: WalkRight
public static void WalkRight(tk2dSpriteAnimator curAnim)
{
curAnim.Play("walkingRight");
}
示例5: WalkLeft
public static void WalkLeft(tk2dSpriteAnimator curAnim)
{
curAnim.Play("walkingLeft");
}
示例6: WalkDown
public static void WalkDown(tk2dSpriteAnimator curAnim)
{
curAnim.Play("walkingForward");
}
示例7: Awake
void Awake()
{
anim = GetComponent<tk2dSpriteAnimator>();
anim.Play("stand_down");
onTeleporter = false;
isAwake = false;
ResetMatches();
Application.targetFrameRate = 60;
//Spawner s = spawner.GetComponent<Spawner>();
}
示例8: Start
void Start()
{
sprite = GetComponent<tk2dSprite>();
curAnim = GetComponent<tk2dSpriteAnimator>();
CC = GetComponent<CharacterController>();
//Debug.Log("in Zombie Start");
if(curState != ZombieState.Cutscene){
_wander = transform.GetComponent<ZombieWander>();
_chase = transform.FindChild("ZombieDetectionRange").GetComponent<ZombieChase>();
}
// Do the wander change in here, then add a "changeStateToWander" Function
// Start and stop animation so it doesn't glitch if interacting before animating starts
curAnim.Play();
curAnim.Stop();
}
示例9: BeginCharge
public void BeginCharge(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip)
{
velocity = new Vector2(movement.rSpeed * dummy.transform.localScale.x, velocity.y);
anim.Play(a_spin);
charging = true;
}
示例10: StartCharging
//small methods for Pinky's roll-up-and-charge ability
public void StartCharging(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip)
{
velocity = new Vector2(pinky.sSpeed * FacingRightMod, velocity.y);
anim.Play (a_charge);
if ((FacingRight && !canMoveRight) || (!FacingRight && !canMoveLeft)){
EndCharge ();
}
}
示例11: PinkyBigJumpAnim
public void PinkyBigJumpAnim(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip, int id)
{
anim.AnimationEventTriggered = null;
anim.Play(a_jumpBig);
}
示例12: AnimAfterDash
public void AnimAfterDash(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip)
{
anim.AnimationCompleted = null;
if (clip != anim.GetClipByName(a_endDash) || !grounded) return;
if (controller.getL || controller.getR){
anim.Play(a_walk);
}
else{
anim.Play(a_idle);
}
//reset the completed delegate so it doesn't pull this every time an animation ends
}