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


C# tk2dSpriteAnimationClip.GetFrame方法代码示例

本文整理汇总了C#中tk2dSpriteAnimationClip.GetFrame方法的典型用法代码示例。如果您正苦于以下问题:C# tk2dSpriteAnimationClip.GetFrame方法的具体用法?C# tk2dSpriteAnimationClip.GetFrame怎么用?C# tk2dSpriteAnimationClip.GetFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tk2dSpriteAnimationClip的用法示例。


在下文中一共展示了tk2dSpriteAnimationClip.GetFrame方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: AnimationEventHandler

 void AnimationEventHandler(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frameNum)
 {
     string str = animator.name + "\n" + clip.name + "\n" + "INFO: " + clip.GetFrame(frameNum).eventInfo;
     Debug.Log(str);
     StartCoroutine( PopupText( str ) );
 }
开发者ID:ninjasky3,项目名称:jumpplatformer,代码行数:6,代码来源:tk2dDemoAnimController.cs

示例4: OnAnimEvent

 void OnAnimEvent(tk2dSpriteAnimator aAnim, tk2dSpriteAnimationClip aClip, int frame) {
     if(anim == aAnim && aClip == mClips[(int)AnimState.attack]) {
         tk2dSpriteAnimationFrame frameDat = aClip.GetFrame(frame);
         if(frameDat.eventInfo == "actS") {
             mActActive = true;
         }
         else if(frameDat.eventInfo == "actE") {
             mActActive = false;
         }
     }
 }
开发者ID:PushoN,项目名称:game-off-2013,代码行数:11,代码来源:WeaponWhip.cs

示例5: PunchEvent

 //called on the impact frame of a punch
 void PunchEvent(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip, int frameNum)
 {
     // create the punch hit box
     GameObject clone = Instantiate(punchBox, new Vector3(transform.position.x+2,transform.position.y,0), transform.rotation) as GameObject;
     clone.transform.parent = transform;
     // set strength based on which punch it is
     // by getting the frame info from the anim trigger
         if (clip.GetFrame(frameNum).eventInfo == "punch1")
         {
             clone.GetComponent<punchCollider>().strength = punch1Strength;
         }
         if (clip.GetFrame(frameNum).eventInfo == "punch2")
         {
             clone.GetComponent<punchCollider>().strength = punch2Strength;
             clone.transform.position = new Vector3(transform.position.x+3.5f,transform.position.y,0);
         }
         if (clip.GetFrame(frameNum).eventInfo == "airPunch1")
         {
             clone.GetComponent<punchCollider>().strength = punch3Strength;
             clone.transform.position = new Vector3(transform.position.x+1.5f,transform.position.y-1f,0);
         }
         if (clip.GetFrame(frameNum).eventInfo == "uppercut1")
         {
             clone.GetComponent<punchCollider>().strength = punch4Strength;
             clone.transform.position = new Vector3(transform.position.x+1.5f,transform.position.y+1f,0);
         }
         if (clip.GetFrame(frameNum).eventInfo == "uppercut2")
         {
             clone.GetComponent<punchCollider>().strength = uppercutStrength;
             clone.transform.position = new Vector3(transform.position.x+1.5f,transform.position.y+1f,0);
             //second uppercut gets a little vertical boost
             velocity = new Vector3(0.8f,1.25f,0);
         }
         //print(frame.eventInfo);
 }
开发者ID:jpbenge,项目名称:SkullFist,代码行数:36,代码来源:skullfist_controller_2d.cs


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