void Start()
    {
        anim        = GetComponent <Animator>();
        cardsGrid   = transform.parent.GetComponent <CardsGrid>();
        gameManager = GameObject.FindObjectOfType <GameManager>();
        audioSource = GetComponent <AudioSource>();

        //transform.Find("Front").GetComponent<SpriteRenderer>().sprite.name

        isTurned       = true;
        isInteractable = true;

        anim.SetBool("canTurn", false);
        anim.SetBool("isTurned", isTurned);
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        if (GameCards.Length == 0)
        {
            throw new System.ArgumentException("Please provide unique cards.");
        }
        if (CardHolders.Length == 0)
        {
            throw new System.ArgumentException("Please provide a flattened representation of a card holders grid.");
        }
        if (CardHolders.Length != (GridRows * GridCols))
        {
            throw new System.ArgumentException("Number of card holders must match grid size (n == rows * columns).");
        }

        grid = new CardsGrid(ref CardHolders, GridRows, GridCols);

        PlaceCards();
    }