/*Si la variable coinCollider es mayor a 1 significa que cayo en la taza */ void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { //Debug.Log ("Debe Pausarse ------------"); player = other.gameObject; stop = true; //Detiene la moneda al tocar coinCollider++; } if (other.gameObject.CompareTag("Container")) { coin.gameObject.SetActive(false); if (coinCollider > 0) { //Asigna Puntos por cada Moneda recolecctada //manager.SetScore (puntosCoin); coinCollider = 0; manager.SetStatusCava(false); } RamdonLugar(); } if (other.gameObject.CompareTag("Base")) { coin.gameObject.SetActive(false); RamdonLugar(); coinCollider = 0; } }
void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Coins")) { manager.SetScore(3); manager.SetStatusCava(false); } }
// Update is called once per frame void Update() { LimitesCava(); /**Area de Prueba*/ //test.text = " Supra y Prono: " + Mathf.Round (((float)leapMotion.PronoSupra ())); /***/ //Codicional que verifica si la mano que se configuro en el meno es la mismas que se esta usando para mover el player if (manager.isRightController() && !leapMotion.IsLeft()) { moveHorizontal = (float)leapMotion.UlnarRadial() * 2.0f; moveVertical = 0; Move(moveHorizontal, moveVertical); } if (manager.isLeftController() && leapMotion.IsLeft()) { moveHorizontal = (float)leapMotion.UlnarRadial() * 2.0f; moveVertical = 0; Move(moveHorizontal, moveVertical); } //----------------------------------------------------------------- /*Caso neutro*/ /*Caso Mano Derecha*/ if (statusAngle != 0 && leapMotion.PronoSupra() < anguloSencible) /*Reinicia la Ubicion del Objecto*/ { if (statusAngle == 1) { playerCava.transform.Rotate(0, 0, -60); statusAngle = 0; } if (statusAngle == -1) { playerCava.transform.Rotate(0, 0, 60); statusAngle = 0; } manager.SetStatusCava(false); } /*Caso Mano Izquierda*/ if (statusAngle != 0 && -leapMotion.PronoSupra() < anguloSencible) /*Reinicia la Ubicion del Objecto*/ { if (statusAngle == 1) { playerCava.transform.Rotate(0, 0, -60); statusAngle = 0; } if (statusAngle == -1) { playerCava.transform.Rotate(0, 0, 60); statusAngle = 0; } manager.SetStatusCava(false); } /*Supra y Prono Mano Derecha*/ if (!leapMotion.IsLeft() && statusAngle == 0 && -leapMotion.PronoSupra() > anguloSencible) /*Gira el objeto a la derecha*/ { playerCava.transform.Rotate(0, 0, 60); statusAngle = 1; manager.SetStatusCava(true); } /*Supra y Prono Mano izquierda*/ if (leapMotion.IsLeft() && statusAngle == 0 && leapMotion.PronoSupra() > anguloSencible) { //Gira el objeto a la izquierda playerCava.transform.Rotate(0, 0, -60); statusAngle = -1; manager.SetStatusCava(true); } }