| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | using TMPro; |
| | | 5 | | |
| | | 6 | | public class Hotel : MonoBehaviour |
| | | 7 | | { |
| | | 8 | | // Start is called before the first frame update |
| | | 9 | | GameObject label; |
| | | 10 | | |
| | | 11 | | void Start() |
| | 1 | 12 | | { |
| | 1 | 13 | | GameObject player = GameObject.Find("Player"); |
| | 1 | 14 | | label = player.transform.GetChild(1).gameObject; |
| | 1 | 15 | | } |
| | | 16 | | |
| | | 17 | | // Update is called once per frame |
| | | 18 | | void Update() |
| | 2490 | 19 | | { |
| | | 20 | | |
| | 2490 | 21 | | } |
| | 1 | 22 | | public void showlabel(){ |
| | 1 | 23 | | label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20); |
| | 0 | 24 | | } |
| | | 25 | | |
| | 2 | 26 | | public string GetLabel(){ |
| | 2 | 27 | | string ret = "Hotel:"; |
| | 4 | 28 | | if(gameObject.name == "Building5"){ |
| | 2 | 29 | | ret = ret + GetBuilding5Name(); |
| | 2 | 30 | | }else{ |
| | 0 | 31 | | ret = ret + "Unknown Hotel"; |
| | 0 | 32 | | } |
| | 2 | 33 | | return ret; |
| | 2 | 34 | | } |
| | | 35 | | |
| | 2 | 36 | | string GetBuilding5Name(){ |
| | 2 | 37 | | return "Udon Hotel"; |
| | 2 | 38 | | } |
| | | 39 | | |
| | | 40 | | } |