diff --git a/AssetStudioFBX/AssetStudioFBX-x86.vcxproj.filters b/AssetStudioFBX/AssetStudioFBX-x86.vcxproj.filters new file mode 100644 index 0000000..18ee756 --- /dev/null +++ b/AssetStudioFBX/AssetStudioFBX-x86.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + {583fcf27-d43a-4d07-86f5-7757c1fa471b} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {444d070d-1fc6-4211-b76b-d4c5d708ac6f} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + \ No newline at end of file diff --git a/AssetStudioFBX/AssetStudioFBXExporter.cpp b/AssetStudioFBX/AssetStudioFBXExporter.cpp index c3b52d6..cedc2e4 100644 --- a/AssetStudioFBX/AssetStudioFBXExporter.cpp +++ b/AssetStudioFBX/AssetStudioFBXExporter.cpp @@ -218,7 +218,7 @@ namespace AssetStudio while (parent != nullptr) { exportFrames->Add(parent->Name); - parent = (ImportedFrame^)parent->Parent; + parent = parent->Parent; } List^ boneList = meshListSome->BoneList; @@ -232,7 +232,7 @@ namespace AssetStudio while (boneParent != nullptr) { exportFrames->Add(boneParent->Name); - boneParent = (ImportedFrame^)boneParent->Parent; + boneParent = boneParent->Parent; } } } diff --git a/AssetStudioUtility/AssetStudioUtility.csproj b/AssetStudioUtility/AssetStudioUtility.csproj index 2e04430..3d0a77b 100644 --- a/AssetStudioUtility/AssetStudioUtility.csproj +++ b/AssetStudioUtility/AssetStudioUtility.csproj @@ -43,7 +43,6 @@ - diff --git a/AssetStudioUtility/Imported.cs b/AssetStudioUtility/Imported.cs index a48f156..64ee5dc 100644 --- a/AssetStudioUtility/Imported.cs +++ b/AssetStudioUtility/Imported.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.IO; using SharpDX; @@ -15,11 +16,61 @@ namespace AssetStudio List MorphList { get; } } - public class ImportedFrame : ObjChildren, IObjChild + public class ImportedFrame : IEnumerable { public string Name { get; set; } public Matrix Matrix { get; set; } - public dynamic Parent { get; set; } + public ImportedFrame Parent { get; set; } + + private List children; + + public ImportedFrame this[int i] => children[i]; + + public int Count => children.Count; + + public void InitChildren(int count) + { + children = new List(count); + } + + public void AddChild(ImportedFrame obj) + { + children.Add(obj); + obj.Parent = this; + } + + public void InsertChild(int i, ImportedFrame obj) + { + children.Insert(i, obj); + obj.Parent = this; + } + + public void RemoveChild(ImportedFrame obj) + { + obj.Parent = null; + children.Remove(obj); + } + + public void RemoveChild(int i) + { + children[i].Parent = null; + children.RemoveAt(i); + } + + public int IndexOf(ImportedFrame obj) + { + return children.IndexOf(obj); + } + + public IEnumerator GetEnumerator() + { + return children.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } public class ImportedMesh diff --git a/AssetStudioUtility/ObjChildren.cs b/AssetStudioUtility/ObjChildren.cs deleted file mode 100644 index 4b90853..0000000 --- a/AssetStudioUtility/ObjChildren.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; - -namespace AssetStudio -{ - public interface IObjChild - { - dynamic Parent { get; set; } - } - - public abstract class ObjChildren : IEnumerable where T : IObjChild - { - protected List children; - - public T this[int i] => children[i]; - - public int Count => children.Count; - - public void InitChildren(int count) - { - children = new List(count); - } - - public void AddChild(T obj) - { - children.Add(obj); - obj.Parent = this; - } - - public void InsertChild(int i, T obj) - { - children.Insert(i, obj); - obj.Parent = this; - } - - public void RemoveChild(T obj) - { - obj.Parent = null; - children.Remove(obj); - } - - public void RemoveChild(int i) - { - children[i].Parent = null; - children.RemoveAt(i); - } - - public int IndexOf(T obj) - { - return children.IndexOf(obj); - } - - public IEnumerator GetEnumerator() - { - return children.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -}