Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Pickup Script
- else if (raycastHit.transform.name == "Pickup_PrincipalBanner" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
- {
- raycastHit.transform.gameObject.SetActive(false);
- this.gc.CollectItem(12);
- }
- //Gamecontroller Script
- else if (this.item[this.itemSelected] == 12) // Principal Banner Code
- {
- StartCoroutine(PrincipalBanner());
- this.ResetItem();
- }
- IEnumerator PrincipalBanner()
- {
- float timer = 45f;
- this.principal.SetActive(false);
- this.bannedicon.SetActive(true);
- this.audioDevice.PlayOneShot(this.banned);
- Debug.Log("Principal has been banned!");
- while (timer > 0)
- {
- timer -= Time.deltaTime;
- yield return new WaitForEndOfFrame();
- }
- Debug.Log("Principal has been unbanned! Welcome back!");
- this.principal.SetActive(true);
- this.bannedicon.SetActive(false);
- this.audioDevice.PlayOneShot(this.hebackpri);
- }
- public GameObject bannedicon;
- public AudioClip banned;
- public AudioClip hebackpri;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement