public void walk() { // print("PlayerAnimationController walk"); //mAnimationState.SetAnimation(1, walkName, true); // mSkeletonAnimation.AnimationName = walkName; // if(mAnimationState.GetCurrent(1).) mAnimationState.TimeScale = 2f; //if (state != walkName) //{ Spine.TrackEntry now = mAnimationState.GetCurrent(1); if (now != null && now.animation != null && now.animation.name == walkName && !now.IsComplete) { //此时请动画正在执行。 } else { Spine.TrackEntry entry = mAnimationState.SetAnimation(1, walkName, false); } // print("entry is "+entry); //} // entry. state = walkName; }
private void AnimationState_Complete(Spine.AnimationState state, int trackIndex, int loopCount) { if (state.GetCurrent(0).animation.name.Equals("dui")) { SceneMgr.getInstance().popResoult(); } else if (state.GetCurrent(0).animation.name.Equals("cuo")) { showRightAnswer(); } }
// returns if the current animation is completed or not, this will return true for looped animations if the time has passed the duration of 1 single complete play. public bool IsComplete() { TrackEntry track = animation.GetCurrent(0); if (track != null) { // time is more then the end time but looping is set to false // ** with looping set to true time can be larger then end time. if (track.time >= track.EndTime && !track.loop) { return(true); } } return(false); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (state == null) { Initialize(animator); } float timeScale = stateInfo.speed; TrackEntry current = state.GetCurrent(layerIndex); bool transitionPlayed = false; if (current != null && fromTransitions.Count > 0) { transitionPlayed = SetTransition(animator, current, timeScale, layerIndex); } if (!transitionPlayed && DefaultTransition) { var transitionEntry = state.SetAnimation(layerIndex, DefaultTransition, false); transitionEntry.TimeScale = timeScale; transitionPlayed = true; } if (transitionPlayed) { trackEntry = state.AddAnimation(layerIndex, GetAnimmationAsset(animator).Animation, bIsLoop, 0); } else { trackEntry = state.SetAnimation(layerIndex, GetAnimmationAsset(animator).Animation, bIsLoop); } trackEntry.TimeScale = timeScale; }
void OnAnimaEvent(Spine.AnimationState state, int trackIndex, Spine.Event e) { if (Event != null) { Event(state.GetCurrent(trackIndex).Animation.Name, e); } }
// Finds the next empty track and sets it private void FindNewFreeTrack() { int prospectiveTrack = _freeTrackIndex++; while (_animState.GetCurrent(prospectiveTrack) != null) { prospectiveTrack++; } _freeTrackIndex = prospectiveTrack; }
static int GetCurrent(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Spine.AnimationState obj = (Spine.AnimationState)ToLua.CheckObject(L, 1, typeof(Spine.AnimationState)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); Spine.TrackEntry o = obj.GetCurrent(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (state == null) { Initialize(animator); } float timeScale = stateInfo.speed; var current = state.GetCurrent(layerIndex); bool transitionPlayed = false; if (current != null && fromTransitions.Count > 0) { foreach (var t in fromTransitions) { if (t.from.Animation == current.Animation) { var transitionEntry = state.SetAnimation(layerIndex, t.transition.Animation, false); transitionEntry.TimeScale = timeScale; transitionPlayed = true; break; } } } TrackEntry trackEntry; if (transitionPlayed) { trackEntry = state.AddAnimation(layerIndex, animation.Animation, stateInfo.loop, 0); } else { trackEntry = state.SetAnimation(layerIndex, animation.Animation, stateInfo.loop); } trackEntry.TimeScale = timeScale; }
public void Complete(AnimationState state, int trackIndex, int loopCount) { Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": complete " + loopCount); }
public void Event(AnimationState state, int trackIndex, Event e) { Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e); }
public void Event(AnimationState state, int trackIndex, Event e) { CCLog.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e); }
public void Complete(AnimationState state, int trackIndex, int loopCount) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": complete " + loopCount); #endif }
public void Event(Spine.AnimationState state, int trackIndex, Spine.Event e) { Debug.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e + ", " + e.Int); }
TrackEntry GetCurrent(int layerIndex = 0) { return(_skeletonState.GetCurrent(layerIndex)); }
public void Start(object sender, StartEndArgs e) { Console.WriteLine(e.TrackIndex + " " + state.GetCurrent(e.TrackIndex) + ": start"); }
private void CheckTracks() { Spine.AnimationState animationState = this.skeletonAnimation.AnimationState; Debug.Log(animationState.GetCurrent(0)); Debug.Log(animationState.GetCurrent(1)); }
public float GetAnimationProcess() { TrackEntry track = state.GetCurrent(0); return(track.Time / track.EndTime); }
public void End(AnimationState state, int trackIndex) { Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": end"); }
public void Complete (AnimationState state, int trackIndex, int loopCount) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": complete " + loopCount); #endif }
public void Start(AnimationState state, int trackIndex) { CCLog.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": start"); }
public void Start (AnimationState state, int trackIndex) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": start"); #endif }
/** Called when the character finishes playing an animation. */ private void OnComplete(Spine.AnimationState state, int trackIndex) { // Stores the animation which was just completed. string animation = state.GetCurrent(trackIndex).Animation.Name; }
public void Event (AnimationState state, int trackIndex, Event e) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e); #endif }
public void Start(AnimationState state, int trackIndex) { var entry = state.GetCurrent(trackIndex); var animationName = (entry != null && entry.Animation != null) ? entry.Animation.Name : string.Empty; CCLog.Log(trackIndex + ":start " + animationName); }
public void Start(AnimationState state, int trackIndex) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": start"); #endif }
public void End(AnimationState state, int trackIndex) { CCLog.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": end"); }
public void Event(AnimationState state, int trackIndex, Event e) { #if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e); #endif }
public void Complete(AnimationState state, int trackIndex, int loopCount) { CCLog.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": complete " + loopCount); }