Example #1
0
        void Awake()
        {
            m_RoundText             = GameObject.FindGameObjectWithTag("UI").GetComponentInChildren <RoundText>();
            m_ShopController        = shop.GetComponent <ShopController>();
            m_CameraShake           = Camera.main.GetComponent <CameraShake>();
            m_PlayerShootController = player.GetComponent <PlayerShootController>();
            m_PlayerController      = player.GetComponent <PlayerController>();

            var storage = GameObject.FindGameObjectWithTag("RoundPersistent");

            if (storage == null)
            {
                storage = new GameObject("Round_Persistent")
                {
                    tag = "RoundPersistent"
                };
                m_RoundStorage = storage.AddComponent <RoundPersistentScore>();
            }
            else
            {
                m_RoundStorage = storage.GetComponent <RoundPersistentScore>();
            }

            m_BGMAudioPlayer = FindObjectOfType <BGMAudioPlayer>();

            if (m_BGMAudioPlayer == null)
            {
                var audioObj = new GameObject("BGM");
                audioObj.AddComponent <AudioSource>();
                m_BGMAudioPlayer = audioObj.AddComponent <BGMAudioPlayer>();
            }

            m_AudioPlayer = Camera.main.GetComponent <AudioPlayer>();
        }
Example #2
0
        void Awake()
        {
            m_Audio = GetComponent <AudioSource>();

            if (m_AudioStatus == null)
            {
                m_AudioStatus = FindObjectOfType <BGMAudioPlayer>();
            }
        }
        void Awake()
        {
            m_BGMAudioPlayer = FindObjectOfType <BGMAudioPlayer>();

            m_AdjustableMoveSpeeds  = GetComponentsInChildren <AdjustableMoveSpeed>();
            m_AdjustableShootSpeeds = GetComponentsInChildren <AdjustableShootSpeed>();

            m_Round = GetComponent <Round>();
        }
Example #4
0
        void Awake()
        {
            if (GAME_MANAGER == null)
            {
                GAME_MANAGER = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
            }

            if (HIGH_SCORE == null)
            {
                HIGH_SCORE = GameObject.FindGameObjectWithTag("RoundPersistent").GetComponent <RoundPersistentScore>();
            }

            if (BGM_AUDIO == null)
            {
                BGM_AUDIO = GameObject.FindObjectOfType <BGMAudioPlayer>();
            }
        }
Example #5
0
        void Start()
        {
            if (HIGH_SCORE == null)
            {
                HIGH_SCORE = GameObject.FindGameObjectWithTag("RoundPersistent").GetComponent <RoundPersistentScore>();
            }

            if (BGM_AUDIO == null)
            {
                BGM_AUDIO = GameObject.FindObjectOfType <BGMAudioPlayer>();
            }

            pauseMenu.SetActive(false);

            isPaused = false;


            DisableButton();
        }
Example #6
0
        void Awake()
        {
            m_GameManager   = GameObject.FindObjectOfType <GameManager>();
            m_PlayerLivesUI = GameObject.FindGameObjectWithTag("LivesUI").GetComponentInChildren <PlayerItemUI>();

            m_ShootController = GetComponent <PlayerShootController>();

            m_AudioPlayer = FindObjectOfType <AudioPlayer>();

            m_AudioControls = FindObjectOfType <BGMAudioPlayer>();

            if (m_AudioControls == null)
            {
                var audioObj = new GameObject("BGM");
                audioObj.AddComponent <AudioSource>();
                m_AudioControls = audioObj.AddComponent <BGMAudioPlayer>();
            }

            m_Collider = GetComponent <Collider2D>();

            m_CurrentLives = initialLives;
        }
Example #7
0
        void Start()
        {
            m_BGMAudioPlayer = GameObject.FindObjectOfType <BGMAudioPlayer>();

            SetImage();
        }