Example #1
0
 void Awake()
 {
     // Initialization.
     _defaultHP = hp;
     _enemySpriteAnim = GetComponentInChildren<EnemyMoveSpriteAnimation>();
     _scoreManager = GameObject.Find("Game Manager").GetComponent<UIScoreManager>();
 }
Example #2
0
 void Awake()
 {
     UIScoreManager = GameObject.Find("pepperUIBoard").GetComponent <UIScoreManager>();
     if (UIScoreManager == null) // if UIScoreManager is missing
     {
         Debug.LogError("UIScoreManager component missing from this gameobject");
     }
 }
Example #3
0
 void Awake()
 {
     // Initialization.
     _spawnManager = GameObject.Find(_gameManagerString).GetComponent<EnemySpawnManager>();
     _scoreManager = GameObject.Find(_gameManagerString).GetComponent<UIScoreManager>();
     _sprite = GetComponent<SpriteRenderer>();
     _defaultHP = hp;
 }
Example #4
0
    //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");
        }
    }
Example #5
0
 void Awake()
 {
     _animator = GetComponent<Animator>();
     _scoreManager = GameObject.Find("Game Manager").GetComponent<UIScoreManager>();
     _playerFire = GetComponent<PlayerFire>();
     _playerImmortal = GetComponent<PlayerImmortalEffect>();
 }
Example #6
0
 void OnEnable()
 {
     if (_instance == null)
         _instance = this;
 }