Code refactor

This commit is contained in:
AbstractConcept 2022-10-27 00:56:04 -05:00
parent cd4711a8e5
commit 757badf4f6
517 changed files with 2534 additions and 2221 deletions

View file

@ -78,13 +78,15 @@ namespace RimWorldAnimationStudio
{
if (rotation == 0 || rotation == 2)
{
float multi = rotation == 0 ? -1f : 1f;
switch (bodyType)
{
case "Male": return new Vector3(0.035f, 0f, -0.050f);
case "Female": return new Vector3(0.002f, 0f, -0.044f);
case "Thin": return new Vector3(0.000f, 0f, -0.024f);
case "Hulk": return new Vector3(0.118f, 0f, -0.194f);
case "Fat": return new Vector3(0.141f, 0f, -0.084f);
case "Male": return new Vector3(0.035f * multi, 0f, -0.050f);
case "Female": return new Vector3(0.002f * multi, 0f, -0.044f);
case "Thin": return new Vector3(0.000f * multi, 0f, -0.024f);
case "Hulk": return new Vector3(0.118f * multi, 0f, -0.194f);
case "Fat": return new Vector3(0.141f * multi, 0f, -0.084f);
default: return Vector3.zero;
}
}
@ -120,13 +122,15 @@ namespace RimWorldAnimationStudio
{
if (rotation == 0 || rotation == 2)
{
float multi = rotation == 0 ? -1f : 1f;
switch (bodyType)
{
case "Male": return new Vector3(-0.035f, 0f, -0.050f);
case "Female": return new Vector3(-0.002f, 0f, -0.044f);
case "Thin": return new Vector3(-0.000f, 0f, -0.024f);
case "Hulk": return new Vector3(-0.118f, 0f, -0.194f);
case "Fat": return new Vector3(-0.141f, 0f, -0.084f);
case "Male": return new Vector3(-0.035f * multi, 0f, -0.050f);
case "Female": return new Vector3(-0.002f * multi, 0f, -0.044f);
case "Thin": return new Vector3(-0.000f * multi, 0f, -0.024f);
case "Hulk": return new Vector3(-0.118f * multi, 0f, -0.194f);
case "Fat": return new Vector3(-0.141f * multi, 0f, -0.084f);
default: return Vector3.zero;
}
}

View file

@ -13,14 +13,11 @@ namespace RimWorldAnimationStudio
{
public static T ReadXML<T>(string path)
{
//Debug.Log("Reading data from " + path);
using (StreamReader stringReader = new StreamReader(path))
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
var data = (T)serializer.Deserialize(stringReader);
//Debug.Log("Read successful");
return data;
}
}
@ -30,8 +27,6 @@ namespace RimWorldAnimationStudio
if (obj == null || path == null || path == "")
{ return; }
//Debug.Log("Saving data to " + path);
XmlSerializer writer = new XmlSerializer(typeof(T));
XmlSerializerNamespaces nameSpaces = new XmlSerializerNamespaces();
nameSpaces.Add("", "");
@ -39,8 +34,6 @@ namespace RimWorldAnimationStudio
FileStream file = File.Create(path);
writer.Serialize(file, obj, nameSpaces);
file.Close();
//Debug.Log("Saving successful");
}
}
}