using System; using System.Collections.Generic; using UnityEngine; namespace RimWorldAnimationStudio { [Serializable] public class AlienRaceOffset { public string defName = "Human"; public string offset = "(0, 0)"; public AlienRaceOffset() { } public AlienRaceOffset(string defName) { this.defName = defName; } public void SetOffset(Vector2 raceOffset) { offset = "(" + raceOffset.x + ", " + raceOffset.y + ")"; } public Vector3 GetOffset() { string raceOffset = offset; raceOffset = raceOffset.Trim(); raceOffset = raceOffset.Replace("(", ""); raceOffset = raceOffset.Replace(")", ""); var raceOffsets = raceOffset.Split(','); return new Vector3(float.Parse(raceOffsets[0]), 0f, float.Parse(raceOffsets[1])); } } }