25 lines
642 B
C#
25 lines
642 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class TextBox : MonoBehaviour
|
|||
|
{
|
|||
|
public Text numText;
|
|||
|
public Transform ParentHouse;
|
|||
|
public Transform Parent;
|
|||
|
// Start is called before the first frame update
|
|||
|
void Start()
|
|||
|
{
|
|||
|
transform.SetParent(Parent);//<2F>ı丸<C4B1>ڵ㣬<DAB5><E3A3AC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
numText = transform.Find("Text").GetComponent<Text>();
|
|||
|
SetText(0);
|
|||
|
}
|
|||
|
|
|||
|
public void SetText(float add)
|
|||
|
{
|
|||
|
ParentHouse.GetComponent<HouseInfo>().Money += add;
|
|||
|
numText.text = ParentHouse.GetComponent<HouseInfo>().Money.ToString();
|
|||
|
}
|
|||
|
}
|