public void Start() { InitialColor = RegiaoAlvo.GetComponent <SpriteRenderer>().color; ClickColor2 = new Color(ClickColor.r, ClickColor.g, ClickColor.b); }
public void Stop() { ///* if (Time.timeScale == 0) { return; } if (DelayPowerUp) { return; } else if (CanStop) { if (VaiEVem != null) //se for vai e vem { xPosition = VaiEVem.transform.position.x; if (xPosition >= -ReferencePosition && xPosition <= ReferencePosition) { EnergyBar.value += 1 / CountToPowerUp; mainCamera.SetBool("CanShake", true); //feedback de acerto RegiaoAlvo.GetComponent <SpriteRenderer>().color = ClickColor2; Invoke("ChangeColor", 0.2f); GetComponent <ScoreManager>().AddScore(1); BamBamObject.GetComponent <Animator>().SetBool("WantMore", true); } else { if (canLostLife) { canLostLife = false; Handheld.Vibrate(); GetComponent <LifeBarManager>().ReduceLife(1); Invoke("CanLostLife", 0.2f); } } } else //se for roleta { zRotation = Roleta.eulerAngles.z; if (zRotation >= MinRotation && zRotation <= MaxRotation) { EnergyBar.value += 1 / CountToPowerUp; // aumenta a barra de energia GetComponent <ScoreManager>().AddScore(1); // aumenta a pontuação BamBamObject.GetComponent <Animator>().SetBool("WantMore", true); // animação do bambam mainCamera.SetBool("CanShake", true); // feedback de acerto } else { if (canLostLife) { canLostLife = false; Handheld.Vibrate(); GetComponent <LifeBarManager>().ReduceLife(1); GetComponent <PlayOneSound>().PlaySound(GetComponent <PlayOneSound>().Erro); Invoke("CanLostLife", 0.2f); } } } } //*/ }
private void ChangeColor() { RegiaoAlvo.GetComponent <SpriteRenderer>().color = InitialColor; }