private void UpdateInput() { if (Input.GetKeyDown(BackButton)) { SignalBus.Get <Signals.BackNavigation>().Raise(); } }
protected override void OnStateEnter() { SignalBus.Get <Signals.BackNavigation>().AddListener(OnNavigationBack); planetLevel.OnLoaded += OnPlanetLevelLoaded; planetLevel.Load(); }
protected override void OnStateFinish() { SignalBus.Get <Signals.BackNavigation>().RemoveListener(OnNavigationBack); planetLevel.OnLoaded -= OnPlanetLevelLoaded; planetLevel.Unload(); }
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(); }
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; }
private void OnDestroy() { SignalBus.Get <Signals.BallJumped>().RemoveListener(OnBallJumped); }
private void Awake() { SignalBus.Get <Signals.BallJumped>().AddListener(OnBallJumped); }
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); }
public void OnFinishObserve(BallMain ball) { isActive = false; SignalBus.Get <Signals.ClickOnPlanetSpace>().RemoveListener(OnClickOnPlanetSpace); }