public void Start() { bHit = GameObject.FindGameObjectWithTag("BHitPrtcl").GetComponent <ParticleSystem> (); bHit.Stop(); bHit.Clear(); anim = GetComponent <Animator> (); shooter = GameObject.FindGameObjectWithTag("Player" + fleak).GetComponentInChildren <TouchDragPowerV2> (); }
public void decreaseTimeRemaining() { //time.color = Color.Lerp (Color.red, Color.green, (float)timeRemaining / 120); timeRemaining--; if (timeRemaining % 2 == 0) { clock.transform.localScale = big; } else { clock.transform.localScale = small; } if (timeRemaining == 0) { GameObject.Find("Pause").SetActive(false); clock.SetActive(false); endmenu.SetActive(true); burpy.CancelInvoke(); burpy.End(); ended = true; FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/timer_end", camPos); TouchDragPowerV2.setEnded(); for (int i = 0; i < 4; i++) { tdp[i].CancelInvoke(); tdp[i].gameEnd = true; if (tdp[i].clone != null) { tdp[i].rmFirstFleak(); } } setWinner(); } else if (timeRemaining == 10) { FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/timer_warning", camPos); Invoke("decreaseTimeRemaining", 1.0f); next = arrow.transform.rotation.eulerAngles + DegreePerSec; arrow.transform.rotation = Quaternion.Euler(next); } else { next = arrow.transform.rotation.eulerAngles + DegreePerSec; arrow.transform.rotation = Quaternion.Euler(next); Invoke("decreaseTimeRemaining", 1.0f); } }