Files
wub f0ff43f54a CLUB
clib lights and arragement along with fixes for new networking
2026-10-26 18:17:30 +00:00

52 lines
1.3 KiB
C#

using UnityEngine;
namespace UFMTESTING1
{
[HelpURL("https://incrediworlds.gitbook.io/somnium-space-dendoc/worlds-creation/community-modules/community-networking")]
public class AnimatorParameterSetter : MonoBehaviour
{
[Header("Alpha V2.1 [2026, 07, 19]")]
[SerializeField] private Animator _animator;
[Header("Used for setting parameter")]
[SerializeField] private string _parameterName = "Value";
// Use with unity events to change the current parameter name
public void ChangeParameterName(string parameterName)
{
_parameterName = parameterName;
}
public void SetTrigger()
{
if (_animator != null)
{
_animator.SetTrigger(_parameterName);
}
}
public void SetBool(bool value)
{
if (_animator != null)
{
_animator.SetBool(_parameterName, value);
}
}
public void SetInt(int value)
{
if (_animator != null)
{
_animator.SetInteger(_parameterName, value);
}
}
public void SetFloat(float value)
{
if (_animator != null)
{
_animator.SetFloat(_parameterName, value);
}
}
}
}