// Start is called before the first frame update
 void Start()
 {
     eventsManager = EasyGetter.GetUIEventsManager();
     eventsManager.AddListener(EventType.ChangeSceneEvent, ChangeScene);
     eventsManager.AddListener(EventType.ExitGameEvent, HandleExitEvent);
     eventsManager.AddListener(EventType.PauseGameEvent, goToOptions);
 }
Beispiel #2
0
 private void Awake()
 {
     InitDependencies();
     EventsManager.AddListener <GameOverEventType>(OnGameOver);
     EventsManager.AddListener <GameWinEventType>(OnGameWin);
     EventsManager.AddListener <LoadMenuEventType>(OnLoadMenu);
 }
Beispiel #3
0
 // Start is called before the first frame update
 void Start()
 {
     globalManager   = EasyGetter.GetGlobalManager();
     boxCleaner      = globalManager.GetComponent <BoxCleaner>();
     uiEventsManager = globalManager.GetComponent <EventsManager>();
     uiEventsManager.AddListener(EventType.GoBackMainEvent, HandleGoBackMainEvent);
 }
Beispiel #4
0
 private void Awake()
 {
     EventsManager.AddListener(Events.GameInitialization, Initialize);
     EventsManager.AddListener(Events.OpenShop, OnEnableShopUI);
     EventsManager.AddListener(Events.CloseShop, OnDisableShopUI);
     crystalsField.SetUp();
 }
 private void OnEnable()
 {
     EventsManager.AddListener <ICircle>(EventsType.CircleSpawned, OnCircleSpawned);
     EventsManager.AddListener <bool, ICircle>(EventsType.SlicePutInCircle, OnSlicePutInCircle);
     EventsManager.AddListener <ICircle>(EventsType.CircleIsFull, OnCircleIsFull);
     EventsManager.AddListener(EventsType.RestartGame, Restart);
 }
Beispiel #6
0
 private void Awake()
 {
     EventsManager.AddListener(Events.PlayGame, OnEnableUI);
     EventsManager.AddListener(Events.GameOver, OnDisableUI);
     EventsManager.AddListener(Events.RestartGame, OnEnableUI);
     timerField.SetUp();
     OnDisableUI();
 }
Beispiel #7
0
 private void Awake()
 {
     rb = GetComponent <Rigidbody2D>();
     EventsManager.AddListener(Events.PlayGame, OnEnableMovement);
     EventsManager.AddListener(Events.RestartGame, OnDisableMovement);
     EventsManager.AddListener(Events.RestartGame, OnEnableMovement);
     OnDisableMovement();
 }
Beispiel #8
0
    // Use this for initialization
    void Start()
    {
        InvokeRepeating("drawHud", 0.1F, 0.5F);

        EventsManager.AddListener(EventsManager.Events.gameEnded, GameOver);
        EventsManager.AddListener(EventsManager.Events.died, showDeathMessage);
        EventsManager.AddListener(EventsManager.Events.respawned, hideDeathMessage);
    }
Beispiel #9
0
 void Start()
 {
     freezTimer           = gameObject.AddComponent <Timer>();
     rb                   = GetComponent <Rigidbody2D>();
     bc                   = GetComponent <BoxCollider2D>();
     halfOfColliderWidth  = bc.size.x / 2;
     halfOfColliderHeight = bc.size.y / 2;
     EventsManager.AddListener(HandleFreezeEffectActivated);
 }
 private void Awake()
 {
     playerMovement = GetComponent <PlayerMovement>();
     playerInput    = GetComponent <PlayerInput>();
     EventsManager.AddListener(Events.PlayGame, OnPlayGame);
     EventsManager.AddListener(Events.RestartGame, OnRestartGame);
     EventsManager.AddListener(Events.GameOver, OnGameOver);
     EventsManager.AddListener(Events.BackToMenu, OnBackToMenu);
 }
Beispiel #11
0
    // Use this for initialization
    void Start()
    {
        if (isLocalPlayer)
        {
            CmdSpawnMyUnit();
        }

        EventsManager.AddListener(EventsManager.Events.gameEnded, destroyPhysicalPlayer);
    }
Beispiel #12
0
 private void Awake()
 {
     EventsManager.AddListener(Events.RestartGame, OnDisableGameOverUI);
     EventsManager.AddListener(Events.BackToMenu, OnDisableGameOverUI);
     EventsManager.AddListener(Events.GameOver, OnEnableGameOverUI);
     recordScoreField.SetUp();
     crystalsField.SetUp();
     lastScoreAttemptField.SetUp();
     OnDisableGameOverUI();
 }
        private void Start()
        {
            scoreManager = GetComponent <ScoreManager>();
            gameState    = GameStateType.InitialMenu;

            EventsManager.AddListener <OnLandOnStationEvent>(RocketLanded);
            EventsManager.AddListener <OnRocketCrashEvent>(RocketLanded);

            StartInitialMenu();
        }
    public void OnEnable()
    {
        //gestion de la sourie a deplacer aprés
        UnityEngine.Cursor.visible   = false;
        UnityEngine.Cursor.lockState = UnityEngine.CursorLockMode.Locked;

        gameObject.GetComponent <CanvasGroup>().alpha = 0f;

        EventsManager.AddListener(EventsManager.Events.PPressed, OnTogglePauseMenu);
        EventsManager.AddListener(EventsManager.Events.TogglePauseMenu, OnTogglePauseMenu);
    }
