少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, October 18, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
 
namespace vnxbqy.UI
{
 
    public class TeamSubMissionBehaviour : MonoBehaviour
    {
 
        [SerializeField] Text m_Mission;
        [SerializeField] FontColorSizeConfig m_FontColorSize;
        [SerializeField] ToggleButton m_MissionButton;
        public ToggleButton missionButton {
            get { return m_MissionButton; }
            set { m_MissionButton = value; }
        }
 
        [SerializeField] TeamMissionGroup m_Group;
        public TeamMissionGroup group {
            get { return m_Group; }
            set {
                m_Group = value;
            }
        }
 
        public int mapId { get; private set; }
        public int mapEx { get; private set; }
 
        TeamModel model { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
 
        public void SetMission(int _mapId, int _lineId)
        {
            mapId = _mapId;
            mapEx = _lineId;
 
            if (_mapId == TeamModel.NONE_MISSION)
            {
                m_Mission.text = Language.Get("No_Target");
            }
            else if (_mapId == TeamModel.CURRENTMAP_MISSION)
            {
                m_Mission.text = Language.Get("RightHereMap");
            }
            else
            {
                var dungeonId = dungeonModel.GetDungeonId(_mapId, _lineId);
                var config = DungeonConfig.Get(dungeonId);
                m_Mission.text = config.FBName;
            }
 
            if (mapId == model.missionBuf.mapId && mapEx == model.missionBuf.mapEx)
            {
                SelectMission();
            }
            else
            {
                OnSelected(false);
            }
            missionButton.RemoveListener();
            missionButton.AddListener(SelectMission);
            missionButton.RemoveOnValueChange();
            missionButton.OnValueChange(OnSelected);
        }
 
        public void SelectMission()
        {
            m_MissionButton.isOn = true;
            if (group != null)
            {
                group.NotifySelectMission(mapId, mapEx);
            }
        }
 
        private void OnSelected(bool _value)
        {
            m_Mission.color = m_FontColorSize.GetColorSize(_value ? "Selected" : "UnSelected").color;
        }
 
    }
 
}