コード例 #1
0
 // ════════════════════════════════════════════════════════ METHODS ════
 // initialize references
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance   = this;
         _player     = Object.FindObjectOfType <ThirdPersonCharacter> ();
         _objective  = Object.FindObjectOfType <Objective> ();
         _goalEffect = Object.FindObjectOfType <GoalEffect> ();
     }
 }
コード例 #2
0
 // initialize references
 private void Awake()
 {
     _player     = Object.FindObjectOfType <ThirdPersonCharacter>();
     _objective  = Object.FindObjectOfType <Objective>();
     _goalEffect = Object.FindObjectOfType <GoalEffect>();
 }