fix dublicated bug

This commit is contained in:
2016-02-28 22:16:30 +06:00
parent c55f2ebe9c
commit 4b26c31587
6 changed files with 18 additions and 13 deletions

View File

@@ -166,7 +166,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1173114888}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 500, y: -400, z: -10}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

View File

@@ -9,6 +9,7 @@ namespace FlashTools {
int _current_frame = 0;
float _frame_timer = 0.0f;
float _current_z = 0.0f;
List<Vector2> _uvs = new List<Vector2>();
List<Vector3> _vertices = new List<Vector3>();
@@ -54,7 +55,7 @@ namespace FlashTools {
if ( frame_num >= 0 && frame_num < layer.Frames.Count ) {
return layer.Frames[frame_num];
}
return null;
return layer.Frames.Count > 0 ? layer.Frames[layer.Frames.Count - 1] : null;
}
FlashAnimSymbolData FindSymbol(FlashAnimLibraryData library, string symbol_id) {
@@ -84,10 +85,11 @@ namespace FlashTools {
var width = bitmap.RealSize.x;
var height = bitmap.RealSize.y;
var v0 = new Vector3( 0, 0, 0);
var v1 = new Vector3( width, 0, 0);
var v2 = new Vector3( width, height, 0);
var v3 = new Vector3( 0, height, 0);
var v0 = new Vector3( 0, 0, _current_z);
var v1 = new Vector3( width, 0, _current_z);
var v2 = new Vector3( width, height, _current_z);
var v3 = new Vector3( 0, height, _current_z);
_current_z -= 20f;
_vertices.Add(matrix.MultiplyPoint3x4(v0));
_vertices.Add(matrix.MultiplyPoint3x4(v1));
@@ -164,6 +166,7 @@ namespace FlashTools {
_vertices.Clear();
_triangles.Clear();
_uvs.Clear();
_current_z = 0.0f;
RenderSymbol(
GetCurrentSymbol(),
_current_frame,

View File

@@ -108,7 +108,7 @@ namespace FlashTools {
}
public class FlashAnimAsset : ScriptableObject {
[HideInInspector]
//[HideInInspector]
public FlashAnimData Data = new FlashAnimData();
public Texture2D Atlas = null;
public int MaxAtlasSize = 1024;

View File

@@ -211,7 +211,7 @@ namespace FlashTools.Internal {
return false;
}
var tex_data_a = texture_a.GetPixels32();
var tex_data_b = texture_a.GetPixels32();
var tex_data_b = texture_b.GetPixels32();
return tex_data_a.SequenceEqual(tex_data_b);
}