少年修仙传客户端代码仓库
hch
2025-07-24 50e53441950268933694eeb5aad36147bbe1014d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
 
class AttGridBehaviour
{
    public Transform transform;
 
    Text titleText;
    Text beforeValueText;
    Text afterValueText;
    Transform arrow;
 
    public void BindController(Transform target)
    {
        this.transform = target;
        this.titleText = target.FindComponentEx<Text>("Txt_Title");
        this.beforeValueText = target.FindComponentEx<Text>("Layout/Txt_Value0");
        this.afterValueText = target.FindComponentEx<Text>("Layout/Txt_Value1");
        this.arrow = target.Find("Layout/Img_Arrow");
    }
 
    public void Init(string attrName, string beforAttrStr, string afterAttrStr)
    {
        this.titleText.text = attrName;
        this.beforeValueText.text = beforAttrStr;
        this.afterValueText.text = afterAttrStr;
        this.arrow.SetActiveIL(!string.IsNullOrEmpty(afterAttrStr));
    }
 
}