Example #1
0
 public ClickOutOfBoardEmmiter()
 {
     Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_ENTER, OnTileMouseEnter);
     Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_EXIT, OnTileMouseExit);
     Unibus.Subscribe <AbilityDisplay>(AbilityDisplay.ABILITY_MOUSE_ENTER, OnTileMouseEnter);
     Unibus.Subscribe <AbilityDisplay>(AbilityDisplay.ABILITY_MOUSE_EXIT, OnTileMouseExit);
     Unibus.Subscribe <string>(Dialog.DIALOG_MOUSE_ENTER, OnDialogMouseEnter);
     Unibus.Subscribe <string>(Dialog.DIALOG_MOUSE_EXIT, OnDialogMouseExit);
 }
    // Start is called before the first frame update
    void Start()
    {
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitBoardMouseEnter);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitBoardMouseExit);
        Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_ENTER, OnCardMouseEnter);
        Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_EXIT, OnCardMouseExit);

        boardCreator = this.transform.Find("Board").GetComponent <BoardCreator>();
    }
Example #3
0
    private void ShowDialog(Step step)
    {
        if (step.image == null)
        {
            this.dialog = this.transform.Find("Dialog").gameObject;
        }
        else
        {
            this.dialog = this.transform.Find("DialogBig").gameObject;
            var spriteRenderer = this.transform.Find("DialogBig/Image").GetComponent <SpriteRenderer>();
            spriteRenderer.sprite = Resources.Load <Sprite>($"{step.image}");
        }
        this.dialog.SetActive(true);
        this.dialog.transform.Find("Text").GetComponent <TextMeshProUGUI>().text = step.text;
        this.dialog.transform.Find("StepCounter").GetComponent <TextMeshProUGUI>().text
            = $"{this.currentStepIndex + 1} / {this.tutorialSteps.Length}";

        if (step.stepEvent != null)
        {
            Unibus.Subscribe <CardDisplay>(step.stepEvent, this.OnEventHandled);
        }

        if (step.dialogPosition != null)
        {
            this.dialog.transform.localPosition = new Vector3(step.dialogPosition[0], step.dialogPosition[1], 0);
        }
        else
        {
            this.dialog.transform.localPosition = new Vector3(0, 70, 0);
        }

        this.arrowLeft.SetActive(false);
        this.arrowBottom.SetActive(false);
        this.arrowRight.SetActive(false);
        this.arrowBottomLeft.SetActive(false);

        if (step.arrow != null)
        {
            if (step.arrow == Step.Arrow.left)
            {
                this.arrowLeft.SetActive(true);
            }
            if (step.arrow == Step.Arrow.bottom)
            {
                this.arrowBottom.SetActive(true);
            }
            if (step.arrow == Step.Arrow.right)
            {
                this.arrowRight.SetActive(true);
            }
            if (step.arrow == Step.Arrow.bottomLeft)
            {
                this.arrowBottomLeft.SetActive(true);
            }
        }
    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_ATTACKED, OnCardAttacked);
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_PLAYED, OnCardPlayed);
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_DIED, OnCardDied);
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_MOVED, OnCardMoved);
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_SELECTED, OnCardSelected);

        this.AudioSource = this.GetComponent <AudioSource>();
    }
Example #5
0
 void Start()
 {
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_PLAY_AS_MANA, OnCardPlayAsMana);
     Unibus.Subscribe <PlayCardAction> (ActionEmmiter.CARD_PLAY, OnCardPlay);
     Unibus.Subscribe <MoveCardAction> (ActionEmmiter.CARD_MOVE, OnCardMove);
     Unibus.Subscribe <AttackCardAction> (ActionEmmiter.CARD_ATTACK, OnCardAttack);
     Unibus.Subscribe <AttackCardAction> (ActionEmmiter.CARD_MOVE_AND_ATTACK, OnCardMoveAndAttack);
     Unibus.Subscribe <HealCardAction> (ActionEmmiter.CARD_HEAL, OnCardHeal);
     Unibus.Subscribe <SimpleAbilityCardAction> (ActionEmmiter.CARD_USE_MANA_ABILITY, OnUseManaAbility);
     Unibus.Subscribe <SimpleAbilityCardAction> (ActionEmmiter.CARD_TO_AIM, OnToAim);
 }
