您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
783 B
31 行
783 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace GameplayIngredients.Rigs
|
|
{
|
|
|
|
public abstract class GenericAnimationRig : Rig
|
|
{
|
|
public override UpdateMode defaultUpdateMode => UpdateMode.Update;
|
|
|
|
public override int defaultPriority => 0;
|
|
|
|
public override bool canChangeUpdateMode => true;
|
|
|
|
public abstract Type animatedType { get; }
|
|
|
|
[Header("Target Property / Field"), ReflectedMember("animatedType")]
|
|
public ReflectedMember property;
|
|
|
|
public override void UpdateRig(float deltaTime)
|
|
{
|
|
if (property.targetObject != null)
|
|
{
|
|
property.SetValue(UpdateAndGetValue(deltaTime));
|
|
}
|
|
}
|
|
|
|
protected abstract object UpdateAndGetValue(float deltaTime);
|
|
|
|
}
|
|
}
|