예제 #1
0
        private void Awake()
        {
            tapGesture      = GetComponent <TapGesture> ();
            trans           = GetComponent <Transform> ();
            inputAudio      = GetComponent <AudioSource> ();
            interfeice      = FindObjectOfType <interfaceController> ();
            inputAudio.clip = somCarta;

            cartaArray = new GameObject[trans.childCount];
            bc         = new BoxCollider2D[trans.childCount];
            cartaSC    = new Carta[trans.childCount];

            for (var i = 0; i < cartaArray.Length; i++)
            {
                cartaArray [i] = trans.GetChild(i).gameObject;
                bc [i]         = cartaArray [i].GetComponent <BoxCollider2D> ();
                cartaSC [i]    = cartaArray [i].GetComponent <Carta> ();
            }

            cartaSelecionada = null;
            cooldown         = new WaitForSeconds(GameConstant.COOLDOWN_TIME_CARD);
        }