mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 14:11:19 +07:00
mask wip
This commit is contained in:
Binary file not shown.
BIN
Assets/FlashTools/Examples/Animations/Tests/6_masks_2.fla
Normal file
BIN
Assets/FlashTools/Examples/Animations/Tests/6_masks_2.fla
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78dd883487f0e4a3281308f1e4c7b131
|
||||
timeCreated: 1469337635
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/FlashTools/Examples/Animations/Tests/7_sprites.fla
Normal file
BIN
Assets/FlashTools/Examples/Animations/Tests/7_sprites.fla
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68ed33ba61a1243f99660fd4aa9e4777
|
||||
timeCreated: 1469371596
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -100,9 +100,15 @@ namespace FlashTools.Internal {
|
||||
var bitmap_matrix = i < shape_def.Matrices.Length ? shape_def.Matrices[i] : SwfMatrix.identity;
|
||||
var bitmap_def = ctx.Library.FindDefine<SwfLibraryBitmapDefine>(bitmap_id);
|
||||
if ( bitmap_def != null ) {
|
||||
var global_depth = (parent_depth + inst.Depth);
|
||||
var local_clip_depth = (parent_clip_depth != 0 ? parent_clip_depth : inst.ClipDepth);
|
||||
var global_clip_depth = (parent_clip_depth != 0 ? parent_clip_depth : (local_clip_depth != 0 ? (global_depth + local_clip_depth - 1) : 0));
|
||||
|
||||
Debug.LogFormat("--- Depth: {0}, ClipDepth: {1}", global_depth, global_clip_depth);
|
||||
|
||||
frame.Instances.Add(new SwfAnimationInstanceData{
|
||||
Depth = (ushort)(parent_depth + inst.Depth),
|
||||
ClipDepth = (ushort)(parent_clip_depth != 0 ? parent_clip_depth : inst.ClipDepth),
|
||||
Depth = (ushort)global_depth,
|
||||
ClipDepth = (ushort)global_clip_depth,
|
||||
Bitmap = bitmap_id,
|
||||
Matrix = parent_matrix * inst.Matrix.ToUnityMatrix() * bitmap_matrix.ToUnityMatrix(),
|
||||
ColorTransform = parent_color_transform * inst.ColorTransform.ToAnimationColorTransform()});
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace FlashTools.Internal.SwfTools {
|
||||
get { return SwfDisplayInstanceType.Sprite; }
|
||||
}
|
||||
|
||||
public void ResetTag() {
|
||||
public void Reset() {
|
||||
CurrentTag = 0;
|
||||
DisplayList = new SwfDisplayList();
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace FlashTools.Internal.SwfTools {
|
||||
var sprite_def = MainContex.Library.FindDefine<SwfLibrarySpriteDefine>(sprite.Id);
|
||||
if ( sprite_def != null ) {
|
||||
if ( sprite.CurrentTag >= sprite_def.ControlTags.Tags.Count ) {
|
||||
sprite.ResetTag();
|
||||
sprite.Reset();
|
||||
}
|
||||
var sprite_executer = new SwfContextExecuter(MainContex, sprite.CurrentTag);
|
||||
sprite_executer.NextFrame(sprite_def.ControlTags.Tags, sprite.DisplayList);
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace FlashTools {
|
||||
} else {
|
||||
var last_group = _groups[_groups.Count - 1];
|
||||
if ( last_group.Type == GroupType.Mask ) {
|
||||
if ( inst.Depth < last_group.ClipDepth ) {
|
||||
if ( inst.Depth <= last_group.ClipDepth ) {
|
||||
var gr = new Group();
|
||||
gr.Type = GroupType.Masked;
|
||||
gr.Triangles = new List<int>();
|
||||
@@ -171,7 +171,7 @@ namespace FlashTools {
|
||||
_groups.Add(gr);
|
||||
}
|
||||
} else if ( last_group.Type == GroupType.Masked ) {
|
||||
if ( inst.Depth < last_group.ClipDepth ) {
|
||||
if ( inst.Depth <= last_group.ClipDepth ) {
|
||||
// nothing
|
||||
} else {
|
||||
var gr = new Group();
|
||||
|
||||
Reference in New Issue
Block a user