Inheritance: MonoBehaviour
コード例 #1
0
 void OnEnable()
 {
     animatorEvents          = target as AnimatorEvents;
     animatorEvents.animator = animatorEvents.gameObject.GetComponent <Animator>();
     if (animatorEvents.CheckRedudancy())
     {
         return;
     }
 }
コード例 #2
0
ファイル: PlayerMovement.cs プロジェクト: dqgiang/rushgame
    void Awake()
    {
        _anim = GetComponent <Animator>();

        guiManager = GameObject.FindGameObjectWithTag(Tags.gui).GetComponent <GUIManager>();

        //control events for current animator
        _animatorEvents = GetComponent <AnimatorEvents>();
        gameController  = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        testMultiplayer = GameObject.Find("Multiplayer Manager");
    }
コード例 #3
0
    public bool CheckRedudancy()
    {
        AnimatorEvents exisitingAnimatorEvents = GetComponent <AnimatorEvents>();

        if (exisitingAnimatorEvents != this && exisitingAnimatorEvents != null)
        {
            Debug.LogError("There can be only one AnimatorEvents per Animator");
            DestroyImmediate(this);
            return(true);
        }
        return(false);
    }
コード例 #4
0
 void OnEnable()
 {
     animatorEvents = target as AnimatorEvents;
     animatorEvents.animator = animatorEvents.gameObject.GetComponent<Animator>();
     if (animatorEvents.CheckRedudancy())
         return;
 }
コード例 #5
0
 private void Start()
 {
     anim       = GetComponent <Animator>();
     animEvents = GetComponent <AnimatorEvents>();
 }