Skip to content

Commit db963e6

Browse files
committed
集成开源框架PureMVC。
游戏框架做了调整,去掉了ioo类,使用facade代替。
1 parent afcc857 commit db963e6

File tree

423 files changed

+4204
-5733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+4204
-5733
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/Assets/Source/LuaWrap.meta
1010
/Temp
1111
/Assets/StreamingAssets.meta
12+
/Server/Server/bin/Debug/Logs

Assets/Editor/BindLua.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
using UnityEngine.Rendering;
1414
using Junfine.Debuger;
1515
using UnityEngine.UI;
16-
using com.junfine.simpleframework;
17-
using com.junfine.simpleframework.manager;
16+
using SimpleFramework;
17+
using SimpleFramework.Manager;
1818

1919
public static class LuaBinding
2020
{
@@ -176,16 +176,15 @@ static BindType _GT(Type t)
176176

177177
//custom
178178
_GT(typeof(Debugger)),
179-
_GT(typeof(ioo)),
180179
_GT(typeof(Util)),
181-
_GT(typeof(Const)),
180+
_GT(typeof(AppConst)),
182181
_GT(typeof(ByteBuffer)),
183182
_GT(typeof(NetworkManager)),
184183
_GT(typeof(ResourceManager)),
185184
_GT(typeof(PanelManager)),
186185
_GT(typeof(TimerManager)),
187186
_GT(typeof(LuaHelper)),
188-
_GT(typeof(BaseLua)),
187+
_GT(typeof(LuaBehaviour)),
189188
_GT(typeof(RectTransform)),
190189

191190
//unity

Assets/Editor/Packager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Collections;
66
using System.Collections.Generic;
77
using System.Diagnostics;
8-
using com.junfine.simpleframework;
8+
using SimpleFramework;
99

1010
public class Packager {
1111
public static string platform = string.Empty;
@@ -46,7 +46,7 @@ public static void BuildAssetResource(BuildTarget target, bool isWin) {
4646
Directory.Delete(dataPath, true);
4747
}
4848
string assetfile = string.Empty; //素材文件名
49-
string resPath = AppDataPath + "/" + Const.AssetDirname + "/";
49+
string resPath = AppDataPath + "/" + AppConst.AssetDirname + "/";
5050
if (!Directory.Exists(resPath)) Directory.CreateDirectory(resPath);
5151
BuildPipeline.BuildAssetBundles(resPath, BuildAssetBundleOptions.None, target);
5252

@@ -72,7 +72,7 @@ public static void BuildAssetResource(BuildTarget target, bool isWin) {
7272
if (File.Exists(newpath)) {
7373
File.Delete(newpath);
7474
}
75-
if (Const.LuaEncode) {
75+
if (AppConst.LuaEncode) {
7676
UpdateProgress(n++, files.Count, newpath);
7777
EncodeLuaFile(f, newpath, isWin);
7878
} else {

Assets/Lua/common/define.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
ioo = com.junfine.simpleframework.ioo;
2-
Util = com.junfine.simpleframework.Util;
3-
Const = com.junfine.simpleframework.Const;
4-
LuaHelper = com.junfine.simpleframework.LuaHelper;
5-
ByteBuffer = com.junfine.simpleframework.ByteBuffer;
6-
resMgr = ioo.resourceManager;
1+
Util = SimpleFramework.Util;
2+
AppConst = SimpleFramework.AppConst;
3+
LuaHelper = SimpleFramework.LuaHelper;
4+
ByteBuffer = SimpleFramework.ByteBuffer;
5+
6+
ResManager = LuaHelper.GetResManager();
7+
NetManager = LuaHelper.GetNetManager();
8+
PanelManager = LuaHelper.GetPanelManager();
9+
MusicManager = LuaHelper.GetMusicManager();

Assets/Lua/common/functions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ end
3333

3434
--创建面板--
3535
function createPanel(name)
36-
ioo.panelManager:CreatePanel(name);
36+
PanelManager:CreatePanel(name);
3737
end
3838

3939
function child(str)

Assets/Lua/logic/MessagePanel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local gameObject;
1111
function MessagePanel.Start()
1212
warn("Start lua--->>"..this.gameObject.name);
1313

14-
message = this.gameObject:GetComponent('BaseLua');
14+
message = this.gameObject:GetComponent('LuaBehaviour');
1515
message:AddClick('Button', this.OnClick);
1616
end
1717

Assets/Lua/logic/PromptPanel.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function PromptPanel.Start()
1212
this = PromptPanel;
1313
gameObject = find("PromptPanel");
1414
trans = gameObject.transform;
15-
prompt = gameObject:GetComponent('BaseLua');
15+
prompt = gameObject:GetComponent('LuaBehaviour');
1616

1717
prompt:AddClick('Open', this.OnClick);
18-
resMgr:LoadAsset('prompt', 'PromptItem', this.InitPanel);
18+
ResManager:LoadAsset('prompt', 'PromptItem', this.InitPanel);
1919
warn("Start lua--->>"..gameObject.name);
2020
end
2121

@@ -53,6 +53,6 @@ function PromptPanel.OnClick(obj)
5353
buffer:WriteShort(Login);
5454
buffer:WriteString("ffff我的ffffQ靈uuu");
5555
buffer:WriteInt(200);
56-
ioo.networkManager:SendMessage(buffer);
56+
NetManager:SendMessage(buffer);
5757
warn("OnClick---->>>"..obj.name);
5858
end

Assets/Lua/logic/game.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function GameManager.OnInitOK()
3434
warn('OnInitOK--->>>');
3535
createPanel("Prompt");
3636

37-
Const.SocketPort = 2012;
38-
Const.SocketAddress = "127.0.0.1";
39-
ioo.networkManager:SendConnect();
37+
AppConst.SocketPort = 2012;
38+
AppConst.SocketAddress = "127.0.0.1";
39+
NetManager:SendConnect();
4040

4141
this.test_class_func();
4242
this.test_pblua_func();

Assets/Resources/Prefabs/GameManager.prefab.meta

Lines changed: 0 additions & 4 deletions
This file was deleted.

Assets/Resources/Prefabs/GameManager.prefab renamed to Assets/Resources/Prefabs/GlobalGenerator.prefab

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,40 @@
11
%YAML 1.1
22
%TAG !u! tag:unity3d.com,2011:
3-
--- !u!1 &100000
3+
--- !u!1 &105990
44
GameObject:
55
m_ObjectHideFlags: 0
66
m_PrefabParentObject: {fileID: 0}
77
m_PrefabInternal: {fileID: 100100000}
88
serializedVersion: 4
99
m_Component:
10-
- 4: {fileID: 400000}
11-
- 82: {fileID: 8200000}
12-
- 114: {fileID: 11400000}
10+
- 4: {fileID: 486158}
11+
- 82: {fileID: 8285502}
12+
- 114: {fileID: 11406124}
1313
m_Layer: 0
14-
m_Name: GameManager
14+
m_Name: GlobalGenerator
1515
m_TagString: GameManager
1616
m_Icon: {fileID: 0}
1717
m_NavMeshLayer: 0
1818
m_StaticEditorFlags: 0
1919
m_IsActive: 1
20-
--- !u!1002 &100001
21-
EditorExtensionImpl:
22-
serializedVersion: 6
23-
--- !u!4 &400000
20+
--- !u!4 &486158
2421
Transform:
2522
m_ObjectHideFlags: 1
2623
m_PrefabParentObject: {fileID: 0}
2724
m_PrefabInternal: {fileID: 100100000}
28-
m_GameObject: {fileID: 100000}
25+
m_GameObject: {fileID: 105990}
2926
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
3027
m_LocalPosition: {x: 0, y: 0, z: 0}
3128
m_LocalScale: {x: 1, y: 1, z: 1}
3229
m_Children: []
3330
m_Father: {fileID: 0}
3431
m_RootOrder: 0
35-
--- !u!1002 &400001
36-
EditorExtensionImpl:
37-
serializedVersion: 6
38-
--- !u!82 &8200000
32+
--- !u!82 &8285502
3933
AudioSource:
4034
m_ObjectHideFlags: 1
4135
m_PrefabParentObject: {fileID: 0}
4236
m_PrefabInternal: {fileID: 100100000}
43-
m_GameObject: {fileID: 100000}
37+
m_GameObject: {fileID: 105990}
4438
m_Enabled: 1
4539
serializedVersion: 4
4640
OutputAudioMixerGroup: {fileID: 0}
@@ -104,32 +98,17 @@ AudioSource:
10498
tangentMode: 0
10599
m_PreInfinity: 2
106100
m_PostInfinity: 2
107-
--- !u!114 &11400000
101+
--- !u!114 &11406124
108102
MonoBehaviour:
109103
m_ObjectHideFlags: 1
110104
m_PrefabParentObject: {fileID: 0}
111105
m_PrefabInternal: {fileID: 100100000}
112-
m_GameObject: {fileID: 100000}
106+
m_GameObject: {fileID: 105990}
113107
m_Enabled: 1
114108
m_EditorHideFlags: 0
115-
m_Script: {fileID: 11500000, guid: b1545d35cb5d31e469cff9e3dbc576e9, type: 3}
109+
m_Script: {fileID: 11500000, guid: c13baae76dc25164fbbeec8317b29af0, type: 3}
116110
m_Name:
117111
m_EditorClassIdentifier:
118-
--- !u!1002 &11400001
119-
EditorExtensionImpl:
120-
serializedVersion: 6
121-
--- !u!1002 &11400003
122-
EditorExtensionImpl:
123-
serializedVersion: 6
124-
--- !u!1002 &11400005
125-
EditorExtensionImpl:
126-
serializedVersion: 6
127-
--- !u!1002 &11400007
128-
EditorExtensionImpl:
129-
serializedVersion: 6
130-
--- !u!1002 &11400009
131-
EditorExtensionImpl:
132-
serializedVersion: 6
133112
--- !u!1001 &100100000
134113
Prefab:
135114
m_ObjectHideFlags: 1
@@ -139,8 +118,5 @@ Prefab:
139118
m_Modifications: []
140119
m_RemovedComponents: []
141120
m_ParentPrefab: {fileID: 0}
142-
m_RootGameObject: {fileID: 100000}
121+
m_RootGameObject: {fileID: 105990}
143122
m_IsPrefabParent: 1
144-
--- !u!1002 &100100001
145-
EditorExtensionImpl:
146-
serializedVersion: 6

0 commit comments

Comments
 (0)