From b2d079216040f3f7d4427d997c4597aa86dd0c9c Mon Sep 17 00:00:00 2001 From: Cade Date: Thu, 22 Sep 2022 09:47:41 -0400 Subject: [PATCH] [AnimationEditor] Fixed entry type not getting calculated properly --- .../AnimationEditorPlugin/AssetBankSdkCreator.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Plugins/AnimationEditorPlugin/AssetBankSdkCreator.cs b/Plugins/AnimationEditorPlugin/AssetBankSdkCreator.cs index 22e0ac858..95864c9dd 100644 --- a/Plugins/AnimationEditorPlugin/AssetBankSdkCreator.cs +++ b/Plugins/AnimationEditorPlugin/AssetBankSdkCreator.cs @@ -122,7 +122,7 @@ private string WriteField(Bank.Entry fieldObj) string fieldName = ReplaceBadCharacters(fieldObj.Name); string fieldType = ""; - BankType objType = (BankType)fieldObj.Type; + BankType objType = (BankType)fieldObj.BankHash; fieldType = fieldObj.IsArray ? $"List<{GetFieldType(objType)}>" : GetFieldType(objType); @@ -133,6 +133,7 @@ private string WriteField(Bank.Entry fieldObj) || objType == BankType.Vector2 || objType == BankType.Vector3 || objType == BankType.Vector4 + || objType == BankType.Guid || objType == BankType.String; sb.AppendLine("protected " + fieldType + " _" + fieldName + ((requiresDeclaration) ? " = new " + fieldType + "()" : "") + ";"); @@ -158,16 +159,14 @@ private string GetFieldType(BankType type) case BankType.Vector2: return "Vec2"; case BankType.Vector3: return "Vec3"; case BankType.Vector4: return "Vec4"; - case BankType.Quaternion: break; - case BankType.Matrix: break; + case BankType.Quaternion: return "float"; + case BankType.Matrix: return "float"; case BankType.Guid: return "Guid"; - case BankType.String: return "string"; - case BankType.Reference: break; + case BankType.String: return "CString"; + case BankType.Reference: return "float"; case BankType.Double: return "double"; - default: return "string"; + default: return "float"; } - - return "string"; } private string ReplaceBadCharacters(string name)