feat: add config instance.
This commit is contained in:
@@ -17,6 +17,7 @@ using PerfectWorld.Scripts.Shop;
|
||||
using Unity.Cinemachine;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using BrewMonster.Common;
|
||||
|
||||
public partial class CECGameRun : ITickable
|
||||
{
|
||||
@@ -109,11 +110,19 @@ public partial class CECGameRun : ITickable
|
||||
// Load instance information
|
||||
//if (!LoadInstanceInfo("Configs\\instance.txt"))
|
||||
//{
|
||||
// glb_ErrorOutput(ECERR_FAILEDTOCALL, "CECGameRun::Init", __LINE__);
|
||||
// return false;
|
||||
// //glb_ErrorOutput(ECERR_FAILEDTOCALL, "CECGameRun::Init", __LINE__);
|
||||
// //return false;
|
||||
//}
|
||||
if (!m_InstTab.ContainsKey(161))
|
||||
m_InstTab.Add(161, new CECInstance());
|
||||
var instanceOB = Resources.Load<instanceDataAsset>("instance");
|
||||
for(int i = 0; i < instanceOB.items.Length; i++)
|
||||
{
|
||||
if (!m_InstTab.ContainsKey(instanceOB.items[i].m_id))
|
||||
{
|
||||
var cecInstance = new CECInstance();
|
||||
cecInstance.Load(instanceOB.items[i]);
|
||||
m_InstTab.Add(instanceOB.items[i].m_id, cecInstance);
|
||||
}
|
||||
}
|
||||
AddressableManager.Instance.OnDispose += Dispose;
|
||||
if (m_pWorld == null)
|
||||
m_pWorld = new CECWorld();
|
||||
@@ -1171,8 +1180,37 @@ public partial class CECGameRun : ITickable
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Load instance information from file
|
||||
bool LoadInstanceInfo(string szFile)
|
||||
{
|
||||
// AWScriptFile sf = new AWScriptFile();
|
||||
//if (!sf.Open(szFile))
|
||||
//{
|
||||
// //a_LogOutput(1, "CECGameRun::LoadInstanceInfo, Failed to load %s", szFile);
|
||||
// return false;
|
||||
//}
|
||||
// CECInstance pInst;
|
||||
// while (sf.PeekNextToken(true))
|
||||
// {
|
||||
// pInst = new CECInstance();
|
||||
// if (pInst == null || !pInst.Load(sf))
|
||||
// {
|
||||
// //a_LogOutput(1, "CECGameRun::LoadInstanceInfo, Failed to read %s near line:%d", szFile, sf.GetCurLine());
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (!m_InstTab.ContainsKey(pInst.GetID()))
|
||||
// {
|
||||
// // ID collsion ?
|
||||
// m_InstTab.Add(pInst.GetID(), pInst);
|
||||
// }
|
||||
// }
|
||||
|
||||
// sf.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
public enum GameState
|
||||
|
||||
Reference in New Issue
Block a user