mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 22:19:31 +07:00
sequences separate by anchors now
This commit is contained in:
@@ -294,10 +294,10 @@ namespace FTEditor.Postprocessors {
|
|||||||
if ( IsValidAssetsForFrame(asset, symbol) ) {
|
if ( IsValidAssetsForFrame(asset, symbol) ) {
|
||||||
foreach ( var frame in symbol.Frames ) {
|
foreach ( var frame in symbol.Frames ) {
|
||||||
var baked_frame = BakeClipFrame(asset, data, frame);
|
var baked_frame = BakeClipFrame(asset, data, frame);
|
||||||
if ( !string.IsNullOrEmpty(frame.Name) &&
|
if ( !string.IsNullOrEmpty(frame.Anchor) &&
|
||||||
(sequences.Count < 1 || sequences.Last().Name != frame.Name) )
|
(sequences.Count < 1 || sequences.Last().Name != frame.Anchor) )
|
||||||
{
|
{
|
||||||
sequences.Add(new SwfClipAsset.Sequence{Name = frame.Name});
|
sequences.Add(new SwfClipAsset.Sequence{Name = frame.Anchor});
|
||||||
} else if ( sequences.Count < 1 ) {
|
} else if ( sequences.Count < 1 ) {
|
||||||
sequences.Add(new SwfClipAsset.Sequence{Name = "Default"});
|
sequences.Add(new SwfClipAsset.Sequence{Name = "Default"});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,8 +111,11 @@ namespace FTEditor.Postprocessors {
|
|||||||
static SwfFrameData LoadSymbolFrameData(
|
static SwfFrameData LoadSymbolFrameData(
|
||||||
SwfLibrary library, SwfDisplayList display_list)
|
SwfLibrary library, SwfDisplayList display_list)
|
||||||
{
|
{
|
||||||
var frame = new SwfFrameData();
|
var frame = new SwfFrameData{
|
||||||
frame.Name = display_list.FrameName;
|
Anchor = display_list.FrameAnchors.Count > 0
|
||||||
|
? display_list.FrameAnchors[0]
|
||||||
|
: string.Empty,
|
||||||
|
Labels = new List<string>(display_list.FrameLabels)};
|
||||||
return AddDisplayListToFrame(
|
return AddDisplayListToFrame(
|
||||||
library,
|
library,
|
||||||
display_list,
|
display_list,
|
||||||
|
|||||||
@@ -205,7 +205,8 @@ namespace FTEditor {
|
|||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
class SwfFrameData {
|
class SwfFrameData {
|
||||||
public string Name = string.Empty;
|
public string Anchor = string.Empty;
|
||||||
|
public List<string> Labels = new List<string>();
|
||||||
public List<SwfInstanceData> Instances = new List<SwfInstanceData>();
|
public List<SwfInstanceData> Instances = new List<SwfInstanceData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ namespace FTSwfTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class SwfDisplayList {
|
public class SwfDisplayList {
|
||||||
public string FrameName = string.Empty;
|
|
||||||
public DisplayInstances Instances = new DisplayInstances();
|
public DisplayInstances Instances = new DisplayInstances();
|
||||||
|
public List<string> FrameLabels = new List<string>();
|
||||||
|
public List<string> FrameAnchors = new List<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,8 @@ namespace FTSwfTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool NextFrame(List<SwfTagBase> tags, SwfDisplayList dl) {
|
public bool NextFrame(List<SwfTagBase> tags, SwfDisplayList dl) {
|
||||||
dl.FrameName = string.Empty;
|
dl.FrameLabels.Clear();
|
||||||
|
dl.FrameAnchors.Clear();
|
||||||
while ( CurrentTag < tags.Count ) {
|
while ( CurrentTag < tags.Count ) {
|
||||||
var tag = tags[CurrentTag++];
|
var tag = tags[CurrentTag++];
|
||||||
tag.AcceptVistor(this, dl);
|
tag.AcceptVistor(this, dl);
|
||||||
@@ -171,7 +172,11 @@ namespace FTSwfTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SwfDisplayList Visit(FrameLabelTag tag, SwfDisplayList dl) {
|
public SwfDisplayList Visit(FrameLabelTag tag, SwfDisplayList dl) {
|
||||||
dl.FrameName = tag.Name.Trim();
|
if ( tag.AnchorFlag == 0 ) {
|
||||||
|
dl.FrameLabels.Add(tag.Name.Trim());
|
||||||
|
} else {
|
||||||
|
dl.FrameAnchors.Add(tag.Name.Trim());
|
||||||
|
}
|
||||||
return dl;
|
return dl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user