yyl
1 天以前 5d3366f2e0f687995eb7ad2107c4379fe7acd4e8
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
using System;
using UnityEngine;
 
public class PhantasmPavilionTabCell : CellView
{
    [SerializeField] ButtonEx btnTab;
    [SerializeField] TextEx txtTab;
    [SerializeField] ImageEx imgChoose;
    [SerializeField] RedpointBehaviour redpointBehaviour;
    int iIndex;
 
    public void Display(int index)
    {
        this.iIndex = index;
        redpointBehaviour.redpointId = MainRedDot.PhantasmPavilionRepoint * 10 + index + 1;
        txtTab.text = Language.Get(StringUtility.Contact("PhantasmPavilionTab", index));
        imgChoose.SetActive(index == (int)PhantasmPavilionModel.Instance.selectTab);
        btnTab.SetListener(OnTabClick);
    }
 
    private void OnTabClick()
    {
        if (!Enum.IsDefined(typeof(PhantasmPavilionTab), iIndex))
            return;
        PhantasmPavilionTab tab = (PhantasmPavilionTab)iIndex;
        if (tab == PhantasmPavilionModel.Instance.selectTab)
            return;
        PhantasmPavilionModel.Instance.selectTab = tab;
    }
}