Example #1
0
        public void GetSignalFromRegistryTest()
        {
            TestSignal testSignal;

            Signals.Get(out testSignal);
            Assert.NotNull(testSignal);
        }
        private void Awake()
        {
            Signals.Get(out loadLevelSignal);

            OnLoadLevel(gameData.CurrentLevel);
            loadLevelSignal.AddListener(OnLoadLevel);
        }
Example #3
0
 public void SignalRegistryClearTest()
 {
     Signals.Get <TestSignal>();
     Assert.IsTrue(Signals.Count == 1);
     Signals.Clear();
     Assert.IsTrue(Signals.Count == 0);
 }
Example #4
0
 private void Awake()
 {
     signal    = Signals.Get <StressTestSignal>();
     listeners = new List <DebugListener>();
     for (int i = 0; i < numListener; i++)
     {
         listeners.Add(new DebugListener(i, signal));
     }
     SubscribeListeners();
 }
Example #5
0
        private void Awake()
        {
            Signals.Get(out signal);

            listeners = new List <DebugListener>();
            for (int i = 0; i < numListener; i++)
            {
                listeners.Add(new DebugListener(i, signal, verbose));
            }
            SubscribeListeners();
        }
Example #6
0
        public void SignalRegistryGetMethodsTest()
        {
            Signals.Clear();
            TestSignal testSignal0;
            TestSignal testSignal1;
            TestSignal testSignal2;

            testSignal0 = Signals.Get <TestSignal>();
            Signals.Get(out testSignal1);
            testSignal2 = (TestSignal)Signals.Get(typeof(TestSignal));

            Assert.IsTrue(testSignal0 == testSignal1);
            Assert.IsTrue(testSignal0 == testSignal2);
        }
Example #7
0
        private void Awake()
        {
            Signals.Get(out startGameSignal);
            Signals.Get(out gameOverSignal);
            Signals.Get(out restartLevelSignal);
            Signals.Get(out toMenuSignal);
            Signals.Get(out mortaShootSignal);
            Signals.Get(out allBulletsShotSignal);

            startGameSignal.AddListener(OnStartGame);
            gameOverSignal.AddListener(OnGameOverSignal);
            restartLevelSignal.AddListener(OnRestartLevelSignal);
            toMenuSignal.AddListener(OnToMenuSignal);
            mortaShootSignal.AddListener(OnMortaShoot);
            allBulletsShotSignal.AddListener(OnAllBulletsShot);
        }
        public void Initialize()
        {
            currentState = GameState.Menu;
            levelListAsset.ResetIndex();

            Signals.Get(out startGameSignal);
            Signals.Get(out gameOverSignal);
            Signals.Get(out toMenuSignal);
            Signals.Get(out countdownFinishedSignal);
            Signals.Get(out objectFellOffFloorSignal);
            Signals.Get(out restartLevelSignal);

            startGameSignal.AddListener(OnStartGame);
            toMenuSignal.AddListener(OnToMenu);
            countdownFinishedSignal.AddListener(OnCountdownFinishedSignal);
            objectFellOffFloorSignal.AddListener(OnObjectFellOffFloor);
            restartLevelSignal.AddListener(OnRestartLevel);
        }
Example #9
0
        public void DrawSignalDetailView()
        {
            GUILayout.BeginVertical();

            if (instance == null)
            {
                instance = Signals.Get(type) as ASignal;

                if (instance == null)
                {
                    GUILayout.Label("Only signals derived from ASignal supported");
                    return;
                }
            }

            var indexObject = currentIndexField.GetValue(instance);

            currentIndex = indexObject is int?(int)indexObject : 0;
            var stateObject = stateField.GetValue(instance);

            state = stateObject is ASignal.State ? (ASignal.State)stateObject : ASignal.State.Idle;

            DrawHeader();
            GUILayout.Space(24f);

            DrawDispatchPropertyFields();
            DrawButtons();

            GUILayout.Space(24f);
            DrawLogs();

            GUILayout.Space(24f);
            DrawListeners();

            GUILayout.EndVertical();
        }
Example #10
0
 public void GameOverSuccess()
 {
     Signals.Get <GameOverSignal>().Dispatch(true);
 }
Example #11
0
 private void Awake()
 {
     Signals.Get(out basicExampleSignal);
     SubscribeListeners();
 }
Example #12
0
 private void Awake()
 {
     exampleSignal = Signals.Get <BasicExampleSignal>();
     SubscribeListeners();
 }
Example #13
0
 public void TriggerAllBulletsShot()
 {
     Signals.Get <AllBulletsShotSignal>().Dispatch();
 }
Example #14
0
 public void TriggerCountdownFinished()
 {
     Signals.Get <CountdownFinishedSignal>().Dispatch();
 }
Example #15
0
 public void TriggerExplosion()
 {
     Signals.Get <TriggerExplosionSignal>().Dispatch();
 }
Example #16
0
 public void ToMenu()
 {
     Signals.Get <ToMenuSignal>().Dispatch();
 }
Example #17
0
 public void RestartLevel()
 {
     Signals.Get <RestartLevelSignal>().Dispatch();
 }
        private void Awake()
        {
            Signals.Get(out remainingItemsSignal);

            remainingItemsSignal.AddListener(OnRemainingItems);
        }
Example #19
0
 public void StartGame()
 {
     Signals.Get <StartGameSignal>().Dispatch();
 }
Example #20
0
 public void GameOverFailed()
 {
     Signals.Get <GameOverSignal>().Dispatch(false);
 }
Example #21
0
 public void InitialSetup()
 {
     callLog.Clear();
     Signals.Clear();
     Signals.Get(out signal);
 }