本文整理汇总了C#中tk2dSpriteAnimationClip类的典型用法代码示例。如果您正苦于以下问题:C# tk2dSpriteAnimationClip类的具体用法?C# tk2dSpriteAnimationClip怎么用?C# tk2dSpriteAnimationClip使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
tk2dSpriteAnimationClip类属于命名空间,在下文中一共展示了tk2dSpriteAnimationClip类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: AnimationEventDelegate
void AnimationEventDelegate(tk2dAnimatedSprite sprite, tk2dSpriteAnimationClip clip, tk2dSpriteAnimationFrame frame, int frameNum)
{
Fsm.EventData.IntData = frame.eventInt;
Fsm.EventData.StringData = frame.eventInfo;
Fsm.EventData.FloatData = frame.eventFloat;
Fsm.Event(animationTriggerEvent);
}
开发者ID:andi2,项目名称:ludum-dare-26,代码行数:7,代码来源:Tk2dPlayAnimationWithEvents.cs
示例3: ClipDeleted
public void ClipDeleted(tk2dSpriteAnimationClip clip, int param)
{
clip.Clear();
selectedClip = null;
FilterClips();
Repaint();
}
开发者ID:aprildd,项目名称:CG_BombGame,代码行数:7,代码来源:tk2dSpriteAnimationEditorPopup.cs
示例4: 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
示例5: OnFrameGroupInspectorGUI
// Check the AnimOperator class for the different supported operator types.
// This sample simply deletes the frames after the currently selected clip.
public override bool OnFrameGroupInspectorGUI(tk2dSpriteAnimationClip selectedClip,
List<ClipEditor.FrameGroup> frameGroups,
TimelineEditor.State state )
{
// WrapMode.Single is a special case - you are only allowed to have one frame in a "Single" clip.
// If you don't handle this, tk2d will truncate the list when it is Committed.
if (selectedClip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Single)
return false;
// Keep track of changes.
// In a lot of cases, a simple bool will suffice. This is used later to
// tell the system that something has changed.
bool changed = false;
GUILayout.BeginHorizontal();
if (GUILayout.Button("Ins <-", EditorStyles.miniButton))
{
frameGroups.Insert(state.selectedFrame,
AnimOperatorUtil.NewFrameGroup(frameGroups, state.selectedFrame));
// Make sure state is valid after performing your operation.
// For instance, if the selected frame is deleted, ensure it isn't selected any more.
state.selectedFrame++;
changed = true;
}
if (GUILayout.Button("Ins ->", EditorStyles.miniButton))
{
frameGroups.Insert(state.selectedFrame + 1,
AnimOperatorUtil.NewFrameGroup(frameGroups, state.selectedFrame));
changed = true;
}
GUILayout.EndHorizontal();
// Tell the caller what has changed
operations = changed ? AnimEditOperations.ClipContentChanged : AnimEditOperations.None;
return changed;
}
开发者ID:RainbowMin,项目名称:U3D-DrawRoad,代码行数:37,代码来源:SampleInsertAnimOp.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: 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
示例8: Play
public void Play(int id)
{
clipId = id;
if (id >= 0 && anim && id < anim.clips.Length)
{
currentClip = anim.clips[id];
// Simply swap, no animation is played
if (currentClip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Single || currentClip.frames == null)
{
SwitchCollectionAndSprite(currentClip.frames[0].spriteCollection, currentClip.frames[0].spriteId);
if (currentClip.frames[0].triggerEvent)
{
if (animationEventDelegate != null)
animationEventDelegate( this, currentClip, currentClip.frames[0], 0 );
}
currentClip = null;
}
else
{
clipTime = 0.0f;
previousFrame = -1;
}
}
else
{
OnCompleteAnimation();
currentClip = null;
}
}
开发者ID:polyblank2,项目名称:Platformer_Game,代码行数:31,代码来源:tk2dAnimatedSprite.cs
示例9: CopyFrom
public void CopyFrom(tk2dSpriteAnimationClip source)
{
this.name = source.name;
if (source.frames == null)
{
this.frames = null;
}
else
{
this.frames = new tk2dSpriteAnimationFrame[source.frames.Length];
for (int i = 0; i < this.frames.Length; i++)
{
if (source.frames[i] == null)
{
this.frames[i] = null;
}
else
{
this.frames[i] = new tk2dSpriteAnimationFrame();
this.frames[i].CopyFrom(source.frames[i]);
}
}
}
this.fps = source.fps;
this.loopStart = source.loopStart;
this.wrapMode = source.wrapMode;
if ((this.wrapMode == WrapMode.Single) && (this.frames.Length > 1))
{
this.frames = new tk2dSpriteAnimationFrame[] { this.frames[0] };
Debug.LogError(string.Format("Clip: '{0}' Fixed up frames for WrapMode.Single", this.name));
}
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:32,代码来源:tk2dSpriteAnimationClip.cs
示例10: tk2dSpriteAnimationClip
public tk2dSpriteAnimationClip(tk2dSpriteAnimationClip source)
{
this.name = "Default";
this.frames = new tk2dSpriteAnimationFrame[0];
this.fps = 30f;
this.CopyFrom(source);
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:7,代码来源:tk2dSpriteAnimationClip.cs
示例11: 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
示例12: 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
示例13: FrameDeploymentTrigger
void FrameDeploymentTrigger(tk2dAnimatedSprite sprite,
tk2dSpriteAnimationClip clip,
tk2dSpriteAnimationFrame frame,
int frameNum)
{
//Debug.Log("MinigunBoxController:FrameDeploymentTrigger()");
DeployGun();
}
开发者ID:jpann,项目名称:MissileDefense,代码行数:9,代码来源:MinigunBoxController.cs
示例14: Awake
void Awake()
{
mAnispr = GetComponent<tk2dSpriteAnimator>();
if (mAnispr == null)
return;
mOriClip = mAnispr.DefaultClip;
//mOriClipidx = mAnispr.DefaultClipId;
tk2dSpriteAnimationClip aniClip = mAnispr.Library.clips[mAnispr.Library.GetClipIdByName(AniName)];
mSpecAniLength = aniClip.frames.Length / aniClip.fps;
}
开发者ID:minh3d,项目名称:Fish,代码行数:10,代码来源:Ef_tk2dAniSpecPlayInterval.cs
示例15: HandleAnimationEvent
void HandleAnimationEvent(tk2dAnimatedSprite sprite, tk2dSpriteAnimationClip clip, tk2dSpriteAnimationFrame frame, int frameNum)
{
// Call FrameActionHandlers
frame.eventInfo.Split(new []{","},System.StringSplitOptions.RemoveEmptyEntries).ToList()
.ForEach(
(x) => {
frameActions[x](x,frame.eventFloat,frame.eventInt);
}
);
}
开发者ID:horsman,项目名称:survival,代码行数:10,代码来源:SVAnimatedSprite.cs
示例16: Draw
public void Draw(int windowWidth, tk2dSpriteAnimationClip clip, List<ClipEditor.FrameGroup> frameGroups, float clipTimeMarker)
{
int space = clipLeftHeaderSpace;
int requiredWidth = space + (clip.frames.Length + 1) * frameWidth;
int clipHeightTotal = (requiredWidth > windowWidth) ? clipHeightScrollBar : clipHeight;
clipScrollbar = GUILayout.BeginScrollView(clipScrollbar, GUILayout.Height(clipHeightTotal), GUILayout.ExpandWidth(true));
GUILayout.BeginVertical();
// Draw timeline axis
GUILayout.Box("", EditorStyles.toolbar, GUILayout.ExpandWidth(true));
Rect timelineRect = GUILayoutUtility.GetLastRect();
DrawAxis(clip, new Rect(timelineRect.x + space, timelineRect.y, timelineRect.width - space, timelineRect.height), frameWidth);
// Draw background and derive trigger rect
GUILayout.Box("", tk2dEditorSkin.Anim_BG, GUILayout.ExpandWidth(true), GUILayout.Height(16));
Rect triggerRect = GUILayoutUtility.GetLastRect();
// Trigger helpbox
Rect triggerHelpBox = new Rect(triggerRect.x, triggerRect.y, triggerRect.height, triggerRect.height);
if (GUIUtility.hotControl == 0 && triggerHelpBox.Contains(Event.current.mousePosition))
GUI.Label(new Rect(triggerHelpBox.x, triggerHelpBox.y, 150, triggerHelpBox.height), "Double click to add triggers", EditorStyles.whiteMiniLabel);
else
GUI.Label(triggerHelpBox, "?", EditorStyles.whiteMiniLabel);
// Control IDs
int triggerControlId = "tk2d.DrawClip.Triggers".GetHashCode();
int frameGroupControlId = "tk2d.DrawClip.FrameGroups".GetHashCode();
// Draw triggers
DrawTriggers(triggerControlId, triggerRect, clip);
// Draw frames
GUILayout.BeginHorizontal();
int framesWidth = clipLeftHeaderSpace + (clip.frames.Length + 1) * frameWidth;
Rect frameGroupRect = GUILayoutUtility.GetRect(framesWidth, 1, GUILayout.ExpandHeight(true));
DrawFrameGroups(frameGroupControlId, frameGroupRect, clip, frameGroups, clipTimeMarker);
GUILayout.EndHorizontal();
GUILayout.EndVertical();
if (Event.current.type == EventType.ScrollWheel && (Event.current.alt || Event.current.control))
{
frameWidth = Mathf.Clamp((int)(Event.current.delta.y + frameWidth), minFrameWidth, maxFrameWidth);
Repaint();
}
GUILayout.EndScrollView();
Rect scrollRect = GUILayoutUtility.GetLastRect();
DrawFrameGroupsOverlay(frameGroupControlId, new Rect(scrollRect.x + frameGroupRect.x, scrollRect.y + frameGroupRect.y, frameGroupRect.width, frameGroupRect.height), clip, frameGroups, clipTimeMarker);
}
开发者ID:KAGSme,项目名称:KJA_LD-332015,代码行数:54,代码来源:tk2dSpriteAnimationClipTimelineEditor.cs
示例17: GetClipIdByName
public int GetClipIdByName(tk2dSpriteAnimationClip clip)
{
for (int i = 0; i < this.clips.Length; i++)
{
if (this.clips[i] == clip)
{
return i;
}
}
return -1;
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:11,代码来源:tk2dSpriteAnimation.cs
示例18: ThrowCompleteDelegate
void ThrowCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
{
_state = EnemyStateEnum.Walking;
if (_state == EnemyStateEnum.Walking)
{
anim.Play("EnemyWalk");
}
else if(_state == EnemyStateEnum.Hited)
{
anim.Play("EnemyHited");
}
}
开发者ID:ultimator,项目名称:dodie,代码行数:12,代码来源:Enemy.cs
示例19: HitCompleteDelegate
void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
{
_state = EnemyStateEnum.Walking;
if (_state == EnemyStateEnum.Walking)
{
anim.Play("EnemyWalk");
}
else if (_state == EnemyStateEnum.ThrowWeapon)
{
anim.Play("ThrowWeapon");
}
}
开发者ID:ultimator,项目名称:dodie,代码行数:12,代码来源:Enemy.cs
示例20: CalculateClipMoveSpeed
float CalculateClipMoveSpeed(tk2dSpriteAnimationClip clip)
{
int moveSum = 0;
int numFrames = 0;
foreach(var frame in clip.frames){
numFrames++;
if(frame.eventInfo.Contains("move")){
moveSum += frame.eventInt;
}
}
return moveSum/numFrames * clip.fps;
}
开发者ID:horsman,项目名称:survival,代码行数:12,代码来源:SVAnimatedSprite.cs
注:本文中的tk2dSpriteAnimationClip类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论