Skip to content

Commit 316950d

Browse files
committed
修改NMO加载器无法加载某些关卡文件问题
1 parent 8e77dce commit 316950d

File tree

16 files changed

+37
-23
lines changed

16 files changed

+37
-23
lines changed

Assets/BallancePhysics/PhysicsApi.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,18 @@ public static void PhysicsApiDestroy()
101101
ballance_physics_entry(sFalse, IntPtr.Zero);
102102
}
103103

104-
#if UNITY_EDITOR
105-
[UnityEditor.MenuItem("Ballance/Physics/Open Console")]
106104
public static void OpenConsole() {
107105
ballance_physics_entry(3, IntPtr.Zero);
108106
}
109-
[UnityEditor.MenuItem("Ballance/Physics/Close Console")]
110107
public static void CloseConsole() {
111108
ballance_physics_entry(2, IntPtr.Zero);
112109
}
110+
111+
#if UNITY_EDITOR
112+
[UnityEditor.MenuItem("Ballance/Physics/Open Console")]
113+
public static void MOpenConsole() { OpenConsole(); }
114+
[UnityEditor.MenuItem("Ballance/Physics/Close Console")]
115+
public static void MCloseConsole() { CloseConsole(); }
113116
#endif
114117
}
115118
}

Assets/BallancePhysics/Wapper/PhysicsEnvironment.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public void Create()
128128
PhysicsWorlds.Add(currentScenseIndex, this);
129129
Handle = PhysicsApi.API.create_environment(Gravity, 1.0f / SimulationRate, -2147483647, layerNames.GetGroupFilterMasks(), Marshal.GetFunctionPointerForDelegate(callback));
130130

131+
if(fixedUpdateTicket != null)
132+
{
133+
fixedUpdateTicket.Unregister();
134+
fixedUpdateTicket = null;
135+
}
131136
fixedUpdateTicket = GameManager.GameTimeMachine.RegisterFixedUpdate(_FixedUpdate, 15);
132137
}
133138
}

Assets/Game/Materials/Game/SkyLayer.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Material:
5757
- _MainTex:
5858
m_Texture: {fileID: 2800000, guid: 550bc03f31e06d54e80a12103627045c, type: 3}
5959
m_Scale: {x: 2, y: 2}
60-
m_Offset: {x: 0.23072791, y: 0.752728}
60+
m_Offset: {x: 0.5966339, y: 0.118640065}
6161
- _MetallicGlossMap:
6262
m_Texture: {fileID: 0}
6363
m_Scale: {x: 1, y: 1}

Assets/Game/PackageEntry.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ return {
1414
CoreUnload()
1515
return true
1616
end,
17-
PackageVersion = 55,
17+
PackageVersion = 60,
1818
}

Assets/Game/Scripts/Debug/ModulDebug.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,42 +115,42 @@ function ModulCustomDebug()
115115
stateText.text = 'Modul state tools:\n'..Modul_Instace.name..' state: '..state
116116
end
117117

