void Awake() { // Initialization. _defaultHP = hp; _enemySpriteAnim = GetComponentInChildren<EnemyMoveSpriteAnimation>(); _scoreManager = GameObject.Find("Game Manager").GetComponent<UIScoreManager>(); }
void Awake() { UIScoreManager = GameObject.Find("pepperUIBoard").GetComponent <UIScoreManager>(); if (UIScoreManager == null) // if UIScoreManager is missing { Debug.LogError("UIScoreManager component missing from this gameobject"); } }
void Awake() { // Initialization. _spawnManager = GameObject.Find(_gameManagerString).GetComponent<EnemySpawnManager>(); _scoreManager = GameObject.Find(_gameManagerString).GetComponent<UIScoreManager>(); _sprite = GetComponent<SpriteRenderer>(); _defaultHP = hp; }
//initializing void Awake() { fishSound = gameObject.GetComponent <AudioSource>(); if (fishSound == null) { // if AudioSource is missing Debug.LogWarning("AudioSource component missing from this gameobject. Adding one."); //let's just add the AudioSource component dynamically fishSound = gameObject.AddComponent <AudioSource>(); } pan = GameObject.FindWithTag(panTag); fishManager = GameObject.FindWithTag(fishManagerTag); lastHeightOffset = 0.0f; task2 = GameObject.Find(taskName).transform; plate = GameObject.FindWithTag(plateTag); UIScoreManager = GameObject.Find("fishUIBoard").GetComponent <UIScoreManager>(); if (UIScoreManager == null) // if UIScoreManager is missing { Debug.LogError("UIScoreManager component missing from this gameobject"); } }
void Awake() { _animator = GetComponent<Animator>(); _scoreManager = GameObject.Find("Game Manager").GetComponent<UIScoreManager>(); _playerFire = GetComponent<PlayerFire>(); _playerImmortal = GetComponent<PlayerImmortalEffect>(); }
void OnEnable() { if (_instance == null) _instance = this; }