Ejemplo n.º 1
0
        private void Awake()
        {
            var uiManager = GameObject.FindGameObjectWithTag("OnScreenUI");

            if (uiManager == null)
            {
                throw new MissingReferenceException("Missing reference to the UI manager.");
            }

            inGameScreenManager = uiManager.GetComponentInChildren <InGameScreenManager>(true);
            if (inGameScreenManager == null)
            {
                throw new MissingReferenceException("Missing reference to the in game screen manager.");
            }

            healthBarController = inGameScreenManager.GetComponentInChildren <HealthBarController>(true);


            postProcessObject = GameObject.FindGameObjectWithTag("PostProcessing");
            if (postProcessObject == null)
            {
                throw new MissingReferenceException("Missing reference to the post process object.");
            }

            var volume = postProcessObject.GetComponent <PostProcessVolume>();

            volume.profile.TryGetSettings(out damageVolumeSettings);
        }
        private void Awake()
        {
            var uiManager = GameObject.FindGameObjectWithTag("OnScreenUI")?.GetComponent <UIManager>();

            if (uiManager == null)
            {
                throw new NullReferenceException("Was not able to find the OnScreenUI prefab in the scene.");
            }

            inGameManager = uiManager.InGameManager;
            if (inGameManager == null)
            {
                throw new NullReferenceException("Was not able to find the in-game manager in the scene.");
            }
        }
        private void Awake()
        {
            movement        = GetComponent <ClientMovementDriver>();
            shooting        = GetComponent <ClientShooting>();
            shotRayProvider = GetComponent <ShotRayProvider>();
            fpsAnimator     = GetComponent <FpsAnimator>();
            fpsAnimator.InitializeOwnAnimator();
            currentGun = GetComponent <GunManager>();
            controller = GetComponent <IControlProvider>();

            var uiManager = GameObject.FindGameObjectWithTag("OnScreenUI")?.GetComponent <UIManager>();

            if (uiManager == null)
            {
                throw new NullReferenceException("Was not able to find the OnScreenUI prefab in the scene.");
            }

            inGameManager = uiManager.InGameManager;
            if (inGameManager == null)
            {
                throw new NullReferenceException("Was not able to find the in-game manager in the scene.");
            }
        }