Example #1
0
    /*
     * void UpdatePlacementOfSlots(){
     *      float xPos;
     *      if (CardsInHand.Count > 0)
     *              xPos = (slots.Children [0].transform.localPosition.x - slots.Children [CardsInHand.Count - 1].transform.localPosition.x) / 1f;
     *      else
     *              xPos = 0f;
     *      Debug.Log (slots.Children [0].transform.position.ToString ());
     *      Debug.Log (slots.Children [CardsInHand.Count - 1].transform.position.ToString ());
     *      //slots.gameObject.transform.DOLocalMoveX (xPos, 0.3f);
     * }*/

    public void PlaceCardsOnNewSlots()
    {
        foreach (GameObject g in CardsInHand)
        {
            if (g != null)
            {
                g.transform.DOLocalMoveX(slots.Children [CardsInHand.IndexOf(g)].transform.localPosition.x, 0.3f);
                WhereIsTheCardOrSoldier w = g.GetComponent <WhereIsTheCardOrSoldier> ();
                //	Debug.Log(g.GetComponent<OneCardManager>().cardAsset.ScriptName.ToString());
                w.Slot = CardsInHand.IndexOf(g);
                w.SetHandSortingOrder();
            }
        }
    }
Example #2
0
    void ChangeLastCardStatusToInHand(GameObject card, WhereIsTheCardOrSoldier w)
    {
//		Debug.Log("Changing state to Hand for card: " + card.gameObject.name);
        if (owner == AreaPosition.blue)
        {
            w.VisualState = VisualStates.BlueHand;
        }
        else
        {
            w.VisualState = VisualStates.RedHand;
        }

        // set correct sorting order
        w.SetHandSortingOrder();
        // end command execution for DrawACArdCommand
        Command.CommandExecutionComplete();
    }