mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
bb2cc29393
commitaf4dab5546
Author: AbstractConcept <abstract.concept@mail.com> Date: Mon Oct 31 19:58:41 2022 -0500 Code refactor commite14a12f2ab
Author: AbstractConcept <abstract.concept@mail.com> Date: Mon Oct 31 00:44:53 2022 -0500 Code refactor commit5ca7e486f8
Author: AbstractConcept <abstract.concept@mail.com> Date: Fri Oct 28 19:52:58 2022 -0500 Code refactor commita55ba7b95b
Author: AbstractConcept <abstract.concept@mail.com> Date: Fri Oct 28 00:28:51 2022 -0500 Code refactor commit757badf4f6
Author: AbstractConcept <abstract.concept@mail.com> Date: Thu Oct 27 00:56:04 2022 -0500 Code refactor
49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace RimWorldAnimationStudio
|
|
{
|
|
[Serializable]
|
|
public class MultiDirectionalGraphic
|
|
{
|
|
public string bodyType = "None";
|
|
public SingleGraphic northGraphic = new SingleGraphic();
|
|
public SingleGraphic eastGraphic = new SingleGraphic();
|
|
public SingleGraphic southGraphic = new SingleGraphic();
|
|
|
|
public bool ShouldSerializenorthGraphic() { return string.IsNullOrEmpty(northGraphic.path) == false; }
|
|
public bool ShouldSerializeeastGraphic() { return string.IsNullOrEmpty(eastGraphic.path) == false; }
|
|
public bool ShouldSerializesouthGraphic() { return string.IsNullOrEmpty(southGraphic.path) == false; }
|
|
|
|
public MultiDirectionalGraphic() { }
|
|
|
|
public MultiDirectionalGraphic(string bodyType)
|
|
{
|
|
this.bodyType = bodyType;
|
|
}
|
|
|
|
public bool HasValidPathForDirection(CardinalDirection facing)
|
|
{
|
|
string path;
|
|
|
|
switch (facing)
|
|
{
|
|
case CardinalDirection.North: path = northGraphic.path; break;
|
|
case CardinalDirection.East: path = eastGraphic.path; break;
|
|
case CardinalDirection.South: path = southGraphic.path; break;
|
|
default: path = eastGraphic.path; break;
|
|
}
|
|
|
|
if (path == null || path.Any() == false || Path.GetExtension(path) != ".png")
|
|
{ return false; }
|
|
|
|
if (File.Exists(path) == false && File.Exists(Path.GetFullPath(Path.Combine(Application.streamingAssetsPath, path))) == false)
|
|
{ return false; }
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|