118-
button = ui.transform:Find('ButtonActive'):GetComponent(UnityEngine.UI.Button)
118+
button = ui.transform:Find('ButtonActive'):GetComponent(UnityEngine.UI.Button) ---@type Button
119119
button.onClick:AddListener(function ()
120120
Modul_Class:Active()
121121
UpdateText('Active')
122122
end);
123-
button = ui.transform:Find('ButtonDeactive'):GetComponent(UnityEngine.UI.Button)
123+
button = ui.transform:Find('ButtonDeactive'):GetComponent(UnityEngine.UI.Button) ---@type Button
124124
button.onClick:AddListener(function ()
125125
Modul_Class:Deactive()
126126
UpdateText('Deactive')
127127
end);
128-
button = ui.transform:Find('ButtonResetLevel'):GetComponent(UnityEngine.UI.Button)
128+
button = ui.transform:Find('ButtonResetLevel'):GetComponent(UnityEngine.UI.Button) ---@type Button
129129
button.onClick:AddListener(function ()
130130
Modul_Class:Reset('levelRestart')
131131
UpdateText('Reset levelRestart')
132132
end);
133-
button = ui.transform:Find('ButtonResetSector'):GetComponent(UnityEngine.UI.Button)
133+
button = ui.transform:Find('ButtonResetSector'):GetComponent(UnityEngine.UI.Button) ---@type Button
134134
button.onClick:AddListener(function ()
135135
Modul_Class:Reset('sectorRestart')
136136
UpdateText('Reset sectorRestart')
137137
end);
138-
button = ui.transform:Find('ButtonQuit'):GetComponent(UnityEngine.UI.Button)
138+
button = ui.transform:Find('ButtonQuit'):GetComponent(UnityEngine.UI.Button) ---@type Button
139139
button.onClick:AddListener(function ()
140140
ui.gameObject:SetActive(false)
141141
GameManager:QuitGame()
142142
end);
143-
button = ui.transform:Find('ButtonBackup'):GetComponent(UnityEngine.UI.Button)
143+
button = ui.transform:Find('ButtonBackup'):GetComponent(UnityEngine.UI.Button) ---@type Button
144144
button.onClick:AddListener(function ()
145145
Modul_Class:Backup()
146146
Game.UIManager:GlobalToast('Modul_Class:Backup() !')
147147
end);
148-
button = ui.transform:Find('ButtonCustom1'):GetComponent(UnityEngine.UI.Button)
148+
button = ui.transform:Find('ButtonCustom1'):GetComponent(UnityEngine.UI.Button) ---@type Button
149149
button.onClick:AddListener(function ()
150150
Modul_Class:Custom(1)
151151
Game.UIManager:GlobalToast('Modul_Class:Custom1() !')
152152
end);
153-
button = ui.transform:Find('ButtonCustom2'):GetComponent(UnityEngine.UI.Button)
153+
button = ui.transform:Find('ButtonCustom2'):GetComponent(UnityEngine.UI.Button) ---@type Button
154154
button.onClick:AddListener(function ()
155155
Modul_Class:Custom(2)
156156
Game.UIManager:GlobalToast('Modul_Class:Custom2() !')
@@ -179,7 +179,7 @@ function ModulCustomDebug()
179179

180180
UpdateText('Active')
181181
--开始关卡
182-
Game.Mediator:NotifySingleEvent("CoreGamePlayManagerInitAndStart")
182+
Game.Mediator:NotifySingleEvent("CoreGamePlayManagerInitAndStart", nil)
183183
end)
184184
end)
185185
end

Assets/Game/Scripts/GamePlay/BallSoundManager.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ end
9797
---添加球碰撞声音组
9898
---@param colId number 自定义碰撞层ID,为防止重复,请使用 GetSoundCollIDByName 使用名称获取ID
9999
---@param data BallSoundCollData 碰撞数据
100-
---@return number BallSoundCollData 碰撞数据
101100
function BallSoundManager:AddSoundCollData(colId, data)
102101
if self._SoundCollData[colId] ~= nil then
103102
Log.E(TAG, 'AddSoundCollData failed because SoundCollData id: '..colId..' already added')

Assets/Game/Scripts/GamePlay/SectorManager.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function SectorManager:Start()
5353

5454
self:ResetCurrentSector(n)
5555
elseif type == 'reset-all' then
56-
self:ResetAllSector()
56+
self:ResetAllSector(true)
5757
else
5858
Log.W(TAG, 'Unknow option '..type)
5959
return false

Assets/Game/Scripts/Moduls/P_Extra_Point.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ P_Extra_Point = ModulBase:extend()
2828
function P_Extra_Point:new()
2929
P_Extra_Point.super.new(self)
3030
self._Actived = false
31-
self._RotDegree = 6
31+
self._RotDegree = 3
3232
self._Rotate = false
3333
self._FlyUpTime = 0.4
3434
self._FlyFollowTime = 0.3
@@ -178,7 +178,7 @@ function P_Extra_Point:StartFly()
178178
end
179179
end)
180180
end
181-
function P_Extra_Point:Update()
181+
function P_Extra_Point:FixedUpdate()
182182
--旋转小球
183183
if self._Rotate then
184184
self.P_Extra_Point_Ball1.transform:RotateAround(self._RotCenter, self._RotAxis1, self._RotDegree)

