yyl
5 天以前 f232f6c058084dab7d2b7e30eba98e6f89baf963
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
using UnityEngine;
 
public class ChatSettingButton : MonoBehaviour
{
    [SerializeField] ButtonEx btnSelect;
    [SerializeField] ImageEx imgSelect;
    private ChatChannel channelType;
    private bool isAvtive;
    ChatManager manager { get { return ChatManager.Instance; } }
    void Awake()
    {
        btnSelect.SetListener(() =>
        {
            isAvtive = !isAvtive;
            manager.SetBulletSetting(channelType, isAvtive);
            imgSelect.SetActive(isAvtive);
        });
    }
 
    public void SetChannelType(ChatChannel type)
    {
        channelType = type;
        isAvtive = manager.GetBulletSetting(channelType);
        imgSelect.SetActive(isAvtive);
    }
}