Ejemplo n.º 1
0
    public bool OnClickRun()
    {
        isRunning = isRunning == false;
        if (isRunning == false)
        {
            return(false);
        }

        // grab cards to run
        programToRun = CardsProgram.GetComponentsInChildren <Card>().ToList();
        function     = CardsFunction.GetComponentsInChildren <Card>().ToList();

        // run them
        StartCoroutine(executeProgram());

        return(true);
    }
Ejemplo n.º 2
0
    public void MakeChild(Card card, bool animate = true)
    {
        Card[] toAlign = GetComponentsInChildren <Card>();
        if (toAlign.Length >= maxCards)
        {
            return;
        }
        if (card.transform.root != transform.root)
        {
            return;
        }

        if (validateAgainst != null)
        {
            if (validateAgainst.GetComponentsInChildren <Card>().Length != validateAgainst.maxCards)
            {
                return;
            }
        }

        card.transform.parent = transform;
        if (isEndTurn)
        {
            EndTurn();
        }
        if (isDiscard)
        {
            Discard(card);
        }

        if (justPlace)
        {
            JustPlace();
        }
        else
        {
            AlignHorizontal(animate);
        }
    }