Esempio n. 1
0
    private void OnMouseDown()

    {
        if (Time.time - lastClickTime < catchTime)
        {
            //double click
            //print("Double click");
            if (gameObject.tag == "chatarra")
            {
                // print("Has obtenido una: " + gameObject.tag);
                tiempo = FindObjectOfType <ControladorTiempo>();
                //puntaje = FindObjectOfType<ControladorPuntaje>();
                //nami = FindObjectOfType<NamiControlador>();
                // tiempo.incrementarTiempo();
                //puntaje.IncrementarPuntaje("chatarra");

                anim = GameObject.Find("ÑamiFrames_0").GetComponent <Animator>();

                Instantiate(explosioneffect, transform.position, Quaternion.identity);//Instanciar en el lugar de la destruccion
                anim2 = GameObject.Find("poptext").GetComponent <Animator>();

                anim.SetTrigger("salto");
                //anim2.transform.position = nami.initialPosition;
                //audio.playaudioEstrella();
                anim2.SetTrigger("puntos");


                //mano = GameObject.Find("chatarra");
                //explosion = gameObject.GetComponent<Animator>();
                //explosion.SetTrigger("start");
                Destroy(gameObject);
            }
        }
        else
        {
            //normal click
        }
        lastClickTime = Time.time;
        //  print("1 click");
    }
Esempio n. 2
0
 void Start()
 {
     tiempo = FindObjectOfType <ControladorTiempo>();
     StartCoroutine(GenerarAlimentos(1f));
 }