Beispiel #15
0
    public void Start()
    {
        canvasGroup = gameObject.GetComponent <CanvasGroup>();

        EmptyScoreboard();

        // La vue écoute les différents événements qui ont un impacte sur cette dernière et agit en conséquence
        EventsManager.AddListener(EventsManager.Events.TabPressed, OnOpenScoreboard);
        EventsManager.AddListener(EventsManager.Events.TabReleased, OnCloseScoreboard);
        EventsManager.AddListener(EventsManager.Events.somebodyDied, UpdateScoreboard);
    }
Beispiel #16
0
 private void Awake()
 {
     EventsManager.AddListener(Events.GameInitialization, OnUpdateMenuUIFields);
     EventsManager.AddListener(Events.PlayGame, OnDisableMenuUI);
     EventsManager.AddListener(Events.BackToMenu, OnEnableMenuUI);
     EventsManager.AddListener(Events.OpenSettings, OnDisableMenuUI);
     EventsManager.AddListener(Events.CloseSettings, OnEnableMenuUI);
     EventsManager.AddListener(Events.OpenShop, OnDisableMenuUI);
     EventsManager.AddListener(Events.CloseShop, OnEnableMenuUI);
     recordScoreField.SetUp();
     crystalsField.SetUp();
 }
Beispiel #17
0
 private void Awake()
 {
     EventsManager.AddListener(Events.PlayGame, OnEnableGameUI);
     EventsManager.AddListener(Events.RestartGame, OnEnableGameUI);
     EventsManager.AddListener(Events.GameOver, OnDisableGameUI);
     EventsManager.AddListener(Events.AddScore, OnUpdateScore);
     EventsManager.AddListener(Events.AddExtraScore, OnUpdateScore);
     EventsManager.AddListener(Events.AddCrystal, OnUpdateCrystals);
     scoreField.SetUp();
     crystalsField.SetUp();
     OnDisableGameUI();
 }
Beispiel #18
0
 private void Awake()
 {
     playerInput    = GetComponent <PlayerInput>();
     playerMovement = GetComponent <PlayerMovement>();
     rb             = GetComponent <Rigidbody2D>();
     EventsManager.AddListener(Events.PlayGame, OnSetMoveState);
     EventsManager.AddListener(Events.GameOver, OnSetGameOverState);
     EventsManager.AddListener(Events.RestartGame, OnResetPlayer);
     EventsManager.AddListener(Events.RestartGame, OnSetMoveState);
     contactFilter2D.layerMask    = (1 << 8);
     contactFilter2D.useLayerMask = true;
 }
Beispiel #19
0
        private void Awake()
        {
            EventsManager.AddListener(Events.GameInitialization, OnLoadSettingsData);
            EventsManager.AddListener(Events.OpenSettings, OnEnableSettingsUI);
            EventsManager.AddListener(Events.OpenSettings, OnLoadSettingsData);
            EventsManager.AddListener(Events.CloseSettings, OnDisableSettingsUI);

            #if UNITY_ANDROID
            resolutionLabel.SetActive(false);
            resolutionSlider.gameObject.SetActive(false);
            #endif

            #if !UNITY_EDITOR && UNITY_STANDALONE
            var currentHeightResolution = Screen.currentResolution.height;
            maxResolutionHeight       = currentHeightResolution - 100;
            resolutionSlider.minValue = minResolutionHeight;
            resolutionSlider.maxValue = maxResolutionHeight;
            #endif

            OnDisableSettingsUI();
        }
Beispiel #20
0
 private void Awake()
 {
     InitDependencies();
     EventsManager.AddListener <LevelVertexButtoPressEventType>(LevelVertexButtonPressed);
     EventsManager.AddListener <LoadLevelEventType>(OnLoadLevel);
 }
        protected override void Start()
        {
            base.Start();

            EventsManager.AddListener(typeof(ScreenManagerEvent), HandleScreenManagerEvent);
        }
Beispiel #22
0
 private void Awake()
 {
     EventsManager.AddListener(Events.GameOver, OnDestorPlatform);
     enabled = false;
 }
 private void Awake()
 {
     EventsManager.AddListener <ShowWinScreenEventType>(OnShowWinScreen);
     HideWinScreen();
 }
 private void Awake()
 {
     AsteroidTransform = transform;
     EventsManager.AddListener <GameOverEventType>(DoDestroy);
 }
 protected void Start()
 {
     RefreshText();
     EventsManager.AddListener(Events.CITY_TREASURY_CHANGED, RefreshText);
 }
Beispiel #26
0
 private void Awake()
 {
     field       = GetComponent <TextMeshProUGUI>();
     fieldFormat = field.text;
     EventsManager.AddListener <LivesLeftChangeTextEventType>(OnLivesLeftChangeText);
 }
 private void Awake()
 {
     EventsManager.AddListener <LevelVertexButtonUpdateEventType>(OnLevelVertexButtonUpdate);
 }
Beispiel #28
0
 private void Awake()
 {
     EventsManager.AddListener(Events.PlayGame, OnResetTimer);
     EventsManager.AddListener(Events.RestartGame, OnResetTimer);
     EventsManager.AddListener(Events.GameOver, OnResetGravityFallSpeed);
 }
Beispiel #29
0
 // Use this for initialization
 void Start()
 {
     _workerHouses = new Dictionary <Home, int> (capacity);
     EventsManager.AddListener(Events.CITY_POPULATION_CHANGED, HirePeople);//TODO le faire plutôt via une coroutine qui tourne tous les X temps
     HirePeople(capacity);
 }
 protected void Start()
 {
     RefreshText();
     EventsManager.AddListener(Events.RPG_HEALTH_CHANGED, RefreshText);
 }