2022-10-25 04:43:25 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Xml.Serialization;
|
2022-10-27 05:56:04 +00:00
|
|
|
|
using UnityEngine;
|
2022-10-25 04:43:25 +00:00
|
|
|
|
|
|
|
|
|
namespace RimWorldAnimationStudio
|
|
|
|
|
{
|
|
|
|
|
public class ActorAddon
|
|
|
|
|
{
|
2022-10-27 05:56:04 +00:00
|
|
|
|
// Data to/from animationDef
|
2022-10-25 04:43:25 +00:00
|
|
|
|
public string addonName;
|
2022-10-27 05:56:04 +00:00
|
|
|
|
public int? anchoringActor;
|
2022-10-25 04:43:25 +00:00
|
|
|
|
public string anchorName;
|
|
|
|
|
public string layer = "Pawn";
|
2022-10-27 05:56:04 +00:00
|
|
|
|
public float? scale;
|
|
|
|
|
public bool? render;
|
2022-10-25 04:43:25 +00:00
|
|
|
|
|
2022-10-31 05:44:53 +00:00
|
|
|
|
// Data serialization control
|
|
|
|
|
public bool ShouldSerializeanchorName() { return string.IsNullOrEmpty(anchorName) == false && anchorName.ToLower() != "none"; }
|
|
|
|
|
public bool ShouldSerializeanchoringActor() { return anchoringActor.HasValue; }
|
|
|
|
|
public bool ShouldSerializescale() { return scale.HasValue; }
|
|
|
|
|
public bool ShouldSerializerender() { return render == true; }
|
|
|
|
|
|
2022-10-27 05:56:04 +00:00
|
|
|
|
// Data helper functions
|
|
|
|
|
[XmlIgnore] public string AddonName
|
|
|
|
|
{
|
|
|
|
|
get { return addonName; }
|
|
|
|
|
set { addonName = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlIgnore] public int AnchoringActor
|
|
|
|
|
{
|
|
|
|
|
get { return anchoringActor.HasValue ? anchoringActor.Value : 0; }
|
2022-10-28 05:28:51 +00:00
|
|
|
|
set { anchoringActor = value; }
|
2022-10-27 05:56:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlIgnore] public string AnchorName
|
|
|
|
|
{
|
|
|
|
|
get { return anchorName; }
|
2022-10-28 05:28:51 +00:00
|
|
|
|
set { anchorName = value; }
|
2022-10-27 05:56:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlIgnore] public string Layer
|
|
|
|
|
{
|
|
|
|
|
get { return layer; }
|
2022-10-28 05:28:51 +00:00
|
|
|
|
set { layer = value; }
|
2022-10-27 05:56:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlIgnore] public float Scale
|
|
|
|
|
{
|
|
|
|
|
get { return scale.HasValue ? scale.Value : 0f; }
|
2022-10-28 05:28:51 +00:00
|
|
|
|
set { scale = value; }
|
2022-10-27 05:56:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlIgnore] public bool Render
|
|
|
|
|
{
|
|
|
|
|
get { return render == true; }
|
2022-10-28 05:28:51 +00:00
|
|
|
|
set { render = value; }
|
2022-10-27 05:56:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Simple curves
|
2022-10-25 04:43:25 +00:00
|
|
|
|
[XmlIgnore] public SimpleCurve PosX = new SimpleCurve();
|
|
|
|
|
[XmlIgnore] public SimpleCurve PosZ = new SimpleCurve();
|
|
|
|
|
[XmlIgnore] public SimpleCurve Rotation = new SimpleCurve();
|
|
|
|
|
|
2022-10-27 05:56:04 +00:00
|
|
|
|
// Constructors
|
2022-10-25 04:43:25 +00:00
|
|
|
|
public ActorAddon() { }
|
|
|
|
|
|
|
|
|
|
public ActorAddon(string addonName, float scale = 1f)
|
|
|
|
|
{
|
2022-10-27 05:56:04 +00:00
|
|
|
|
this.AddonName = addonName;
|
|
|
|
|
this.Scale = scale;
|
2022-10-25 04:43:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|