层级目录和UI布局
将下面的脚本挂载到Panel上
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AddAttribute : MonoBehaviour
{
private Button add;
private Button sub;
private Text AttributeAddNumText;//显示需要加的属性点数
private Text AttributeCountText;//显示总属性点数
public int AttributeCount=100;//总属性点数
private int AttributeAddNum = 0;//需要加的属性点数
private void Start()
{
add = transform.Find("add").GetComponent<Button>();
sub = transform.Find("sub").GetComponent<Button>();
AttributeAddNumText = transform.Find("AttributeAddNumText").GetComponent<Text>();
AttributeCountText = transform.Find("AttributeCountText").GetComponent<