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
757badf4f6
commit
a55ba7b95b
232 changed files with 1282 additions and 936 deletions
44
Assets/Scripts/Data/ActorPosition.cs
Normal file
44
Assets/Scripts/Data/ActorPosition.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class ActorPosition
|
||||
{
|
||||
public float bodyOffsetX;
|
||||
public float bodyOffsetZ;
|
||||
public float bodyAngle;
|
||||
public float headBob;
|
||||
public float headAngle;
|
||||
public float genitalAngle;
|
||||
|
||||
public int bodyFacing;
|
||||
public int headFacing;
|
||||
|
||||
public ActorPosition(int actorID, int atTick)
|
||||
{
|
||||
Actor actor = Workspace.GetActor(actorID);
|
||||
PawnAnimationClip clip = Workspace.GetPawnAnimationClip(actorID);
|
||||
|
||||
float clipPercent = atTick / Workspace.StageWindowSize;
|
||||
if (atTick > Constants.minTick && atTick == clip.duration) clipPercent = 1f;
|
||||
|
||||
if (Workspace.GetCurrentAnimationStage().IsLooping == false)
|
||||
{ clipPercent = (float)atTick / clip.duration; }
|
||||
|
||||
bodyOffsetX = clip.BodyOffsetX.Evaluate(clipPercent);
|
||||
bodyOffsetZ = clip.BodyOffsetZ.Evaluate(clipPercent);
|
||||
bodyAngle = clip.BodyAngle.Evaluate(clipPercent);
|
||||
headBob = clip.HeadBob.Evaluate(clipPercent);
|
||||
headAngle = clip.HeadAngle.Evaluate(clipPercent);
|
||||
genitalAngle = clip.GenitalAngle.Evaluate(clipPercent);
|
||||
|
||||
bodyFacing = (int)clip.BodyFacing.Evaluate(clipPercent);
|
||||
headFacing = (int)clip.HeadFacing.Evaluate(clipPercent);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Data/ActorPosition.cs.meta
Normal file
11
Assets/Scripts/Data/ActorPosition.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e2a9b0bb71978ea49909b3e1814303a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -24,6 +24,7 @@ namespace RimWorldAnimationStudio
|
|||
// Colors used
|
||||
public static Color ColorWhite = new Color(1f, 1f, 1f);
|
||||
public static Color ColorGreen = new Color(0f, 1f, 0f);
|
||||
public static Color ColorLightGreen = new Color(0.75f, 1f, 0.75f);
|
||||
public static Color ColorGoldYellow = new Color(1f, 0.85f, 0f);
|
||||
public static Color ColorDarkGold = new Color(0.75f, 0.64f, 0f);
|
||||
public static Color ColorLightGrey = new Color(0.9f, 0.9f, 0.9f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue