当前位置: 首页>>代码示例>>C#>>正文


C# tk2dSpriteAnimator.Play方法代码示例

本文整理汇总了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.
    }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:29,代码来源:ZombieAttackSlash.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<tk2dSpriteAnimator>();
     anim.Play("walking");
     distToGround = collider.bounds.extents.y;
     gravityTotal = gravity;
     sprite = GetComponent<tk2dSprite>();
 }
开发者ID:poemdexter,项目名称:2DToolkit-Game,代码行数:9,代码来源:DoctorScript.cs

示例3: WalkUp

 public static void WalkUp(tk2dSpriteAnimator curAnim)
 {
     curAnim.Play("walkingBackward");
 }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:4,代码来源:ZombieInfo.cs

示例4: WalkRight

 public static void WalkRight(tk2dSpriteAnimator curAnim)
 {
     curAnim.Play("walkingRight");
 }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:4,代码来源:ZombieInfo.cs

示例5: WalkLeft

 public static void WalkLeft(tk2dSpriteAnimator curAnim)
 {
     curAnim.Play("walkingLeft");
 }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:4,代码来源:ZombieInfo.cs

示例6: WalkDown

 public static void WalkDown(tk2dSpriteAnimator curAnim)
 {
     curAnim.Play("walkingForward");
 }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:4,代码来源:ZombieInfo.cs

示例7: Awake

 void Awake()
 {
     anim = GetComponent<tk2dSpriteAnimator>();
     anim.Play("stand_down");
     onTeleporter = false;
     isAwake = false;
     ResetMatches();
     Application.targetFrameRate = 60;
     //Spawner s = spawner.GetComponent<Spawner>();
 }
开发者ID:roaet,项目名称:stuffuv,代码行数:10,代码来源:Player.cs

示例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();
    }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:18,代码来源:ZombieSM.cs

示例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;
 }
开发者ID:TimuSumisu,项目名称:recess-race,代码行数:6,代码来源:Doc.cs

示例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 ();
     }
 }
开发者ID:TimuSumisu,项目名称:recess-race,代码行数:9,代码来源:Fitz.cs

示例11: PinkyBigJumpAnim

 public void PinkyBigJumpAnim(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip, int id)
 {
     anim.AnimationEventTriggered = null;
     anim.Play(a_jumpBig);
 }
开发者ID:TimuSumisu,项目名称:recess-race,代码行数:5,代码来源:Fitz.cs

示例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
    }
开发者ID:TimuSumisu,项目名称:recess-race,代码行数:14,代码来源:Fitz.cs


注:本文中的tk2dSpriteAnimator.Play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。