mirror of
https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
synced 2024-08-15 00:43:27 +00:00
v2.0.0
This commit is contained in:
parent
38ec4f86c1
commit
ae95e34137
35 changed files with 242 additions and 612 deletions
|
@ -1,54 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Rimworld_Animations;
|
||||
|
||||
namespace Rimworld_Animations_Patch
|
||||
{
|
||||
public class PawnAnimationClipExt : PawnAnimationClip
|
||||
{
|
||||
public List<ActorAddon> addons = new List<ActorAddon>();
|
||||
|
||||
public override void buildSimpleCurves()
|
||||
{
|
||||
base.buildSimpleCurves();
|
||||
int keyframePosition = 0;
|
||||
|
||||
for (int i = 0; i < keyframes.Count; i++)
|
||||
{
|
||||
PawnKeyframeExt keyframe = keyframes[i] as PawnKeyframeExt;
|
||||
|
||||
|
||||
if (keyframe.atTick.HasValue)
|
||||
{
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
if (keyframe.addonKeyframes.Any(x => x.AddonName == addon.AddonName) == false)
|
||||
{ keyframe.addonKeyframes.Add(new AddonKeyframe(addon.AddonName)); }
|
||||
|
||||
addon.PosX.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).PosX, true);
|
||||
addon.PosZ.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).PosZ, true);
|
||||
addon.Rotation.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).Rotation, true);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
if (keyframe.addonKeyframes.Any(x => x.AddonName == addon.AddonName) == false)
|
||||
{ keyframe.addonKeyframes.Add(new AddonKeyframe(addon.AddonName)); }
|
||||
|
||||
addon.PosX.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).PosX, true);
|
||||
addon.PosZ.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).PosZ, true);
|
||||
addon.Rotation.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.AddonName).Rotation, true);
|
||||
}
|
||||
|
||||
keyframePosition += keyframe.tickDuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Rimworld_Animations;
|
||||
|
||||
namespace Rimworld_Animations_Patch
|
||||
{
|
||||
public class PawnKeyframeExt : PawnKeyframe
|
||||
{
|
||||
public List<AddonKeyframe> addonKeyframes;
|
||||
|
||||
public AddonKeyframe GetAddonKeyframe(string addonName)
|
||||
{
|
||||
return addonKeyframes.FirstOrDefault(x => x.AddonName == addonName);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue