mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Code refactor
This commit is contained in:
parent
e14a12f2ab
commit
af4dab5546
278 changed files with 468 additions and 668 deletions
|
@ -15,13 +15,12 @@ namespace RimWorldAnimationStudio
|
|||
public int? anchoringActor;
|
||||
public string anchorName;
|
||||
public string layer = "Pawn";
|
||||
public float? scale;
|
||||
public GraphicData graphicData;
|
||||
public bool? render;
|
||||
|
||||
// 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; }
|
||||
|
||||
// Data helper functions
|
||||
|
@ -49,10 +48,11 @@ namespace RimWorldAnimationStudio
|
|||
set { layer = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore] public float Scale
|
||||
[XmlIgnore]
|
||||
public GraphicData GraphicData
|
||||
{
|
||||
get { return scale.HasValue ? scale.Value : 0f; }
|
||||
set { scale = value; }
|
||||
get { return graphicData; }
|
||||
set { graphicData = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore] public bool Render
|
||||
|
@ -69,10 +69,10 @@ namespace RimWorldAnimationStudio
|
|||
// Constructors
|
||||
public ActorAddon() { }
|
||||
|
||||
public ActorAddon(string addonName, float scale = 1f)
|
||||
public ActorAddon(ActorAddonDef actorAddonDef)
|
||||
{
|
||||
this.AddonName = addonName;
|
||||
this.Scale = scale;
|
||||
this.AddonName = actorAddonDef.addonName;
|
||||
this.GraphicData = actorAddonDef.graphicData.Copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue