// Is public to be called on test methods public void PlayerGoing() { _state = HorizontalPipeState.PLAYER_GOING; PipesSettings ps = PipesSettings.Instance; transform.position = new Vector3(-ps.HorizontalXStop, transform.position.y); }
void Start() { _state = HorizontalPipeState.MOVING_TO_POSITION; _eventsManager = new EventsManager <HorizontalPipeEvent>(); _xToStop = PipesSettings.Instance.HorizontalXStop; gameObject.AddComponent <MoveXHorizontalPipeB>(); gameObject.AddComponent <DestroyPipeB>(); gameObject.AddComponent <DestroyOnMatchEnd>(); PlayerEnterInHorizontalPipeDetectorB b = gameObject.AddComponent <PlayerEnterInHorizontalPipeDetectorB>(); b.SetParams(this); _gameController = GameStorer.Instance.GameController; _gameController.On(GameEvent.HORIZONTAL_PIPE_COMPLETLY_VISIBLE, ReachXToStop); _gameController.On(GameEvent.EXITING_HORIZONTAL_PIPE_START, PlayerGoing); }
// Is public to be called on test methods public void ReachXToStop() { _state = HorizontalPipeState.PLAYER_COMING; }