Skip to content

Commit

Permalink
[AnimationEditor] Fixed entry type not getting calculated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
CadeEvs committed Sep 22, 2022
1 parent 74334f1 commit b2d0792
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Plugins/AnimationEditorPlugin/AssetBankSdkCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 + "()" : "") + ";");
Expand All @@ -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)
Expand Down

0 comments on commit b2d0792

Please sign in to comment.