Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     base.Start();
     MapLoadedEvent.Get().AddListener(OnMapLoaded);
     CharacterEvents.characterDeathEvent.AddListener(OnCharacterDeath);
     LevelEvents.pauseLevelEvent.AddListener(OnPauseOrResume);
 }
 private void OnDestroy()
 {
     MapLoadedEvent.Get().RemoveListener(OnMapLoaded);
     CharacterEvents.characterSelectedEvent.RemoveListener(OnCharacterSelected);
     CharacterEvents.characterDeselectedEvent.RemoveListener(OnCharacterDeselected);
     UIEvents.actionButtonClickedEvent.RemoveListener(OnActionButtonClicked);
 }
Exemplo n.º 3
0
    public void StartLevel()
    {
        if (hasLevelStarted || !TryLoadLevel())
        {
            return;
        }
        MapLoadedEvent.Get().Invoke(map);
        Debug.Log("Map loaded successfully!");
        if (isMultiplayerLevel)
        {
            LevelEvents.levelIsMultiplayerEvent.Invoke();
        }

        if (loadingScreen)
        {
            loadingScreen.SetActive(false);
        }

        if (teams.Count == 0)
        {
            Debug.LogWarning("No teams assigned to the level manager");
            return;
        }
        teams[currentTeamIndex].BeginTurn();
        hasLevelStarted = true;
    }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     UIEvents.actionButtonClickedEvent.AddListener(OnActionButtonClicked);
     MapLoadedEvent.Get().AddListener(OnMapLoaded);
     CharacterEvents.characterSelectedEvent.AddListener(OnCharacterSelected);
     CharacterEvents.characterDeselectedEvent.AddListener(Cleanup);
     TileEvents.tileClickedOnEvent.AddListener(OnTileClickedOn);
     TeamEvents.teamTurnStartedEvent.AddListener(OnTeamTurnStarted);
     CharacterEvents.characterRightClickedEvent.AddListener(OnCharacterRightClickedOn);
     LevelEvents.levelIsMultiplayerEvent.AddListener(LevelIsMultiplayer);
 }
    // Start is called before the first frame update
    void Start()
    {
        MapLoadedEvent.Get().AddListener(OnMapLoaded);

        if (!loadedState)
        {
            currentActionPoints = baseActionPoints;
        }

        if (!(playerHighlilghter = GameObject.Find("PlayerHighlighter")))
        {
            Debug.LogError("Coudln't find the player highlighter!");
            return;
        }
        playerHighlighterDefaultPosition = playerHighlilghter.transform.position;

        LevelEvents.levelIsMultiplayerEvent.AddListener(LevelIsMultiplayer);
    }
    // Start is called before the first frame update
    void Start()
    {
        actionIcons = Resources.LoadAll(actionIconsPath, typeof(Sprite)).Cast <Sprite>().ToArray();

        actionDescriptionText = actionDescriptionPanel.GetComponentInChildren <Text>();
        if (!actionDescriptionText)
        {
            Debug.LogError("No Text component found in children of action description panel!");
        }

        int autoSelectIntValue = PlayerPrefs.GetInt("autoSelectFirstAction", 0);

        shouldAutoSelectFirstAction = autoSelectIntValue == 1 ? true : false;

        MapLoadedEvent.Get().AddListener(OnMapLoaded);
        CharacterEvents.characterSelectedEvent.AddListener(OnCharacterSelected);
        CharacterEvents.characterDeselectedEvent.AddListener(OnCharacterDeselected);
        UIEvents.actionButtonClickedEvent.AddListener(OnActionButtonClicked);
    }
Exemplo n.º 7
0
 private void OnDestroy()
 {
     MapLoadedEvent.Get().RemoveListener(OnMapLoaded);
     CharacterEvents.characterDeathEvent.RemoveListener(OnCharacterDeath);
     LevelEvents.pauseLevelEvent.RemoveListener(OnPauseOrResume);
 }