本文整理汇总了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);
}
}
示例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);
}
示例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 ) );
}
示例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;
}
}
}
示例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);
}