Version: 2022.2
언어: 한국어

SharedBetweenAnimatorsAttribute

class in UnityEngine

매뉴얼로 전환

설명

The SharedBetweenAnimatorsAttribute specifies that this StateMachineBehaviour is instantiated only once and shared by all Animator instances. This attribute reduces the memory footprint for each controller instance.

You choose which StateMachineBehaviour uses this attribute. If your StateMachineBehaviour changes a member variable, this affects all other Animator instances that use it. See Also: StateMachineBehaviour class.

using UnityEngine;

[SharedBetweenAnimators] public class AttackBehaviour : StateMachineBehaviour { public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Debug.Log("OnStateEnter"); } }