Example #6
0
    public void Enable()
    {
        if (this.boardCreator.hoveredUnit)
        {
            this.OnUnitMouseEnterOnBoard(this.boardCreator.hoveredUnit);
        }

        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_CLICKED_ON_BOARD, OnUnitSelectedOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitMouseEnterOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitMouseExitOnBoard);
        Unibus.Subscribe <CardDisplay>(PlayerTableDisplay.CARD_SELECTED_ON_TABLE, OnCardClicked);
    }
Example #7
0
    void Start()
    {
        Button endOfTurnButton = this.transform.Find("UI/EndOfTurn").GetComponent <Button>();

        endOfTurnButton.onClick.AddListener(this.OnEndOfTurnButtonClick);

        Unibus.Subscribe <string>(HttpRequest.HTTP_ERROR, OnHttpError);

        this.executer = new Executer(this);

        this.changeTurn.GetComponent <CanvasGroup>().DOFade(0, 0);
    }
Example #8
0
        protected override void OnInit()
        {
            base.OnInit();

            mTableGameLevel = TableGameLevel.Get(D.I.gameLevel);
            mSpawnCountFix  = FormulaUtil.Expresso(CT.table.formulaArgsVirusSpawnCount);

            mWaveModule.Init();
            mBuffGenModule.Init();
            Unibus.Subscribe <EventAircraft>(OnEventAircraft);
            Unibus.Subscribe <EventVirus>(OnEventVirus);
        }
    public void Enable(UnitDisplay selectedUnit, HealingAbility healingAbility)
    {
        this.Enable();
        this.selectedUnit = selectedUnit;

        this.points = this.boardCreator.BlinkHealTargets(selectedUnit, healingAbility.range);

        CursorController.SetPointer();

        Dialog.instance.ShowDialog("Choose ally unit to heal (Heal ability)", "Cancel", this.EnableNoSelectionsState);

        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_CLICKED_ON_BOARD, OnUnitSelectedOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitMouseEnterOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitMouseExitOnBoard);
    }
Example #10
0
    public void Enable(UnitDisplay attackerSelectedUnit, UnitDisplay attackedSelectedUnit)
    {
        this.Enable();
        this.attackerSelectedUnit = attackerSelectedUnit;
        this.attackedSelectedUnit = attackedSelectedUnit;

        this.points = this.boardCreator.BlinkRicochetTargets(attackedSelectedUnit);

        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_CLICKED_ON_BOARD, OnUnitSelectedOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitMouseEnterOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitMouseExitOnBoard);

        CursorController.SetRangeAttack();

        Dialog.instance.ShowDialog("Choose enemy unit for ricochet target (ricochet ability)", "Cancel", this.EnableNoSelectionsState);

        attackedSelectedUnit.CardDisplay.Select();
    }
    public void Enable(CardDisplay card)
    {
        this.skipedFirstCheckClickOutOfAnyCard = false;
        this.enabled      = true;
        this.SelectedCard = card;
        card.Select();
        this.points = this.boardCreator.ShowPlacesToCastCreatures();

        Dialog.instance.ShowDialog("Choose square to summon unit to it", "Cancel", this.SkipSelection);

        CursorController.SetPointer();

        Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_LEFT_CLICK, OnTileMouseLeftClick);
        Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_ENTER, OnCardEnter);
        Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_EXIT, OnCardExit);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_ENTER_ON_BOARD, OnTileMouseEnterOnBoard);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_EXIT_ON_BOARD, OnTileMouseExitOnBoard);
    }
Example #12
0
        void Start()
        {
            googleAnalytics.LogScreen("Lobby");

            GameState.mainPlayerId        = "";
            GameState.enemyOfMainPlayerId = "";

            var mainMenuButton = this.transform.Find("MainMenuButton").GetComponent <Button>();

            mainMenuButton.onClick.AddListener(this.OnMainMenuButtonClick);

            createGameButton.onClick.AddListener(OnCreateGameButtonClick);

            UpdateGames();
            UpdateDropdowns();

            Unibus.Subscribe <LobbyGame>(LobbyGame.DETELE_GAME, OnDeleteGameHandler);
        }
Example #13
0
    public void Enable(UnitDisplay attackerSelectedUnit, UnitDisplay attackedSelectedUnit)
    {
        this.Enable();
        this.attackerSelectedUnit = attackerSelectedUnit;
        this.attackedSelectedUnit = attackedSelectedUnit;

        this.points = this.boardCreator.ShowPushReach(attackerSelectedUnit, attackedSelectedUnit);

        Unibus.Subscribe <Point>(BoardCreator.CLICKED_ON_VOID_TILE, OnClickedOnVoidTile);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_ENTER_ON_BOARD, OnTileMouseEnterOnBoard);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_EXIT_ON_BOARD, OnTileMouseExitOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitMouseEnterOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitMouseExitOnBoard);

        Dialog.instance.ShowDialog("Choose square to move attacking unit to it (push ability)", "Don't push", this.OnDontPushButtonClick, "Cancel", this.EnableNoSelectionsState);

        this.attackerSelectedUnit.CardDisplay.Select();
        CursorController.SetPointer();
    }
    public void Enable(UnitDisplay selectedUnit)
    {
        this.Enable();

        this.selectedUnit = selectedUnit;

        selectedUnit.CardDisplay.Select();
        selectedUnit.ShowAbilities();

        this.boardCreator.ShowPathReach(selectedUnit);
        this.ShowRangeAttackReach(selectedUnit);

        Unibus.Dispatch(CardManager.CARD_SELECTED, selectedUnit.CardDisplay);

        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_CLICKED_ON_BOARD, OnUnitSelectedOnBoard);
        Unibus.Subscribe <Point>(BoardCreator.CLICKED_ON_VOID_TILE, OnClickedOnVoidTile);
        Unibus.Subscribe <AbilityActivated>(UnitDisplay.ABILITY_ACTIVATED, OnAbilityActivated);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_ENTER_ON_BOARD, OnUnitMouseEnterOnBoard);
        Unibus.Subscribe <UnitDisplay>(BoardCreator.UNIT_MOUSE_EXIT_ON_BOARD, OnUnitMouseExitOnBoard);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_ENTER_ON_BOARD, OnTileMouseEnterOnBoard);
        Unibus.Subscribe <TileDisplay>(BoardCreator.TILE_WITHOUT_UNIT_MOUSE_EXIT_ON_BOARD, OnTileMouseExitOnBoard);
        Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_CLICKED, OnCardClicked);
        Unibus.Subscribe <CardDisplay>(CardManager.CARD_MOVED, OnCardMoved);
    }
 // Start is called before the first frame update
 void Start()
 {
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_ENTER, OnCardMouseEnter);
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_EXIT, OnCardMouseExit);
 }
Example #16
0
 public void Start()
 {
     Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_LEFT_CLICK, OnTileMouseLeftClick);
     Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_ENTER, OnTileMouseEnter);
     Unibus.Subscribe <Point>(TileDisplay.TILE_MOUSE_EXIT, OnTileMouseExit);
 }
Example #17
0
 private void Start()
 {
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_TAPPED, OnCardChanged);
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_UNTAPPED, OnCardChanged);
 }
Example #18
0
 // Start is called before the first frame update
 void Start()
 {
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_ENTER, OnCardMouseEnter);
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_MOUSE_EXIT, OnCardMouseExit);
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_CLICKED, OnCardSelectedToPlayHandler);
 }
Example #19
0
 private void Awake()
 {
     Ins = this;
     Unibus.Subscribe <EventVirus>(OnEventVirus);
 }
Example #20
0
 void Start()
 {
     Unibus.Subscribe <CardDisplay>(CardDisplay.CARD_CLICKED, OnCardClicked);
 }
Example #21
0
 protected void Enable()
 {
     this.OnEnabled();
     Unibus.Subscribe <string>(ClickOutOfBoardEmmiter.CLICK_OUT_OF_BOARD, OnClickOutOfBoard);
     Unibus.Subscribe <string>(ClickOutOfBoardEmmiter.RIGHT_CLICK, OnRightClick);
 }
Example #22
0
 public void Enable()
 {
     Unibus.Subscribe <CardDisplay>(PlayerHandDisplay.CARD_SELECTED_TO_PLAY, OnCardSelectedToPlayHandler);
 }