rimworld-animation-studio/Assets/Scripts/Utilities/PawnUtility.cs
2022-09-24 02:17:40 -05:00

77 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace RimWorldAnimationStudio
{
public static class PawnUtility
{
public static Vector3 BaseHeadOffsetAt(string bodyType, int rotation)
{
Vector2 headOffset = Vector3.zero;
switch (bodyType)
{
case "Male": headOffset = new Vector2(0.04f, 0.34f); break;
case "Female": headOffset = new Vector2(0.10f, 0.34f); break;
case "Thin": headOffset = new Vector2(0.09f, 0.34f); break;
case "Hulk": headOffset = new Vector2(0.10f, 0.34f); break;
case "Fat": headOffset = new Vector2(0.09f, 0.34f); break;
}
switch (rotation)
{
case 0: return new Vector3(0f, 0f, headOffset.y);
case 1: return new Vector3(headOffset.x, 0f, headOffset.y);
case 2: return new Vector3(0f, 0f, headOffset.y);
case 3: return new Vector3(-headOffset.x, 0f, headOffset.y);
default: return Vector3.zero;
}
}
public static Vector3 AppendageOffsetAt(string bodyType, int rotation)
{
if (rotation == 0 || rotation == 2)
{
switch (bodyType)
{
case "Male": return new Vector3(0.00f, 0f, -0.46f);
case "Female": return new Vector3(0.00f, 0f, -0.51f);
case "Thin": return new Vector3(0.00f, 0f, -0.46f);
case "Hulk": return new Vector3(0.00f, 0f, -0.66f);
case "Fat": return new Vector3(0.00f, 0f, -0.52f);
default: return Vector3.zero;
}
}
else if (rotation == 1)
{
switch (bodyType)
{
case "Male": return new Vector3(0.07f, 0f, -0.41f);
case "Female": return new Vector3(0.07f, 0f, -0.47f);
case "Thin": return new Vector3(-0.05f, 0f, -0.43f);
case "Hulk": return new Vector3(-0.03f, 0f, -0.64f);
case "Fat": return new Vector3(0.24f, 0f, -0.50f);
default: return Vector3.zero;
}
}
else
{
switch (bodyType)
{
case "Male": return new Vector3(-0.07f, 0f, -0.41f);
case "Female": return new Vector3(-0.07f, 0f, -0.47f);
case "Thin": return new Vector3(0.05f, 0f, -0.43f);
case "Hulk": return new Vector3(0.03f, 0f, -0.64f);
case "Fat": return new Vector3(-0.24f, 0f, -0.50f);
default: return Vector3.zero;
}
}
}
}
}