Exemplo n.º 1
0
 private void Awake()
 {
     sharedInstance        = this;
     mouseIOService        = NagaUtils.VerifyGetComponent <IMouseIOInfoProvider>(mouseIO);
     playerPositionService = NagaUtils.VerifyGetComponent <IPositionInfoProvider>(playerPosition);
     inventoryService      = NagaUtils.VerifyGetComponent <IInventoryService>(inventory);
     ammoDisplayService    = NagaUtils.VerifyGetComponent <IAmmoDisplayService>(ammoDisplay);
     scoreSystemService    = NagaUtils.FindObjectOfType <IScoreSystem>(); //Maybe move this (but to where?)
 }
Exemplo n.º 2
0
        private void UntimedOnScenarioLoaded()
        {
            _scenarioState = ScenarioState.Untimed;

            session.SetScoreSystem(NagaUtils.FindObjectOfType <IScoreSystem>());

            EnablePlayer();
            statUI.SetUntimed();
            countdownUI.Hide();
            onScenarioStarted.Invoke();
        }
Exemplo n.º 3
0
        private void SetupUI <T>(ref T fieldMember, Component prefab)
        {
            fieldMember = NagaUtils.FindObjectOfType <T>();
            if (fieldMember == null)
            {
                var obj = Instantiate(prefab);
                DontDestroyOnLoad(obj.gameObject);
                fieldMember = obj.GetComponent <T>();

                if (fieldMember == null)
                {
                    throw new System.Exception($"Prefab does not contain a component that implements {typeof(T).Name}!");
                }
            }
        }
Exemplo n.º 4
0
        private void TimedOnScenarioLoaded()
        {
            _scenarioState = ScenarioState.ShootToStart;

            session.SetScoreSystem(NagaUtils.FindObjectOfType <IScoreSystem>());

            SetupCountdownLogic();
            statUI.SetTimeDP(0);
            statUI.SetTimerMode();
            statUI.UpdateTime(session.timeAllowed * 1000);
            SetupCountdownUI();

            scenarioTimer.onEndTimer.AddListener(OnTimedScenarioEnded);

            shootToStartCoroutine = Timing.RunCoroutine(_WaitToStart(() => {
                scenarioTimer.StartTimer(session.timeAllowed, countdownTime);
                _scenarioState = ScenarioState.Countdown;
            }));
        }
Exemplo n.º 5
0
    /*
     *
     *  FIELDS AND PROPERTIES END
     *
     */

    private void Awake()
    {
        mouseLookScript = NagaUtils.FindObjectOfType <IMouseIOInfoProvider>();
    }