少年修仙传客户端代码仓库
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Thursday, July 27, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using System;
 
 
namespace vnxbqy.UI {
 
    
    public class TestWin:Window {
 
        TestModel m_Model;
        TestModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TestModel>()); } }
 
        BusinessEquationController controller = new BusinessEquationController();
        BusinessEquation test1 = null;
        BusinessEquation test2 = null;
 
        public UIEvent testResultOK;
        public UIEvent testResultOK2;
        public UIEventInt testResultUnOK;
        public UIEventInt testResultUnOK2;
 
        private void Awake() {
            test1 = new BusinessEquation(controller);
            test2 = new BusinessEquation(controller);
 
            controller.busy = false;
            this.test1.Do(this.RequestUpgrade).When(this.TestUpgrade).OnExpect(ProcessUpgradeOk).OnOutExpect(ProcessUpgradeUnOk);
            test2.Do(RequestUpgrade2).When(TestUpgrade2).OnExpect(ProcessUpgradeOk2).OnOutExpect(ProcessUpgradeUnOk2);
        }
 
        public void dodo1() {
            test1.Invoke();
        }
 
        public void dodo2() {
            test2.Invoke();
        }
 
        private void RequestUpgrade(Action<bool,int> _action) {
            model.Test1();
        }
 
        private bool TestUpgrade(out int _error) {
            var tempData = UnityEngine.Random.Range(0,2);
            if(tempData != 0) {
                _error = tempData;
                return false;
            }
 
            _error = 0;
            return true;
        }
 
        private void ProcessUpgradeOk() {
            DebugEx.Log("test1成功啦!");
        }
 
        private void ProcessUpgradeUnOk(int _error) {
            DebugEx.Log("test1失败啦!原因是: " + _error);
        }
 
        public void RequestUpgrade2(Action<bool,int> _action) {
            model.Test2(0,1);
        }
 
        public bool TestUpgrade2(out int _error) {
            var tempData = UnityEngine.Random.Range(0,2);
            if(tempData != 0) {
                _error = tempData;
                return false;
            }
 
            _error = 0;
            return true;
        }
 
        private void ProcessUpgradeOk2() {
            DebugEx.Log("test2成功啦!");
        }
 
        private void ProcessUpgradeUnOk2(int _error) {
            DebugEx.Log("test2失败啦!原因是: " + _error);
        }
 
        protected override void BindController() {
        }
 
        protected override void AddListeners() {
        }
 
        protected override void OnPreOpen() {
        }
 
        protected override void OnAfterOpen() {
        }
 
        protected override void OnPreClose() {
        }
 
        protected override void OnAfterClose() {
        }
    }
 
}