コード例 #1
0
 private void Awake()    //Singleton
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #2
0
ファイル: AdalhardWalk.cs プロジェクト: sacripantas/Acrimony
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     player     = GameObject.FindGameObjectWithTag("Player").transform;
     rigid      = animator.GetComponent <Rigidbody2D>();
     adalhardAI = animator.GetComponent <AdalhardAI>();
 }