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