Facebook
From DiriDam, 1 Year ago, written in C#.
Embed
Download Paste or View Raw
Hits: 136
  1. using System.ComponentModel;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using TMPro;
  6.  
  7. public class MainScript : MonoBehaviour
  8. {
  9.     public AudioSource bun;
  10.     public AudioSource bzz;
  11.     public TextMeshProUGUI A1;
  12.     public TextMeshProUGUI A2;
  13.     public TextMeshProUGUI A3;
  14.     public TextMeshProUGUI A4;
  15.     public TextMeshProUGUI A5;
  16.     public TextMeshProUGUI A6;
  17.     public TextMeshProUGUI A7;
  18.     public TextMeshProUGUI A8;
  19.  
  20.     public TextMeshProUGUI S1;
  21.     public TextMeshProUGUI S2;
  22.     public TextMeshProUGUI S3;
  23.     public TextMeshProUGUI S4;
  24.     public TextMeshProUGUI S5;
  25.     public TextMeshProUGUI S6;
  26.     public TextMeshProUGUI S7;
  27.     public TextMeshProUGUI S8;
  28.     // Start is called before the first frame update
  29.     void Start()
  30.     {
  31.         A1.text = Raspunsuri.instance.Q1[1];
  32.     }
  33.  
  34.     // Update is called once per frame
  35.     void Update()
  36.     {
  37.         if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Alpha4) || Input.GetKeyDown(KeyCode.Alpha5) || Input.GetKeyDown(KeyCode.Alpha6) || Input.GetKeyDown(KeyCode.Alpha7) || Input.GetKeyDown(KeyCode.Alpha8))
  38.         {
  39.             Debug.Log("Bun");
  40.             bun.Play();
  41.         }
  42.     }
  43. }
  44.