少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Saturday, December 30, 2017
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
using UnityEngine.UI;
//什么任务面板
namespace vnxbqy.UI
{
 
    public class MysteriousMissionWin : Window
    {
        [SerializeField] ScaleTween m_Background;
        [SerializeField] Button m_PanelButton;
        [SerializeField] Text m_MysteriousMissionWin;
        [Header("前期固定时间")]
        public float setTime = 3f;
        [Header("后期可选时间")]
        public float loadingTime = 5f;
        [Header("缩放时间")]
        public float zoomTime = 1f;
        FunctionUnlockFlyObject flyObject;
        PlayerMainDate m_MainModel;
        PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
        TaskModel m_TaskModel;
        TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } }
        #region Built-in
        protected override void BindController()
        {
 
        }
 
        protected override void AddListeners()
        {
            m_PanelButton.AddListener(PanelButton);
        }
 
        protected override void OnPreOpen()
        {
            m_Background.SetActive(true);
            m_PanelButton.interactable = false;
            m_Background.duration = zoomTime;
            m_Background.SetStartState();
            int taskID = mainModel.MysteriousTaskID + 1;
            if (taskmodel.allMissionDict.ContainsKey(taskID))
            {
                var config = TASKINFOConfig.Get(taskmodel.allMissionDict[taskID].Name);
                m_MysteriousMissionWin.text = config.show_writing;
            }
            //var instance = UIUtility.CreateWidget("TaskUnlockFlyObject", "TaskUnlockFlyObject");
            //instance.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
            //flyObject = instance.GetComponent<FunctionUnlockFlyObject>();
            //flyObject.SetContent(FunctionUnlockType.Normal, 104);
 
        }
 
 
        protected override void OnAfterOpen()
        {
            StartCoroutine("LoadingTime");
        }
 
        protected override void OnPreClose()
        {
        }
 
        protected override void OnAfterClose()
        {
        }
        public override void CloseClick()
        {
            base.CloseClick();
        }
 
        private void PanelButton()
        {
            StopCoroutine("LoadingTime");
            m_Background.Play(zoomOver);
            m_PanelButton.interactable = false;
        }
 
 
        IEnumerator LoadingTime()
        {
            yield return new WaitForSeconds(setTime);
            m_PanelButton.interactable = true;
           yield return new WaitForSeconds(loadingTime);
            m_PanelButton.interactable = false;
            m_Background.Play(zoomOver);
        }
 
        void zoomOver()
        {
 
            // flyObject.SetActive(true);
            m_Background.SetActive(false);
            m_PanelButton.interactable = false;
            var instance = UIUtility.CreateWidget("TaskUnlockFlyObject", "TaskUnlockFlyObject");
            instance.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
            flyObject = instance.GetComponent<FunctionUnlockFlyObject>();
            flyObject.SetContent(FunctionUnlockType.Normal, 104);
            flyObject.Begin(CloseClick);
        }
        #endregion
 
    }
 
}