Пример #1
0
    private SelectorActor CreateCard(Vector3 pos, Vector3 scale, Quaternion rot, Assets.Service.Response.Card card)
    {
        if (ItemPrefab != null)
        {
            SelectorActor sa = Instantiate(ItemPrefab);
            sa.transform.SetParent(transform);
            sa.transform.position   = pos;
            sa.transform.localScale = scale;
            sa.transform.rotation   = rot;

            Step ph = sa.gameObject.GetComponent <Step>();
            ph.NextPhase = CardSelectedPhase;

            Card cardcontroller = sa.GetComponentInChildren <Card>();
            if (cardcontroller != null)
            {
                cardcontroller.CardText = card.text;
                cardcontroller.IsBlack  = card.is_black;
            }
            CreatedItems.Add(sa);
            return(sa);
        }

        throw new Exception("No item prefab set");
    }
Пример #2
0
 public void CreateBlackCard(Assets.Service.Response.Card card)
 {
     theBlackOne = CreateCard(grid.GetAtXY(5, 1), transform.localScale, transform.localRotation * Quaternion.Euler(90, 180, 0), card);
 }