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


C# tk2dSpriteAnimator类代码示例

本文整理汇总了C#中tk2dSpriteAnimator的典型用法代码示例。如果您正苦于以下问题:C# tk2dSpriteAnimator类的具体用法?C# tk2dSpriteAnimator怎么用?C# tk2dSpriteAnimator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


tk2dSpriteAnimator类属于命名空间,在下文中一共展示了tk2dSpriteAnimator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FlameOnDelegate

    void FlameOnDelegate(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frameNumber)
    {
        if(clip.GetFrame(frameNumber).eventInfo.Equals("FlameOn"))
        {
            string fireTag = fireHitObject.tag;

            if (fireTag.Equals("Throwable"))
            {
                Vector3 position = fireHitObject.transform.position;
                position.z = charcoalParticleEffect.transform.position.z;

                // KILL THE PEASANTS
                Destroy(fireHitObject);

                // BURNINATE THE PEASANTS (particle effects)
                ParticleSystem localCharcoal = GameObject.Instantiate(charcoalParticleEffect, position, charcoalParticleEffect.transform.rotation) as ParticleSystem;
                localCharcoal.Play();
            }
            else if (fireTag.Equals("Player"))
            {
                // TODO: tell player to get bumped
            }
        }

        if(clip.GetFrame(frameNumber).eventInfo.Equals("DragonFootStep"))
        {
            AudioSource.PlayClipAtPoint(footSteps[Random.Range( 0, footSteps.Count )], transform.position);
        }
    }
开发者ID:poemdexter,项目名称:IndieSpeedRun2013,代码行数:29,代码来源:DragonBehavior.cs

示例2: Handle_YunMuAnimating

 void Handle_YunMuAnimating(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip, int frameNum)
 {
     tk2dSprite mspr  = sprite.GetComponent<tk2dSprite>( );
     Color c = mspr.color;
     c.a = mYunMuCurrentAlpha;
     mspr.color = c;
 }
开发者ID:minh3d,项目名称:Fish,代码行数:7,代码来源:ScenePrelude_FlowerEmit.cs

示例3: FireCompleteDelegate

 // done breathing fire, just walk again
 void FireCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
 {
     if(clip.name.Equals("Fire"))
     {
         anim.Play("Walk");
     }
 }
开发者ID:poemdexter,项目名称:IndieSpeedRun2013,代码行数:8,代码来源:DragonBehavior.cs

示例4: 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

示例5: Start

 // Use this for initialization
 void Start()
 {
     rb = GetComponent<Rigidbody2D>();
     audios = GetComponent<AudioSource>();
     target = GameObject.Find("test_player_3");
     anim = GetComponent<tk2dSpriteAnimator>();
 }
开发者ID:Nenekiri,项目名称:Heaven-s-Handyman,代码行数:8,代码来源:bimbytheBomb.cs

示例6: Handle_FishAniStop

 void Handle_FishAniStop(tk2dSpriteAnimator sprAni, tk2dSpriteAnimationClip aniClip)
 {
     if (mFish != null && mFish.Attackable)
     {
         mFish.AniSprite.PlayFrom(mOriginClip,0F);
     }
 }
开发者ID:minh3d,项目名称:Fish,代码行数:7,代码来源:Ef_PlayAnimationWhenEatFish.cs

示例7: Start

    // Use this for initialization
    void Start () {

        clock = GameObject.Find("SimpleClock");
        clock.SetActive(false); 
        anim = GetComponent<tk2dSpriteAnimator>();

}
开发者ID:Nenekiri,项目名称:Classified,代码行数:8,代码来源:CollisionCheck.cs

示例8: HandleMovementAnimations

    // Throwing animation takes priority over all others
    public void HandleMovementAnimations(PlayerMovement.Movement m)
    {
        if (anim == null) anim = GetComponent<tk2dSpriteAnimator>();
        string clip;

        // if we're ready to throw again and we pushed throw button
        if (!throwWait && isThrowing)
        {
            clip = "throw";
            anim.AnimationCompleted = ThrowCompleteDelegate;
            anim.AnimationEventTriggered = SpawnDaggerDelegate;
            throwWait = true;
            anim.Play(clip);
        }
        else if (!throwWait) // we're not mid throw animation so run other animations
        {
            if (m.jumping || m.inAir) clip = "jump";
            else if (m.moveHorizontal) clip = "walk";
            else clip = "still";
            if (prevRemoteClip != clip)
            {
                prevRemoteClip = clip;
                anim.Play(clip);
            }
        }
    }
开发者ID:poemdexter,项目名称:Rogue-BB,代码行数:27,代码来源:PlayerAnimation.cs

示例9: 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

示例10: OnAnimationClipEnd

    protected override void OnAnimationClipEnd(tk2dSpriteAnimator aAnim, tk2dSpriteAnimationClip aClip) {
        if(anim == aAnim && aClip == mClips[(int)AnimState.attack]) {
            mActActive = false;
            mFireActive = false;
        }

        base.OnAnimationClipEnd(aAnim, aClip);
    }
开发者ID:PushoN,项目名称:game-off-2013,代码行数:8,代码来源:WeaponWhip.cs

示例11: AnimationEventDelegate

		void AnimationEventDelegate (tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip, int frameNum)
		{
			tk2dSpriteAnimationFrame frame = clip.GetFrame(frameNum);
			Fsm.EventData.IntData = frame.eventInt;
			Fsm.EventData.StringData = frame.eventInfo;
			Fsm.EventData.FloatData = frame.eventFloat;
			Fsm.Event(animationTriggerEvent);
		}
开发者ID:PushoN,项目名称:game-off-2013,代码行数:8,代码来源:Tk2dWatchAnimationEvents.cs

示例12: _getSprite

        private void _getSprite() {
            GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
            if(go == null) {
                return;
            }

            _sprite = go.GetComponent<tk2dSpriteAnimator>();
        }
开发者ID:PushoN,项目名称:game-off-2013,代码行数:8,代码来源:Tk2dGetAnimationClip.cs

示例13: OnSpawned

	void OnSpawned () {

		_spriteAnim = GetComponent<tk2dSpriteAnimator>();

		if (anim)
			_spriteAnim.PlayFromFrame(0);

		StartCoroutine (TimedDespawn());
	}
开发者ID:hiddenswitch,项目名称:Zombies,代码行数:9,代码来源:Despawn.cs

示例14: HitCompleteDelegate

 // This is called once the hit animation has compelted playing
 // It returns to playing whatever animation was active before hit
 // was playing.
 void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
 {
     if (walking) {
         anim.Play("walk");
     }
     else {
         anim.Play("idle");
     }
 }
开发者ID:RainbowMin,项目名称:U3D-DrawRoad,代码行数:12,代码来源:TutorialAnimController.cs

示例15: Awake

    void Awake()
    {
        // Setting up references.
        groundCheck = transform.Find("groundCheck");

        anim = GetComponent<tk2dSpriteAnimator> ();

        jumpSound = GetComponent<AudioSource> ();
    }
开发者ID:savethejets,项目名称:Ludum-Dare-29,代码行数:9,代码来源:PlayerControl.cs


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