Beispiel #1
0
 private void UpdateInput()
 {
     if (Input.GetKeyDown(BackButton))
     {
         SignalBus.Get <Signals.BackNavigation>().Raise();
     }
 }
Beispiel #2
0
        protected override void OnStateEnter()
        {
            SignalBus.Get <Signals.BackNavigation>().AddListener(OnNavigationBack);

            planetLevel.OnLoaded += OnPlanetLevelLoaded;

            planetLevel.Load();
        }
Beispiel #3
0
        protected override void OnStateFinish()
        {
            SignalBus.Get <Signals.BackNavigation>().RemoveListener(OnNavigationBack);

            planetLevel.OnLoaded -= OnPlanetLevelLoaded;

            planetLevel.Unload();
        }
Beispiel #4
0
        public void PushTowardsPosition(Vector2 targetPosition, float pushForce)
        {
            Vector2 currentPos  = transform.position;
            Vector2 forceVector = (targetPosition - currentPos).normalized * pushForce;

            _rigBody.AddForce(forceVector, ForceMode2D.Impulse);

            SignalBus.Get <Signals.BallJumped>().Raise();
        }
Beispiel #5
0
        public void OnBeginObserve(BallMain ball)
        {
            isActive = true;

            SignalBus.Get <Signals.ClickOnPlanetSpace>().AddListener(OnClickOnPlanetSpace);

            _ballMover = ball.GetBallComponent <BallMover>();

            Assert.IsNotNull(_ballMover);
        }
 private void PlanetButtonOnClick(UIPlanetSelectButton planetButton)
 {
     SignalBus.Get <Signals.PlanetChangeRequest>().Raise(planetButton.PlanetId);
 }
        private void OnClick(Vector2 clickPos)
        {
            SignalBus.Get <Signals.ClickOnPlanetSpace>().Raise(clickPos);

            lastClickPos = clickPos;
        }
Beispiel #8
0
 private void OnDestroy()
 {
     SignalBus.Get <Signals.BallJumped>().RemoveListener(OnBallJumped);
 }
Beispiel #9
0
 private void Awake()
 {
     SignalBus.Get <Signals.BallJumped>().AddListener(OnBallJumped);
 }
Beispiel #10
0
 private void OnPlanetLevelLoaded(GameLevel level)
 {
     SignalBus.Get <Signals.PlanetChanged>().Raise(PlanetsDataHolder.CurrentPlanetId);
 }
 private void OnDestroy()
 {
     SignalBus.Get <Signals.PlanetChanged>().RemoveListener(OnPlanetChanged);
 }
 void Awake()
 {
     SignalBus.Get <Signals.PlanetChanged>().AddListener(OnPlanetChanged);
 }
        protected override void OnStateFinish()
        {
            SignalBus.Get <Signals.PlanetChangeRequest>().RemoveListener(OnPlanetChangeRequested);

            levelManager.UnloadLevel(MainMenuLevel);
        }
        protected override void OnStateEnter()
        {
            levelManager.LoadLevel(MainMenuLevel);

            SignalBus.Get <Signals.PlanetChangeRequest>().AddListener(OnPlanetChangeRequested);
        }
Beispiel #15
0
        public void OnFinishObserve(BallMain ball)
        {
            isActive = false;

            SignalBus.Get <Signals.ClickOnPlanetSpace>().RemoveListener(OnClickOnPlanetSpace);
        }