mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
GUI rearrangement
This commit is contained in:
parent
04f8c6a2e4
commit
2e50221118
90 changed files with 435 additions and 1440 deletions
50
Assets/Scripts/Graphics/MultiDirectionalGraphic.cs
Normal file
50
Assets/Scripts/Graphics/MultiDirectionalGraphic.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
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 DirectionalGraphic northGraphic = new DirectionalGraphic();
|
||||
public DirectionalGraphic eastGraphic = new DirectionalGraphic();
|
||||
public DirectionalGraphic southGraphic = new DirectionalGraphic();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
//public bool ShouldSerializenorthGraphic() { return HasValidPathForDirection(CardinalDirection.North); }
|
||||
//public bool ShouldSerializeeastGraphic() { return HasValidPathForDirection(CardinalDirection.East); }
|
||||
//public bool ShouldSerializesouthGraphic() { return HasValidPathForDirection(CardinalDirection.South); }
|
||||
//public bool ShouldSerializebodyType() { return ShouldSerializenorthGraphic() || ShouldSerializeeastGraphic() || ShouldSerializesouthGraphic(); }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue