コード例 #1
0
    private void OnPlayRuleHover(BorderComponent component, bool hovered)
    {
        RuleSlot slot = component.gameObject.GetComponent <RuleSlot>();

        if (currentState != State.CardPlacement ||
            slot.Rule == null ||
            !hovered)
        {
            for (int index = 0; index < this.playSlots.Length; ++index)
            {
                this.playSlots[index].ResetBorderColor();
            }

            return;
        }

        for (int x = 0; x < GameController.GridSize; ++x)
        {
            for (int y = 0; y < GameController.GridSize; ++y)
            {
                int slotIndex = y * GameController.GridSize + x;
                if (slot.Rule.Data.IsSlotAllowed(ref this.nextPlayedCard.Data, this.playSlots, x, y))
                {
                    this.playSlots[slotIndex].SetBorderColor(Color.green);
                }
                else
                {
                    this.playSlots[slotIndex].SetBorderColor(Color.red);
                }
            }
        }
    }
コード例 #2
0
    private void OnRetryPressed(BorderComponent button, bool ison)
    {
        MainManager mainManager = MainManager.Instance;

        if (mainManager == null)
        {
            return;
        }

        mainManager.RequestRestart();
    }
コード例 #3
0
    public void OnPlayMatCardPressed(BorderComponent slot, bool isOn)
    {
        if (this.currentState != State.CardPlacement)
        {
            return;
        }

        CardSlot cardSlot = (CardSlot)slot;

        PlayCard(cardSlot.Index);
    }
コード例 #4
0
    public void OnHandRulePressed(BorderComponent slot, bool isOn)
    {
        if (this.currentState != State.CardRuleChoice)
        {
            return;
        }

        RuleSlot ruleSlot = (RuleSlot)slot;

        this.SelectHandRule(ruleSlot.Index);
        this.SelectRandomCard(ruleSlot.Index);
    }
コード例 #5
0
    public void OnHandCardPressed(BorderComponent slot, bool isOn)
    {
        if (this.currentState != State.CardRuleChoice)
        {
            return;
        }

        CardSlot cardSlot = (CardSlot)slot;

        this.SelectCard(cardSlot.Index);
        this.SelectRandomRule(cardSlot.Index);
    }
コード例 #6
0
 public void OnHandRuleHovered(BorderComponent slot, bool on)
 {
 }