mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Improvements to timeline
This commit is contained in:
parent
d2ca61c61c
commit
591b176924
99 changed files with 460 additions and 359 deletions
|
@ -41,12 +41,12 @@ namespace RimWorldAnimationStudio
|
|||
}
|
||||
}
|
||||
|
||||
public PawnKeyframe GetCurrentPawnKeyframe(bool makeNewIfNull = true)
|
||||
public PawnKeyframe GetCurrentPawnKeyframe()
|
||||
{
|
||||
int stageTick = AnimationController.Instance.stageTick;
|
||||
PawnKeyframe keyframe = animationDef?.animationStages[stageID]?.animationClips[actorID]?.keyframes.FirstOrDefault(x => x.atTick == stageTick);
|
||||
|
||||
if (keyframe != null || makeNewIfNull == false)
|
||||
if (keyframe != null)
|
||||
{ return keyframe; }
|
||||
|
||||
AnimationController.Instance.AddPawnKeyframe();
|
||||
|
@ -105,5 +105,41 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
// All other data
|
||||
}
|
||||
|
||||
private int lastactorCount = 0;
|
||||
private int lastStageID = 0;
|
||||
private int lastStageCount = 0;
|
||||
private int lastStageWindowSize = 0;
|
||||
|
||||
public bool AnimationTimelinesNeedUpdate()
|
||||
{
|
||||
if (animationDef == null) return false;
|
||||
|
||||
bool update = false;
|
||||
|
||||
if (lastStageID != stageID)
|
||||
{ update = true; }
|
||||
|
||||
if (lastStageCount != animationDef.animationStages.Count)
|
||||
{ update = true; }
|
||||
|
||||
if (lastactorCount != animationDef.actors.Count)
|
||||
{ update = true; }
|
||||
|
||||
if (lastStageWindowSize != StageWindowSize)
|
||||
{ update = true; }
|
||||
|
||||
if (update)
|
||||
{
|
||||
lastStageID = stageID;
|
||||
lastStageCount = animationDef.animationStages.Count;
|
||||
lastactorCount = animationDef.actors.Count;
|
||||
lastStageWindowSize = StageWindowSize;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue