mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
v 1.0.0
This commit is contained in:
parent
0828ecd037
commit
2998865184
9821 changed files with 90 additions and 90 deletions
30
Source/Assets/Scripts/DefParents/ActorAddonDefs.cs
Normal file
30
Source/Assets/Scripts/DefParents/ActorAddonDefs.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public static class ActorAddonDefs
|
||||
{
|
||||
public static List<ActorAddonDef> allDefs = new List<ActorAddonDef>();
|
||||
|
||||
public static ActorAddonDef GetNamed(string addonName)
|
||||
{
|
||||
return allDefs.FirstOrDefault(x => x.addonName == addonName);
|
||||
}
|
||||
|
||||
public static void AddDef(ActorAddonDef actorAddonDef)
|
||||
{
|
||||
if (allDefs.Any(x => x.addonName == actorAddonDef.addonName)) return;
|
||||
|
||||
allDefs.Add(actorAddonDef);
|
||||
}
|
||||
|
||||
public static void OnLoad()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/DefParents/ActorAddonDefs.cs.meta
Normal file
11
Source/Assets/Scripts/DefParents/ActorAddonDefs.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9fc7248e80b340a42a688378a9cc2296
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Source/Assets/Scripts/DefParents/AnimationDefs.cs
Normal file
16
Source/Assets/Scripts/DefParents/AnimationDefs.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
[XmlRoot("Defs", IsNullable = false)]
|
||||
public class AnimationDefs
|
||||
{
|
||||
[XmlElement("Rimworld_Animations.AnimationDef")]
|
||||
public List<AnimationDef> animationDefs = new List<AnimationDef>();
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/DefParents/AnimationDefs.cs.meta
Normal file
11
Source/Assets/Scripts/DefParents/AnimationDefs.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6e65e28553800cf489ca2b0bc7e37408
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Source/Assets/Scripts/DefParents/PawnRaceDefs.cs
Normal file
53
Source/Assets/Scripts/DefParents/PawnRaceDefs.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public static class PawnRaceDefs
|
||||
{
|
||||
public static List<PawnRaceDef> allDefs = new List<PawnRaceDef>();
|
||||
|
||||
public static PawnRaceDef GetNamed(string pawnRaceDef)
|
||||
{
|
||||
return allDefs.FirstOrDefault(x => x.defName == pawnRaceDef);
|
||||
}
|
||||
|
||||
public static void AddDef(PawnRaceDef pawnRaceDef)
|
||||
{
|
||||
if (allDefs.Any(x => x.defName == pawnRaceDef.defName)) return;
|
||||
|
||||
allDefs.Add(pawnRaceDef);
|
||||
}
|
||||
|
||||
public static void OnLoad()
|
||||
{
|
||||
List<string> allTags = DefaultTags.bodyTypes.Concat(CustomTags.bodyTypes).ToList();
|
||||
allTags.Add("None");
|
||||
|
||||
List<CardinalDirection> facings = new List<CardinalDirection>() { CardinalDirection.North, CardinalDirection.East, CardinalDirection.South };
|
||||
string path;
|
||||
|
||||
foreach (PawnRaceDef pawnRaceDef in allDefs)
|
||||
{
|
||||
foreach (CardinalDirection facing in facings)
|
||||
{
|
||||
foreach (string bodyType in allTags)
|
||||
{
|
||||
path = pawnRaceDef.GetBodyTypeGraphicPath(facing, bodyType);
|
||||
|
||||
if (string.IsNullOrEmpty(path) == false)
|
||||
{ pawnRaceDef.SetBodyTypeGraphicPath(path, facing, bodyType); }
|
||||
}
|
||||
|
||||
path = pawnRaceDef.GetHeadGraphicPath(facing);
|
||||
|
||||
if (string.IsNullOrEmpty(path) == false)
|
||||
{ pawnRaceDef.SetHeadGraphicPath(path, facing); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/DefParents/PawnRaceDefs.cs.meta
Normal file
11
Source/Assets/Scripts/DefParents/PawnRaceDefs.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 53e7f97b4bb5a3441884e4795d7e9391
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
54
Source/Assets/Scripts/DefParents/SoundDefs.cs
Normal file
54
Source/Assets/Scripts/DefParents/SoundDefs.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class SoundDefs
|
||||
{
|
||||
public static List<SoundDef> allDefs = new List<SoundDef>();
|
||||
public static Dictionary<string, AudioClip> audioClips = new Dictionary<string, AudioClip>();
|
||||
|
||||
public static SoundDef GetNamed(string defName)
|
||||
{
|
||||
return allDefs.FirstOrDefault(x => x.defName == defName);
|
||||
}
|
||||
|
||||
public static void AddDef(SoundDef soundDef)
|
||||
{
|
||||
if (allDefs.Any(x => x.defName == soundDef.defName)) return;
|
||||
|
||||
allDefs.Add(soundDef);
|
||||
}
|
||||
public static void AddAudioClip(string path, AudioClip audioClip)
|
||||
{
|
||||
if (audioClips.TryGetValue(path, out AudioClip _audioClip) == false)
|
||||
{ audioClips.Add(path, audioClip); }
|
||||
|
||||
else
|
||||
{ audioClips[path] = audioClip; }
|
||||
}
|
||||
|
||||
public static AudioClip GetAudioClip(string path)
|
||||
{
|
||||
if (audioClips.TryGetValue(path, out AudioClip audioClip) == false)
|
||||
{
|
||||
Debug.LogWarning("Could not find audio clip '" + path + "'");
|
||||
return null;
|
||||
}
|
||||
|
||||
return audioClip;
|
||||
}
|
||||
|
||||
public static void OnLoad()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/DefParents/SoundDefs.cs.meta
Normal file
11
Source/Assets/Scripts/DefParents/SoundDefs.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a2030426d02b0346b4ee939407ca0f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue