主要參考:
方法是透過 Action 來獲取。
如要查找 Event ID 可以安裝 Script Listener,安裝指引見 Photoshop Scripting Guide 的 73 頁。
但目前的 Code 只能獲取剛剛輸入的值,不能直接獲取既有的值…
但目前的 Code 只能獲取剛剛輸入的值,不能直接獲取既有的值…
Flash ZXP檔案下載(Google Drive)
安裝Extension後再去Flash中為命令設定Hotkey
Flash Power Tool - Electric Dog Flash Animation Power Tools要注意這個工具是從強化Flash的操作之角度所設計,而其提供的一些功能(commands)其實都可以手動完成,EDAPT只是幫你做了自動化處理,當然也有手動無法替代的功能,這就是他最重要的部份。
原點{x:0, y:0}在左上角
+x向右
+y向下
![]() |
| 可見參數可以控制元件的顯示狀態 |
![]() |
| 可見參數會被DragonBones輸出為hide參數 |
Applying Root MotionMitch 提供了一個解決方案
Had to modify SkeletonAnimation and add a callback between Update and Apply because the Time and LastTime are set to be equivalent by the time UpdateBones is called.修改了SkeletonAnimation.cs以及SkeletonRootMotion.cs兩個檔案,實現X軸的Root motion。但是我的需求是X及Y軸都需要實現,因此對SkeletonRootMotion.cs做了一些修改,修改後的結果post在Forum中,在這邊補充一下,我不是Programmer所以Code可能不盡完善、正確...
http://esotericsoftware.com/forum/viewtopic.php?f=7&t=1364&start=26也可以在我的GitHub上查看,檔案內直接保留了Mitch原始的code,可以直接做比對:
https://github.com/januswow/TAG/blob/master/TouchActionGame/Assets/spine-unity/Assets/spine-unity/SkeletonRootMotion.cs主要的重點是Spine的Frames Data是以[time, x, y, ... time, x, y]的格式寫入,因此在GetXYAtTime()時,frames變數(timeline.frames)的取用需要注意:
float lastFrameX = frames[frameIndex - 2];
另外一個題外話,由於Spine輸出的資訊完全不同於FBX,因此尚無法搭配Mecanim系統,不過nicloay有寫一個Importer,使Spine能夠在Mecanim中運作,可惜的是無法支援全部的資訊,如FFD等...float lastFrameY = frames[frameIndex - 1];
http://esotericsoftware.com/forum/viewtopic.php?f=11&t=2012
![]() |
| 事件Label |
設定在label圖層中的事件,在API中是屬於AnimationEvent,此種事件只能獲取到骨架(armature)
![]() |
| AnimationEvent |
設定在bone圖層中的事件,在API中是屬於FrameEvent,此種事件可獲取到所屬的骨頭(bone)
因此將事件設定在bone圖層中時,可以順便獲取所屬影格中的元件位置來做定位,舉例,當事件發生時會呼叫一個分離特效並產生在角色的手上,那就可以把事件種在手的圖層中,或者是額外的定位圖層中。
![]() |
| FrameEvent |
![]() |
| Flash組件 |
![]() |
| Flash Config WindowSWF目錄路徑(Win 7) |
| MMExecute |
預設的組件按鈕只能夠從屬性面板設定Label,想要圖示按鈕的話需要透過Action Script:
btn.setStyle("icon", as_linkage);
as_linkage為元件庫中Icon元件的AS連結名稱,該元件的註冊點將會對齊按鈕的左上方。
An animation only affects the bones and slots for which it has keyframes.
When animations are applied in sequence, a previous animation may have made changes to bones or slots that a subsequent animation does not have keyframes for.
This can be solved be keying everything at the start of the second animation that the first animation affects.
文件有提到對每個Track打上key是會造成額外的運算負擔,但若是增加的幅度很小,其實也可以無視了。
With many animations this quickly leads to everything being keyed at the start of every animation. This is suboptimal because each property that is keyed adds a small amount of overhead when the animation is applied each frame.
文件也提出第二種解決方式,就是歸回SetupPose,但造成的負面影響是動作可能會發生不順暢、無法crossfading的狀況。
Another solution is to call setToSetupPose, setBonesToSetupPose, or setSlotsToSetupPose on the skeleton when the current animation is changed (or otherwise write code that changes the slots and bones as needed).
However, this will cause bones that aren't keyed in the second animation to be instantly set to the setup pose state. AnimationState won't be able to do crossfading for those bones.