34 lines
703 B
C#
34 lines
703 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
using Verse;
|
|||
|
|
|||
|
namespace Rimworld_Animations
|
|||
|
{
|
|||
|
public class AnimationOffsetDef : Def
|
|||
|
{
|
|||
|
|
|||
|
public List<BaseAnimationOffset> offsets;
|
|||
|
|
|||
|
public Vector3 FindOffset(Pawn pawn)
|
|||
|
{
|
|||
|
foreach (BaseAnimationOffset animOffset in offsets)
|
|||
|
{
|
|||
|
if (animOffset.appliesToPawn(pawn)) {
|
|||
|
|
|||
|
Vector3? offset = animOffset.getOffset(pawn);
|
|||
|
return (offset == null ? Vector3.zero : (Vector3)offset);
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return Vector3.zero;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|