Tanoda
PromoHelper.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using GILES;
5
6public class PromoHelper : MonoBehaviour
7{
8 private bool once = true;
9
11
12 public void PlaySound(int index)
13 {
14 var asource = gameObject.DemandComponent<AudioSource>();
15 switch (index)
16 {
17 case 0:
18 asource.clip = Oszlop;
19 break;
20 case 1:
21 asource.clip = OszlopInPlace;
22 break;
23 case 2:
24 asource.clip = Base;
25 break;
26 case 3:
27 asource.clip = BaseInPlace;
28 break;
29 case 4:
30 asource.clip = Csavar;
31 break;
32 case 5:
33 asource.clip = Csavar2;
34 break;
35 case 6:
36 asource.clip = TopBack;
37 break;
38 }
39 asource.Play();
40 }
41
42 // Update is called once per frame
43 void Update()
44 {
45 if (once && !GameObject.Find("fake_csavarozas") && !GameObject.Find("fake_csavarozas (1)"))
46 {
47 once = false;
48 GameObject.Find("Promo_second_floor").GetComponent<ReferenceSaver>().Reference.SetActive(true);
49 }
50 }
51}
AudioClip Oszlop
Definition: PromoHelper.cs:10
AudioClip TopBack
Definition: PromoHelper.cs:10
AudioClip Base
Definition: PromoHelper.cs:10
AudioClip OszlopInPlace
Definition: PromoHelper.cs:10
AudioClip BaseInPlace
Definition: PromoHelper.cs:10
AudioClip Csavar
Definition: PromoHelper.cs:10
void PlaySound(int index)
Definition: PromoHelper.cs:12
AudioClip Csavar2
Definition: PromoHelper.cs:10