diff --git a/CHANGELOG.md b/CHANGELOG.md
index d276a71..b97b2c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,24 @@
[English](CHANGELOG_EN.md) | 中文
+## v1.8.6
+
+- 新增 `ModelParameterDriver` 组件,支持在动画状态机中自定义参数控制
+ - 支持多种参数操作类型:
+ - `Set`:直接设置参数值
+ - `Add`:在现有值基础上增加指定值
+ - `Random`:随机设置参数值(支持范围随机和概率触发)
+ - `Copy`:从源参数复制值到目标参数(支持范围转换)
+ - 支持所有 Animator 参数类型(Float、Int、Bool、Trigger)
+ - 在动画状态进入时自动应用参数驱动
+ - 支持参数验证,确保目标参数和源参数存在后才应用驱动
+- 新增 `AnimatorParameterDriverManager` 管理器,统一管理参数驱动的初始化和应用逻辑
+- 增强动画参数显示器功能:
+ - 添加参数缓存机制,优化参数获取性能,减少重复计算
+ - 支持显示 Animator 控制器中定义的外部参数,默认排列在列表末尾
+- 新增 `BlueprintID` 组件,用于为游戏对象分配唯一标识符(当前暂无实际功能)
+- 更新依赖版本:`DuckovGameLibs` 从 1.1.6-Steam 更新到 1.2.5-Steam
+
## v1.8.5
- 改进音效播放系统,统一使用 `ModelHandler.PlaySound` 方法管理所有音效播放
diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md
index 86cb1c1..4c02aa1 100644
--- a/CHANGELOG_EN.md
+++ b/CHANGELOG_EN.md
@@ -2,6 +2,24 @@
English | [中文](CHANGELOG.md)
+## v1.8.6
+
+- Added `ModelParameterDriver` component, supporting custom parameter control in animation state machines
+ - Supports multiple parameter operation types:
+ - `Set`: Directly set parameter value
+ - `Add`: Add specified value to existing value
+ - `Random`: Randomly set parameter value (supports range randomization and probability triggering)
+ - `Copy`: Copy value from source parameter to target parameter (supports range conversion)
+ - Supports all Animator parameter types (Float, Int, Bool, Trigger)
+ - Automatically applies parameter driver when animation state enters
+ - Supports parameter validation, ensuring target and source parameters exist before applying driver
+- Added `AnimatorParameterDriverManager` manager to uniformly manage parameter driver initialization and application logic
+- Enhanced animator parameter display functionality:
+ - Added parameter caching mechanism to optimize parameter retrieval performance and reduce redundant calculations
+ - Supports displaying external parameters defined in Animator controller, defaulting to the end of the list
+- Added `BlueprintID` component for assigning unique identifiers to game objects (currently no actual functionality)
+- Updated dependency version: `DuckovGameLibs` updated from 1.1.6-Steam to 1.2.5-Steam
+
## v1.8.5
- Improved audio playback system, unified use of `ModelHandler.PlaySound` method to manage all audio playback
diff --git a/DuckovCustomModel.Core/Data/CustomAnimatorHash.cs b/DuckovCustomModel.Core/Data/CustomAnimatorHash.cs
index 2cc572f..d5b41cc 100644
--- a/DuckovCustomModel.Core/Data/CustomAnimatorHash.cs
+++ b/DuckovCustomModel.Core/Data/CustomAnimatorHash.cs
@@ -10,6 +10,7 @@ public class AnimatorParamInfo
public int Hash { get; set; }
public string Type { get; set; } = string.Empty;
public object? InitialValue { get; set; }
+ public bool IsExternal { get; set; }
}
public static class CustomAnimatorHash
diff --git a/DuckovCustomModel.Core/Data/SoundPlayMode.cs b/DuckovCustomModel.Core/Data/SoundPlayMode.cs
index 0bee963..87bf190 100644
--- a/DuckovCustomModel.Core/Data/SoundPlayMode.cs
+++ b/DuckovCustomModel.Core/Data/SoundPlayMode.cs
@@ -8,4 +8,3 @@ public enum SoundPlayMode
UseTempObject,
}
}
-
diff --git a/DuckovCustomModel.Core/DuckovCustomModel.Core.csproj b/DuckovCustomModel.Core/DuckovCustomModel.Core.csproj
index 620600e..0cc3c92 100644
--- a/DuckovCustomModel.Core/DuckovCustomModel.Core.csproj
+++ b/DuckovCustomModel.Core/DuckovCustomModel.Core.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/DuckovCustomModel.Core/Managers/AnimatorParameterDriverManager.cs b/DuckovCustomModel.Core/Managers/AnimatorParameterDriverManager.cs
new file mode 100644
index 0000000..34b1f85
--- /dev/null
+++ b/DuckovCustomModel.Core/Managers/AnimatorParameterDriverManager.cs
@@ -0,0 +1,194 @@
+using System.Linq;
+using DuckovCustomModel.Core.MonoBehaviours.Animators;
+using UnityEngine;
+
+namespace DuckovCustomModel.Core.Managers
+{
+ public static class AnimatorParameterDriverManager
+ {
+ public static void InitializeDriver(ModelParameterDriver parameterDriver, Animator animator)
+ {
+ if (parameterDriver.Initialized) return;
+
+ parameterDriver.Initialized = true;
+
+ var enableParameters = parameterDriver.parameters
+ .Where(parameter => InitializeParameter(parameter, animator)).ToArray();
+
+ parameterDriver.parameters = enableParameters;
+ parameterDriver.IsEnabled = parameterDriver.parameters.Length > 0;
+ }
+
+ public static void ApplyParameter(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ switch (parameter.type)
+ {
+ case ModelParameterDriver.ChangeType.Set:
+ {
+ ApplyParameterAsSet(parameter, animator);
+ break;
+ }
+ case ModelParameterDriver.ChangeType.Add:
+ {
+ ApplyParameterAsAdd(parameter, animator);
+ break;
+ }
+ case ModelParameterDriver.ChangeType.Random:
+ {
+ ApplyParameterAsRandom(parameter, animator);
+ break;
+ }
+ case ModelParameterDriver.ChangeType.Copy:
+ {
+ ApplyParameterAsCopy(parameter, animator);
+ break;
+ }
+ }
+ }
+
+ private static bool InitializeParameter(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ if (string.IsNullOrEmpty(parameter.name)) return false;
+
+ var parameterExists = animator.parameters
+ .Any(p => p.name == parameter.name);
+
+ if (!parameterExists) return false;
+
+ var destParam = animator.parameters
+ .FirstOrDefault(p => p.name == parameter.name);
+ if (destParam == null) return false;
+
+ parameter.DestParam = destParam;
+
+ if (parameter.type != ModelParameterDriver.ChangeType.Copy) return true;
+ {
+ if (string.IsNullOrEmpty(parameter.source)) return false;
+
+ var sourceParam = animator.parameters
+ .FirstOrDefault(p => p.name == parameter.source);
+ if (sourceParam == null) return false;
+
+ parameter.SourceParam = sourceParam;
+ }
+
+ return true;
+ }
+
+ private static void ApplyParameterAsSet(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ if (parameter.DestParam is not AnimatorControllerParameter targetParam)
+ return;
+
+ switch (targetParam.type)
+ {
+ case AnimatorControllerParameterType.Float:
+ animator.SetFloat(targetParam.name, parameter.value);
+ break;
+ case AnimatorControllerParameterType.Int:
+ animator.SetInteger(targetParam.name, (int)parameter.value);
+ break;
+ case AnimatorControllerParameterType.Bool:
+ animator.SetBool(targetParam.name, parameter.value > 0f);
+ break;
+ case AnimatorControllerParameterType.Trigger:
+ animator.SetTrigger(targetParam.name);
+ break;
+ }
+ }
+
+ private static void ApplyParameterAsAdd(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ if (parameter.DestParam is not AnimatorControllerParameter targetParam)
+ return;
+
+ switch (targetParam.type)
+ {
+ case AnimatorControllerParameterType.Float:
+ {
+ var currentValue = animator.GetFloat(targetParam.name);
+ animator.SetFloat(targetParam.name, currentValue + parameter.value);
+ break;
+ }
+ case AnimatorControllerParameterType.Int:
+ {
+ var currentValue = animator.GetInteger(targetParam.name);
+ animator.SetInteger(targetParam.name, currentValue + (int)parameter.value);
+ break;
+ }
+ }
+ }
+
+ private static void ApplyParameterAsRandom(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ if (parameter.DestParam is not AnimatorControllerParameter targetParam)
+ return;
+
+ switch (targetParam.type)
+ {
+ case AnimatorControllerParameterType.Float:
+ var randomFloat = Random.Range(parameter.valueMin, parameter.valueMax);
+ animator.SetFloat(targetParam.name, randomFloat);
+ break;
+ case AnimatorControllerParameterType.Int:
+ var randomInt = Random.Range((int)parameter.valueMin, (int)parameter.valueMax);
+ animator.SetInteger(targetParam.name, randomInt);
+ break;
+ case AnimatorControllerParameterType.Bool:
+ var randomBool = Random.value < parameter.chance;
+ animator.SetBool(targetParam.name, randomBool);
+ break;
+ case AnimatorControllerParameterType.Trigger:
+ if (Random.value < parameter.chance)
+ animator.SetTrigger(targetParam.name);
+ break;
+ }
+ }
+
+ private static void ApplyParameterAsCopy(ModelParameterDriver.Parameter parameter, Animator animator)
+ {
+ if (parameter.DestParam is not AnimatorControllerParameter targetParam)
+ return;
+
+ if (parameter.SourceParam is not AnimatorControllerParameter sourceParam)
+ return;
+
+ if (sourceParam.type == AnimatorControllerParameterType.Trigger)
+ return;
+
+ var sourceValue = sourceParam.type switch
+ {
+ AnimatorControllerParameterType.Float => animator.GetFloat(sourceParam.name),
+ AnimatorControllerParameterType.Int => animator.GetInteger(sourceParam.name),
+ AnimatorControllerParameterType.Bool => animator.GetBool(sourceParam.name) ? 1f : 0f,
+ _ => 0f,
+ };
+
+ var finalValue = sourceValue;
+ if (parameter.convertRange)
+ {
+ var sourceMin = parameter.sourceMin;
+ var sourceMax = parameter.sourceMax;
+ var targetMin = parameter.valueMin;
+ var targetMax = parameter.valueMax;
+
+ if (sourceMax - sourceMin != 0)
+ finalValue = targetMin + (sourceValue - sourceMin) * (targetMax - targetMin) /
+ (sourceMax - sourceMin);
+ }
+
+ switch (targetParam.type)
+ {
+ case AnimatorControllerParameterType.Float:
+ animator.SetFloat(targetParam.name, finalValue);
+ break;
+ case AnimatorControllerParameterType.Int:
+ animator.SetInteger(targetParam.name, (int)finalValue);
+ break;
+ case AnimatorControllerParameterType.Bool:
+ animator.SetBool(targetParam.name, finalValue > 0f);
+ break;
+ }
+ }
+ }
+}
diff --git a/DuckovCustomModel.Core/MonoBehaviours/Animators/ModelParameterDriver.cs b/DuckovCustomModel.Core/MonoBehaviours/Animators/ModelParameterDriver.cs
new file mode 100644
index 0000000..4a351d0
--- /dev/null
+++ b/DuckovCustomModel.Core/MonoBehaviours/Animators/ModelParameterDriver.cs
@@ -0,0 +1,91 @@
+using System;
+using DuckovCustomModel.Core.Managers;
+using Newtonsoft.Json;
+using UnityEngine;
+
+namespace DuckovCustomModel.Core.MonoBehaviours.Animators
+{
+ public class ModelParameterDriver : StateMachineBehaviour, ISerializationCallbackReceiver
+ {
+ public enum ChangeType
+ {
+ Set,
+ Add,
+ Random,
+ Copy,
+ }
+
+ public Parameter[] parameters = [];
+
+ [HideInInspector] [SerializeField] private string parametersData = string.Empty;
+
+ [Tooltip(
+ "Custom debug message that will be written to the client logs when the ParameterDriver is used. Be careful to remove these before your final upload as this can spam your log files.")]
+ public string debugString = string.Empty;
+
+ [NonSerialized] public bool Initialized;
+
+ [NonSerialized] public bool IsEnabled;
+
+ public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
+ {
+ if (!Initialized)
+ AnimatorParameterDriverManager.InitializeDriver(this, animator);
+
+ if (!IsEnabled)
+ return;
+
+ if (!string.IsNullOrEmpty(debugString))
+ ModLogger.Log($"[AnimatorParameterDriverManager] ParameterDriver Debug: {debugString}");
+
+ foreach (var parameter in parameters) AnimatorParameterDriverManager.ApplyParameter(parameter, animator);
+ }
+
+ public void OnBeforeSerialize()
+ {
+ parametersData = JsonConvert.SerializeObject(parameters);
+ }
+
+ public void OnAfterDeserialize()
+ {
+ if (!string.IsNullOrEmpty(parametersData))
+ parameters = JsonConvert.DeserializeObject(parametersData) ?? [];
+ }
+
+ [Serializable]
+ public class Parameter
+ {
+ [Tooltip("The type of operation to be executed")]
+ public ChangeType type;
+
+ [Tooltip("Parameter that will be written to")]
+ public string name = string.Empty;
+
+ [Tooltip("Source parameter that will be read")]
+ public string source = string.Empty;
+
+ [Tooltip("The value used for this operation")]
+ public float value;
+
+ [Tooltip("Minimum value to be set")] public float valueMin;
+ [Tooltip("Maximum value to be set")] public float valueMax = 1f;
+
+ [Tooltip(
+ "Chance the value will be set. When used with a Bool type, defines the chance the value is set to 1, otherwise it's set to 0.")]
+ [Range(0.0f, 1f)]
+ public float chance = 1f;
+
+ [Tooltip(
+ "If true, we convert the range of the source and destination values according to the ranges given.")]
+ public bool convertRange;
+
+ public float sourceMin;
+ public float sourceMax;
+ public float destMin;
+ public float destMax;
+
+ public object? DestParam;
+ public object? SourceParam;
+ }
+ }
+}
diff --git a/DuckovCustomModel.Core/MonoBehaviours/Packages/BlueprintID.cs b/DuckovCustomModel.Core/MonoBehaviours/Packages/BlueprintID.cs
new file mode 100644
index 0000000..ca1d5e0
--- /dev/null
+++ b/DuckovCustomModel.Core/MonoBehaviours/Packages/BlueprintID.cs
@@ -0,0 +1,18 @@
+using System;
+using UnityEngine;
+
+namespace DuckovCustomModel.Core.MonoBehaviours.Packages
+{
+ [AddComponentMenu("Duckov Custom Model/Blueprint ID")]
+ [DisallowMultipleComponent]
+ public class BlueprintID : MonoBehaviour
+ {
+ public string id = string.Empty;
+
+ [ContextMenu("Generate New ID")]
+ private void GenerateNewID()
+ {
+ id = Guid.NewGuid().ToString();
+ }
+ }
+}
diff --git a/DuckovCustomModel/Constant.cs b/DuckovCustomModel/Constant.cs
index 6c2b6f9..c4c479d 100644
--- a/DuckovCustomModel/Constant.cs
+++ b/DuckovCustomModel/Constant.cs
@@ -4,7 +4,7 @@ public static class Constant
{
public const string ModID = "DuckovCustomModel";
public const string ModName = "Duckov Custom Model";
- public const string ModVersion = "1.8.5";
+ public const string ModVersion = "1.8.6";
public const string HarmonyId = "com.ritsukage.DuckovCustomModel";
}
}
diff --git a/DuckovCustomModel/DuckovCustomModel.csproj b/DuckovCustomModel/DuckovCustomModel.csproj
index 1072cec..2d90ea7 100644
--- a/DuckovCustomModel/DuckovCustomModel.csproj
+++ b/DuckovCustomModel/DuckovCustomModel.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/DuckovCustomModel/UI/ConfigWindow.cs b/DuckovCustomModel/UI/ConfigWindow.cs
index bc491aa..1e46a11 100644
--- a/DuckovCustomModel/UI/ConfigWindow.cs
+++ b/DuckovCustomModel/UI/ConfigWindow.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using Duckov.UI;
using DuckovCustomModel.Configs;
using DuckovCustomModel.Core.Data;
@@ -27,6 +28,8 @@ public class ConfigWindow : MonoBehaviour
private Vector2 _animatorParamsScrollPosition;
private bool _animatorParamsViewingPet;
private Rect _animatorParamsWindowRect = new(10, 10, 600, 1000);
+ private Animator? _cachedAnimator;
+ private List? _cachedParamInfos;
private CharacterInputControl? _charInput;
private bool _charInputWasEnabled;
@@ -415,6 +418,8 @@ private void DrawAnimatorParamsWindow(int windowID)
_paramIsChanging.Clear();
_paramPreviousValues.Clear();
_animatorParamsViewingPet = false;
+ _cachedAnimator = null;
+ _cachedParamInfos = null;
}
var petButtonStyle = _animatorParamsViewingPet ? GUI.skin.box : GUI.skin.button;
@@ -424,6 +429,8 @@ private void DrawAnimatorParamsWindow(int windowID)
_paramIsChanging.Clear();
_paramPreviousValues.Clear();
_animatorParamsViewingPet = true;
+ _cachedAnimator = null;
+ _cachedParamInfos = null;
}
GUILayout.FlexibleSpace();
@@ -435,15 +442,19 @@ private void DrawAnimatorParamsWindow(int windowID)
_scrollViewStyle, GUILayout.Width(AnimatorParamsWindowWidth - 20),
GUILayout.Height(AnimatorParamsWindowHeight - 80));
- var paramInfos = GetCustomAnimatorParams();
+ var animator = currentHandler.CustomAnimator;
+ if (animator != _cachedAnimator || _cachedParamInfos == null)
+ UpdateAnimatorParamsCache(currentHandler);
+
+ var paramInfos = _cachedParamInfos ?? [];
for (var i = 0; i < paramInfos.Count; i += 2)
{
GUILayout.BeginHorizontal();
var paramInfo1 = paramInfos[i];
var paramName1 = $"{paramInfo1.Name} ({paramInfo1.Type})";
- var paramValue1 = GetParameterValue(customAnimatorControl, paramInfo1);
- var paramValueObj1 = GetParameterValueObject(customAnimatorControl, paramInfo1);
+ var paramValue1 = GetParameterValue(customAnimatorControl, paramInfo1, animator);
+ var paramValueObj1 = GetParameterValueObject(customAnimatorControl, paramInfo1, animator);
var style1 = GetParamStyle(paramInfo1, paramValueObj1);
GUILayout.Label($"{paramName1}: {paramValue1}", style1,
@@ -455,8 +466,8 @@ private void DrawAnimatorParamsWindow(int windowID)
{
var paramInfo2 = paramInfos[i + 1];
var paramName2 = $"{paramInfo2.Name} ({paramInfo2.Type})";
- var paramValue2 = GetParameterValue(customAnimatorControl, paramInfo2);
- var paramValueObj2 = GetParameterValueObject(customAnimatorControl, paramInfo2);
+ var paramValue2 = GetParameterValue(customAnimatorControl, paramInfo2, animator);
+ var paramValueObj2 = GetParameterValueObject(customAnimatorControl, paramInfo2, animator);
var style2 = GetParamStyle(paramInfo2, paramValueObj2);
GUILayout.Label($"{paramName2}: {paramValue2}", style2,
@@ -519,23 +530,84 @@ private static Texture2D MakeTex(int width, int height, Color col)
return result;
}
- private static List GetCustomAnimatorParams()
+ private void UpdateAnimatorParamsCache(ModelHandler? modelHandler)
{
- return CustomAnimatorHash.GetAllParams();
+ var customParams = CustomAnimatorHash.GetAllParams();
+ var customParamHashes = new HashSet(customParams.Select(p => p.Hash));
+
+ if (modelHandler?.CustomAnimator == null)
+ {
+ _cachedAnimator = null;
+ _cachedParamInfos = customParams;
+ return;
+ }
+
+ _cachedAnimator = modelHandler.CustomAnimator;
+ var customParamsList = customParams.OrderBy(p => p.Name).ToList();
+ var animatorParamsList = (from animatorParam in modelHandler.CustomAnimator.parameters
+ where !customParamHashes.Contains(animatorParam.nameHash)
+ let paramType = animatorParam.type switch
+ {
+ AnimatorControllerParameterType.Float => "float",
+ AnimatorControllerParameterType.Int => "int",
+ AnimatorControllerParameterType.Bool => "bool",
+ AnimatorControllerParameterType.Trigger => "trigger",
+ _ => "unknown",
+ }
+ let initialValue = (object?)(animatorParam.type switch
+ {
+ AnimatorControllerParameterType.Float => animatorParam.defaultFloat,
+ AnimatorControllerParameterType.Int => animatorParam.defaultInt,
+ AnimatorControllerParameterType.Bool => animatorParam.defaultBool,
+ _ => null,
+ })
+ select new AnimatorParamInfo
+ {
+ Name = animatorParam.name,
+ Hash = animatorParam.nameHash,
+ Type = paramType,
+ InitialValue = initialValue,
+ IsExternal = true,
+ }).ToList();
+
+ animatorParamsList = animatorParamsList.OrderBy(p => p.Name).ToList();
+ _cachedParamInfos = customParamsList.Concat(animatorParamsList).ToList();
}
- private static string GetParameterValue(CustomAnimatorControl customAnimatorControl,
- AnimatorParamInfo paramInfo)
+
+ private static string GetParameterValue(CustomAnimatorControl? customAnimatorControl,
+ AnimatorParamInfo paramInfo, Animator? animator)
{
- if (customAnimatorControl == null) return "N/A";
+ if (!paramInfo.IsExternal)
+ {
+ if (customAnimatorControl == null) return "N/A";
+
+ try
+ {
+ return paramInfo.Type switch
+ {
+ "float" => customAnimatorControl.GetParameterFloat(paramInfo.Hash).ToString("F3"),
+ "int" => customAnimatorControl.GetParameterInteger(paramInfo.Hash).ToString(),
+ "bool" => customAnimatorControl.GetParameterBool(paramInfo.Hash).ToString(),
+ "trigger" => "Trigger",
+ _ => "Unknown",
+ };
+ }
+ catch
+ {
+ return "N/A";
+ }
+ }
+
+ if (animator == null) return "N/A";
try
{
return paramInfo.Type switch
{
- "float" => customAnimatorControl.GetParameterFloat(paramInfo.Hash).ToString("F3"),
- "int" => customAnimatorControl.GetParameterInteger(paramInfo.Hash).ToString(),
- "bool" => customAnimatorControl.GetParameterBool(paramInfo.Hash).ToString(),
+ "float" => animator.GetFloat(paramInfo.Hash).ToString("F3"),
+ "int" => animator.GetInteger(paramInfo.Hash).ToString(),
+ "bool" => animator.GetBool(paramInfo.Hash).ToString(),
"trigger" => "Trigger",
_ => "Unknown",
};
@@ -546,18 +618,38 @@ private static string GetParameterValue(CustomAnimatorControl customAnimatorCont
}
}
- private static object? GetParameterValueObject(CustomAnimatorControl customAnimatorControl,
- AnimatorParamInfo paramInfo)
+ private static object? GetParameterValueObject(CustomAnimatorControl? customAnimatorControl,
+ AnimatorParamInfo paramInfo, Animator? animator)
{
- if (customAnimatorControl == null) return null;
+ if (!paramInfo.IsExternal)
+ {
+ if (customAnimatorControl == null) return null;
+
+ try
+ {
+ return paramInfo.Type switch
+ {
+ "float" => customAnimatorControl.GetParameterFloat(paramInfo.Hash),
+ "int" => customAnimatorControl.GetParameterInteger(paramInfo.Hash),
+ "bool" => customAnimatorControl.GetParameterBool(paramInfo.Hash),
+ _ => null,
+ };
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ if (animator == null) return null;
try
{
return paramInfo.Type switch
{
- "float" => customAnimatorControl.GetParameterFloat(paramInfo.Hash),
- "int" => customAnimatorControl.GetParameterInteger(paramInfo.Hash),
- "bool" => customAnimatorControl.GetParameterBool(paramInfo.Hash),
+ "float" => animator.GetFloat(paramInfo.Hash),
+ "int" => animator.GetInteger(paramInfo.Hash),
+ "bool" => animator.GetBool(paramInfo.Hash),
_ => null,
};
}