/** @private */ public static void returnObject(TimelineState timeline) { if (_pool.IndexOf(timeline) < 0) { _pool.Add(timeline); } timeline.clearVaribles(); }
/** @private */ public static void returnObject(TimelineState timeline) { if(_pool.IndexOf(timeline) < 0) { _pool.Add(timeline); } timeline.clearVaribles(); }
/** @private */ public static TimelineState borrowObject() { if (_pool.Count == 0) { return(new TimelineState()); } TimelineState timelineState = _pool[_pool.Count - 1]; _pool.RemoveAt(_pool.Count - 1); return(timelineState); }
private void addTimelineState(string timelineName) { Bone bone = _armature.GetBone(timelineName); if (bone != null) { TimelineState timelineState = TimelineState.borrowObject(); TransformTimeline timeline = _clip.GetTimeline(timelineName); timelineState.FadeIn(bone, this, timeline); _timelineStates[timelineName] = timelineState; } }
/** @private */ public static void clear() { int i = _pool.Count; while (i-- > 0) { _pool[i].clearVaribles(); } _pool.Clear(); TimelineState.clear(); }
/** @private */ public void arriveAtFrame(Frame frame, TimelineState timelineState, AnimationState animationState, bool isCross) { if(frame!=null) { int mixingType = animationState.GetMixingTransform(Name); if(animationState.DisplayControl && (mixingType == 2 || mixingType == -1)) { if( DisplayController==null || DisplayController == animationState.Name ) { TransformFrame tansformFrame = frame as TransformFrame; if(_slot!=null) { int displayIndex = tansformFrame.DisplayIndex; if(displayIndex >= 0) { if(!float.IsNaN(tansformFrame.ZOrder) && tansformFrame.ZOrder != _slot._tweenZorder) { _slot._tweenZorder = tansformFrame.ZOrder; this._armature._slotsZOrderChanged = true; } } _slot.changeDisplay(displayIndex); _slot.updateVisible(tansformFrame.Visible); } } } if(frame.Evt!=null && this._armature.HasEventListener(FrameEvent.BONE_FRAME_EVENT)) { FrameEvent frameEvent = new FrameEvent(FrameEvent.BONE_FRAME_EVENT); frameEvent.Bone = this; frameEvent.AnimationState = animationState; frameEvent.FrameLabel = frame.Evt; this._armature._eventList.Add(frameEvent); } if(frame.Sound!=null && _soundManager.HasEventListener(SoundEvent.SOUND)) { SoundEvent soundEvent = new SoundEvent(SoundEvent.SOUND); soundEvent.Armature = this._armature; soundEvent.AnimationState = animationState; soundEvent.Sound = frame.Sound; _soundManager.DispatchEvent(soundEvent); } if(frame.Action!=null) { foreach(DBObject child in _children) { if(child is Slot) { Armature childArmature = (child as Slot).ChildArmature; if(childArmature!=null) { childArmature.Animation.GotoAndPlay(frame.Action); } } } } } else { if(_slot!=null) { _slot.changeDisplay(-1); } } }
private void removeTimelineState(string timelineName) { TimelineState.returnObject(_timelineStates[timelineName] as TimelineState); _timelineStates.Remove(timelineName); }