Assets/Game/Scripts/UI/KeypadUIManager.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function KeypadUIManager.AddKeypad(name, prefrab, image)
2424
prefrab = prefrab,
2525
image = image
2626
}
27+
return true
2728
end
2829
---获取已注册键盘,如果没有找到则返回nil
2930
---@param name string 名称

Assets/Scenes/MainScense.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ MonoBehaviour:
700700
DebugSetFrameRate: 1
701701
DebugEnableLuaDebugger: 0
702702
DebugLuaDebugger: 1
703-
DebugType: 0
703+
DebugType: 2
704704
DebugInitPackages:
705705
- Enable: 1
706706
PackageName: core.sounds

Assets/System/Scripts/Config/GameConst.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ public static class GameConst
2424
/// 游戏版本
2525
/// </summary>
2626
[LuaApiDescription("游戏版本")]
27-
public const string GameVersion = "0.9.8";
27+
public const string GameVersion = "0.9.9";
2828
/// <summary>
2929
/// 游戏编译版本
3030
/// </summary>
3131
[LuaApiDescription("游戏编译版本")]
32-
public const int GameBulidVersion = 55;
32+
public const int GameBulidVersion = 60;
3333
/// <summary>
3434
/// 游戏编译版本
3535
/// </summary>
3636
[LuaApiDescription("游戏编译版本")]
37-
public const string GameBulidDate = "2022.06.22";
37+
public const string GameBulidDate = "2022.07.05";
3838

3939
#region Unity 环境静态常量
4040

Assets/System/Scripts/Services/Init/GameSystemInit.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ private static void SysHandler(int act)
8080
//初始化物理引擎
8181
PhysicsApi.SecretKey = "666dccad4ae697b45aac145f18f49c5b";
8282
PhysicsSystemInit.DoInit();
83+
8384
#endif
85+
//if (GameEntry.Instance.DebugMode)
86+
// PhysicsApi.OpenConsole();
8487
}
8588
else if (act == GameSystem.ACTION_DESTROY)
8689
{
Binary file not shown.
Binary file not shown.

VirtoolsNMOLoader/VirtoolsNMOLoader/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ BOOL _InitPlugins(CKPluginManager& iPluginManager, char* currentPath)
3939
char PluginPath[_MAX_PATH];
4040
char RenderPath[_MAX_PATH];
4141
char ManagerPath[_MAX_PATH];
42+
char BuildingBlocksPath[_MAX_PATH];
4243

44+
sprintf(BuildingBlocksPath, "%s%s", currentPath, "BuildingBlocks");
4345
sprintf(PluginPath, "%s%s", currentPath, "Plugins");
4446
sprintf(RenderPath, "%s%s", currentPath, "RenderEngines");
4547
sprintf(ManagerPath, "%s%s", currentPath, "Managers");
@@ -48,6 +50,7 @@ BOOL _InitPlugins(CKPluginManager& iPluginManager, char* currentPath)
4850
iPluginManager.ParsePlugins(RenderPath);
4951
iPluginManager.ParsePlugins(ManagerPath);
5052
iPluginManager.ParsePlugins(PluginPath);
53+
iPluginManager.ParsePlugins(BuildingBlocksPath);
5154
return TRUE;
5255
}
5356

@@ -176,7 +179,7 @@ EXTERN_C API_EXPORT void* Loader_SolveNmoFileRead(wchar_t* filePath, int *outErr
176179
CKFile* f = VirtoolsContext->CreateCKFile();
177180
DWORD res = CKERR_INVALIDFILE;
178181
char* filePathAnsi = UnicodeToAnsi(filePath);
179-
res = f->OpenFile(filePathAnsi, (CK_LOAD_FLAGS)(CK_LOAD_DEFAULT | CK_LOAD_CHECKDEPENDENCIES));
182+
res = f->OpenFile(filePathAnsi, (CK_LOAD_FLAGS)(CK_LOAD_GEOMETRY | CK_LOAD_CHECKDEPENDENCIES));
180183
delete filePathAnsi;
181184
if (res != CK_OK) {
182185
VirtoolsContext->DeleteCKFile(f);

0 commit comments

Comments
 (0)