loading task ui

This commit is contained in:
NguyenVanDat
2025-12-16 15:39:18 +07:00
parent a786ee236e
commit 5a0ad3ad4f
22 changed files with 1366 additions and 151 deletions
@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: 712e3991f28e549e7a56ee582a977810
m_currentHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
Hash: d7ea27f22d507888a9e5476f10563211
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ec5e9190fb72ed1fa3a747cdae7ac86540f744820346de9c230c39ec766666d
size 16461
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 33049cc5acda8a341a74cc739bf0961b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:305e74354eced472681f3a976c741e7e70d3ce8ba20714b215ac2e700299a956
size 10892
oid sha256:e3e518641de396e1b30dd202ff94dc35518476c7efd747501f45f10021136ca7
size 10723
@@ -372,6 +372,7 @@ namespace BrewMonster.Network
public void LoadScene(string sceneName, LoadSceneMode mode, Action<bool> actDone)
{
// SceneLoadService.Load(sceneName, mode, actDone);
StartCoroutine(LoadSceneCoroutine(sceneName, mode, actDone));
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a3ad7cd15f37d924f824fbd72715dd2f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,92 @@
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using TMPro;
using System.Collections;
using System.Threading;
using Cysharp.Threading.Tasks;
namespace BrewMonster
{
public class LoadingSceneController : MonoSingleton<LoadingSceneController>
{
[Header("UI")]
public GameObject goContent;
public Slider progressBar;
public TMP_Text percentText;
public TMP_Text loadingText;
private bool finished;
private CancellationTokenSource cts;
public void ShowLoadingScene(bool active)
{
goContent.SetActive(active);
// if (active)
// {
// Debug.LogError("Loading scene controller started");
//
// finished = false;
// loadingText.text = "Loading...";
// UpdateUI(0);
//
// cts?.Cancel();
// cts = new CancellationTokenSource();
//
// ObserveLoadingAsync(cts.Token).Forget();
// }
// else
// {
// cts?.Cancel();
// }
}
async UniTaskVoid ObserveLoadingAsync(CancellationToken token)
{
try
{
while (!finished && !token.IsCancellationRequested)
{
float progress = Mathf.Clamp01(SceneLoader.LoadingProgress / 100f);
UpdateUI(progress);
if (SceneLoader.SceneLoadProcess == SceneLoadProcess.EndLoading)
{
finished = true;
await EndLoadingAsync(token);
break;
}
await UniTask.Yield(PlayerLoopTiming.Update, token);
}
}
catch (OperationCanceledException)
{
// Normal cancel ignore
}
}
async UniTask EndLoadingAsync(CancellationToken token)
{
UpdateUI(1f);
loadingText.text = "Entering scene...";
await UniTask.Delay(TimeSpan.FromSeconds(0.2f), cancellationToken: token);
ShowLoadingScene(false);
}
public void UpdateUI(float progress)
{
progressBar.value = progress;
percentText.text = $"{Mathf.RoundToInt(progress * 100f)}%";
Debug.LogError($"UpdateUI: {progress}");
}
public void SetLoadingText(string content)
{
loadingText.text = content;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c0f91323d4b23b4428e423d2c724d821
@@ -0,0 +1,22 @@
using System;
using UnityEngine.SceneManagement;
namespace BrewMonster
{
public class SceneLoadService
{
public static void Load(
string sceneName,
LoadSceneMode mode = LoadSceneMode.Single,
Action<bool> actDone = null
)
{
if(string.IsNullOrEmpty(sceneName)) return;
SceneLoader.TargetScene = sceneName;
SceneLoader.LoadMode = mode;
SceneLoader.OnDone = actDone;
SceneManager.LoadScene(sceneName, mode);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a87111a93f052894082eb4175befa2ed
@@ -0,0 +1,20 @@
using System;
using UnityEngine.SceneManagement;
namespace BrewMonster
{
public enum SceneLoadProcess
{
Loading,
EndLoading,
}
public class SceneLoader
{
public static string TargetScene;
public static LoadSceneMode LoadMode;
public static Action<bool> OnDone;
public static SceneLoadProcess SceneLoadProcess;
public static int LoadingProgress;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5faa62ff51365184f9a9cea81bce8188
+354 -129
View File
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using CSNetwork.GPDataType;
using PerfectWorld.Scripts.Task;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace BrewMonster.Scripts.Task
@@ -80,84 +80,199 @@ namespace BrewMonster.Scripts.Task
m_pEleDataMan = pMan;
}
public bool LoadTasksFromPack(string szPackPath, bool bLoadDescript)
public async UniTask<bool> LoadTasksFromPack(string szPackPath, bool bLoadDescript, Action<float> onProgress)
{
//TaskInterface::WriteLog(0, 0, 2, "LoadPack begin");
// //TaskInterface::WriteLog(0, 0, 2, "LoadPack begin");
// BMLogger.Log("[Dat]- szPackPath: " + szPackPath);
// if (!File.Exists(szPackPath))
// {
// BMLogger.LogError("[Dat]- File not found: " + szPackPath);
// return false;
// }
//
// long readBytes = 0;
// FileStream fs = new FileStream(szPackPath, FileMode.Open, FileAccess.Read);
//
// TASK_PACK_HEADER tph = AAssit.ReadFromBinaryOf<TASK_PACK_HEADER>(fs, ref readBytes);
//
// if (tph.magic != TASK_PACK_MAGIC
// || tph.version != _task_templ_cur_version)
// return false;
//
// if (tph.item_count == 0) return true;
//
// uint[] pOffs = new uint[tph.item_count];
// g_ulNewCount++;
//
//
// // fread(pOffs, sizeof(long), tph.item_count, fp);
// // read File and prepare offset array before loading tasks
// pOffs = AAssit.ReadArrayFromBinary<uint>(fs, (int)tph.item_count, ref readBytes);
//
// Debug.Log((int)tph.item_count);
// //BMLogger.Log($" [MH] Task File Lenght: {fs.Length}");
// // for (int i = 2058; i < 2059; i++) //TODO: tph.item_count
// Debug.Log($" Starting to load {tph.item_count} task templates...");
// for (int i = 0; i < tph.item_count; i++)
// {
// // mvoe file pointer to task offset
// fs.Seek(pOffs[i], SeekOrigin.Begin);
// // BMLogger.Log(" [MH] Loading Task Templ at offset: " + pOffs[i]);
//
// ATaskTempl pTempl = new ATaskTempl();
// g_ulNewCount++;
//
// // Debug.Log($"Task Index {i}: Attempting to load task template...");
// if (!pTempl.LoadFromBinFile(fs))
// {
// CECTaskInterface.WriteLog(0, (int)pTempl.m_FixedData.m_ID, 0, "Cant Load Task");
// // LOG_DELETE(pTempl);
// continue;
// }
//
// AddOneTaskTempl(pTempl);
// // TaskInterface::WriteLog(0, pTempl->m_ID, 2, "LoadTask");
// }
//
// Debug.Log($" Finished loading {m_TaskTemplMap.Count} task templates.");
//
// // // char log[1024];
// // // sprintf(log, "LoadTask, Count = %d", m_TaskTemplMap.size());
// // // TaskInterface::WriteLog(0, 0, 2, log);
//
// // //todo: check
// // // LOG_DELETE_ARR(pOffs);
// fs.Close();
// #if !_TASK_CLIENT
// UpdateTimeLimitCheckList();
// #else
// SortTasksCanSeekOut();
// #endif
//
//
// #if _ELEMENTCLIENT
// // TODO: implement task error logging if needed
// // _task_err.Release();
// // _task_err.Init("Configs\\task_err.txt", true);
// #endif
//
// return true;
BMLogger.Log("[Dat]- szPackPath: " + szPackPath);
if (!File.Exists(szPackPath))
{
BMLogger.LogError("[Dat]- File not found: " + szPackPath);
return false;
}
long readBytes = 0;
FileStream fs = new FileStream(szPackPath, FileMode.Open, FileAccess.Read);
TASK_PACK_HEADER tph = AAssit.ReadFromBinaryOf<TASK_PACK_HEADER>(fs, ref readBytes);
if (tph.magic != TASK_PACK_MAGIC
|| tph.version != _task_templ_cur_version)
return false;
if (tph.item_count == 0) return true;
uint[] pOffs = new uint[tph.item_count];
g_ulNewCount++;
// fread(pOffs, sizeof(long), tph.item_count, fp);
// read File and prepare offset array before loading tasks
pOffs = AAssit.ReadArrayFromBinary<uint>(fs, (int)tph.item_count, ref readBytes);
Debug.Log((int)tph.item_count);
//BMLogger.Log($" [MH] Task File Lenght: {fs.Length}");
// for (int i = 2058; i < 2059; i++) //TODO: tph.item_count
Debug.Log($" Starting to load {tph.item_count} task templates...");
for (int i = 0; i < tph.item_count; i++)
{
// mvoe file pointer to task offset
fs.Seek(pOffs[i], SeekOrigin.Begin);
// BMLogger.Log(" [MH] Loading Task Templ at offset: " + pOffs[i]);
ATaskTempl pTempl = new ATaskTempl();
g_ulNewCount++;
// Debug.Log($"Task Index {i}: Attempting to load task template...");
if (!pTempl.LoadFromBinFile(fs))
{
CECTaskInterface.WriteLog(0, (int)pTempl.m_FixedData.m_ID, 0, "Cant Load Task");
// LOG_DELETE(pTempl);
continue;
}
AddOneTaskTempl(pTempl);
// TaskInterface::WriteLog(0, pTempl->m_ID, 2, "LoadTask");
}
List<ATaskTempl> loadedTasks;
// thread-safe capture
Action<float> workerReport = p =>
{
// workerProgress = p;
};
try
{
// background thread
loadedTasks = await UniTask.RunOnThreadPool(() => LoadTasksFromPack_Internal(szPackPath, onProgress)
);
}
catch (Exception e)
{
Debug.LogException(e);
return false;
}
Debug.Log($" Starting to load {loadedTasks.Count} task templates...");
// int batch = 0;
// foreach (var templ in loadedTasks)
// {
// AddOneTaskTempl(templ);
// g_ulNewCount++;
//
// // avoid frame spike
// if (++batch >= 20)
// {
// batch = 0;
// await UniTask.Yield();
// }
// }
int count = loadedTasks.Count;
for (int i = 0; i < count; i++)
{
AddOneTaskTempl(loadedTasks[i]);
g_ulNewCount++;
onProgress?.Invoke(0.8f + (i + 1) / (float)count * 0.2f);
if (i % 20 == 0)
await UniTask.Yield();
}
onProgress?.Invoke(1f);
Debug.Log($" Finished loading {m_TaskTemplMap.Count} task templates.");
// // char log[1024];
// // sprintf(log, "LoadTask, Count = %d", m_TaskTemplMap.size());
// // TaskInterface::WriteLog(0, 0, 2, log);
// //todo: check
// // LOG_DELETE_ARR(pOffs);
fs.Close();
#if !_TASK_CLIENT
UpdateTimeLimitCheckList();
UpdateTimeLimitCheckList();
#else
SortTasksCanSeekOut();
#endif
#if _ELEMENTCLIENT
// TODO: implement task error logging if needed
// _task_err.Release();
// _task_err.Init("Configs\\task_err.txt", true);
#endif
return true;
}
private static List<ATaskTempl> LoadTasksFromPack_Internal(string szPackPath, Action<float> onProgress)
{
long readBytes = 0;
var tasks = new List<ATaskTempl>();
using (var fs = new FileStream(
szPackPath,
FileMode.Open,
FileAccess.Read,
FileShare.Read))
{
TASK_PACK_HEADER tph =
AAssit.ReadFromBinaryOf<TASK_PACK_HEADER>(fs, ref readBytes);
if (tph.magic != TASK_PACK_MAGIC ||
tph.version != _task_templ_cur_version)
throw new Exception("Invalid task pack header");
if (tph.item_count == 0)
return tasks;
uint[] pOffs =
AAssit.ReadArrayFromBinary<uint>(fs, (int)tph.item_count, ref readBytes);
float percent = 80.0f / tph.item_count;
float percentCount = 0;
for (int i = 0; i < tph.item_count; i++)
{
percentCount += percent;
onProgress?.Invoke(percentCount);
// LoadingSceneController.Instance.UpdateUI(percentCount);
// Debug.LogError($"pc: {percentCount}");
fs.Seek(pOffs[i], SeekOrigin.Begin);
ATaskTempl templ = new ATaskTempl();
if (!templ.LoadFromBinFile(fs))
continue;
tasks.Add(templ);
}
}
return tasks;
}
// General method to read a struct from a FileStream
private T ReadStruct<T>(FileStream stream) where T : struct
@@ -177,95 +292,205 @@ namespace BrewMonster.Scripts.Task
handle.Free();
}
}
public bool LoadNPCInfoFromPack(string szPath)
public async UniTask<bool> LoadNPCInfoFromPack(string szPath)
{
// TODO: Implement NPC info loading if needed
// FILE* fp = fopen(szPath, "rb");
FileStream fp = new FileStream(szPath, FileMode.Open, FileAccess.Read);
// if (fp == null)
// {
// TaskInterface::WriteLog(0, 0, 0, "LoadNPCInfoFromPack, no such file");
// return false;
// }
// fseek(fp, 0, SEEK_END);
// size_t sz = ftell(fp);
// fseek(fp, 0, SEEK_SET);
long sz = fp.Length;
if (sz == 0)
// // TODO: Implement NPC info loading if needed
// // FILE* fp = fopen(szPath, "rb");
// FileStream fp = new FileStream(szPath, FileMode.Open, FileAccess.Read);
// // if (fp == null)
// // {
// // TaskInterface::WriteLog(0, 0, 0, "LoadNPCInfoFromPack, no such file");
// // return false;
// // }
//
// // fseek(fp, 0, SEEK_END);
// // size_t sz = ftell(fp);
// // fseek(fp, 0, SEEK_SET);
// long sz = fp.Length;
//
// if (sz == 0)
// {
// BMLogger.LogError("[ATaskTemplMan] LoadNPCInfoFromPack, file size is 0");
// fp.Close();
// return false;
// }
//
// long offset = 0;
// byte[] buf = new Byte[sz];
// g_ulNewCount++;
// // fread(buf, 1, sz, fp);
// buf = AAssit.ReadArrayFromBinary<byte>( fp, (int)sz, ref offset);
// // fclose(fp);
// fp.Close();
//
// if (!UnmarshalNPCInfo(buf, (int)sz, false))
// {
// // LOG_DELETE_ARR(buf);
// return false;
// }
//
// #if _TASK_CLIENT
// // LOG_DELETE_ARR(buf);
// #else
// m_pNPCInfoData = buf;
// m_ulNPCInfoDataSize = (uint)sz;
// #endif
//
// return true;
if (!File.Exists(szPath))
{
BMLogger.LogError("[ATaskTemplMan] LoadNPCInfoFromPack, file size is 0");
fp.Close();
BMLogger.LogError("[ATaskTemplMan] LoadNPCInfoFromPack, no such file");
return false;
}
long offset = 0;
byte[] buf = new Byte[sz];
byte[] buf;
try
{
// 1️⃣ background thread
buf = await UniTask.RunOnThreadPool(
() => LoadNPCInfoFromPack_Internal(szPath)
);
}
catch (Exception e)
{
Debug.LogException(e);
return false;
}
// 2️⃣ main thread (Unity-safe)
g_ulNewCount++;
// fread(buf, 1, sz, fp);
buf = AAssit.ReadArrayFromBinary<byte>( fp, (int)sz, ref offset);
// fclose(fp);
fp.Close();
if (!UnmarshalNPCInfo(buf, (int)sz, false))
{
// LOG_DELETE_ARR(buf);
if (!UnmarshalNPCInfo(buf, buf.Length, false))
return false;
}
#if _TASK_CLIENT
// LOG_DELETE_ARR(buf);
// nothing to store
#else
m_pNPCInfoData = buf;
m_ulNPCInfoDataSize = (uint)sz;
m_pNPCInfoData = buf;
m_ulNPCInfoDataSize = (uint)buf.Length;
#endif
return true;
}
public void VerifyDynTasksPack(string szPath)
private static byte[] LoadNPCInfoFromPack_Internal(string szPath)
{
// TODO: Implement dynamic task pack verification if needed
// strcpy(m_szDynPackPath, szPath);
m_szDynPackPath = szPath;
// FILE* fp = fopen(szPath, "rb");
FileStream fp = new FileStream(szPath, FileMode.Open, FileAccess.Read);
// if (fp == NULL) return;
// C++
// fseek(fp, 0, SEEK_END);
// size_t sz = ftell(fp);
// fseek(fp, 0, SEEK_SET);
// C#
long offset = 0;
long sz = fp.Length;
int header_sz = Marshal.SizeOf<DYN_TASK_PACK_HEADER>();
if (sz < header_sz)
using (var fs = new FileStream(
szPath,
FileMode.Open,
FileAccess.Read,
FileShare.Read))
{
// fclose(fp);
fp.Close();
return;
long sz = fs.Length;
if (sz == 0)
throw new Exception("NPC info file size is 0");
long offset = 0;
return AAssit.ReadArrayFromBinary<byte>(
fs,
(int)sz,
ref offset
);
}
}
public async UniTask<bool> VerifyDynTasksPack(string szPath)
{
// // TODO: Implement dynamic task pack verification if needed
// // strcpy(m_szDynPackPath, szPath);
// m_szDynPackPath = szPath;
//
//
// // FILE* fp = fopen(szPath, "rb");
// FileStream fp = new FileStream(szPath, FileMode.Open, FileAccess.Read);
// // if (fp == NULL) return;
//
// // C++
// // fseek(fp, 0, SEEK_END);
// // size_t sz = ftell(fp);
// // fseek(fp, 0, SEEK_SET);
//
// // C#
// long offset = 0;
// long sz = fp.Length;
//
// int header_sz = Marshal.SizeOf<DYN_TASK_PACK_HEADER>();
//
// if (sz < header_sz)
// {
// // fclose(fp);
// fp.Close();
// return;
// }
//
// // C++
// // char* buf = new char[header_sz];
// // g_ulNewCount++;
// // fread(buf, 1, header_sz, fp);
// // fclose(fp);
//
// byte[] buf = new byte[header_sz];
// g_ulNewCount++;
// buf = AAssit.ReadArrayFromBinary<byte>(fp, header_sz, ref offset);
// fp.Close();
//
// UnmarshalDynTasks(buf, header_sz, true);
// // LOG_DELETE_ARR(buf);
// store path on main thread
m_szDynPackPath = szPath;
if (!File.Exists(szPath))
return false;
byte[] headerBuf;
try
{
// 1️⃣ background thread
headerBuf = await UniTask.RunOnThreadPool(
() => VerifyDynTasksPack_Internal(szPath)
);
}
catch (Exception e)
{
Debug.LogException(e);
return false;
}
// C++
// char* buf = new char[header_sz];
// g_ulNewCount++;
// fread(buf, 1, header_sz, fp);
// fclose(fp);
byte[] buf = new byte[header_sz];
g_ulNewCount++;
buf = AAssit.ReadArrayFromBinary<byte>(fp, header_sz, ref offset);
fp.Close();
if (headerBuf == null)
return false;
UnmarshalDynTasks(buf, header_sz, true);
// LOG_DELETE_ARR(buf);
// 2️⃣ main thread
g_ulNewCount++;
UnmarshalDynTasks(headerBuf, headerBuf.Length, true);
return true;
}
private static byte[] VerifyDynTasksPack_Internal(string szPath)
{
using (var fs = new FileStream(
szPath,
FileMode.Open,
FileAccess.Read,
FileShare.Read))
{
long sz = fs.Length;
int headerSize = Marshal.SizeOf<DYN_TASK_PACK_HEADER>();
if (sz < headerSize)
return null;
long offset = 0;
return AAssit.ReadArrayFromBinary<byte>(
fs,
headerSize,
ref offset
);
}
}
public ATaskTempl GetTopTaskByID(uint ulID)
{
@@ -6,6 +6,7 @@ using System.IO;
using System.Runtime.InteropServices;
using BrewMonster.UI;
using CSNetwork;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace BrewMonster.Scripts.Task
@@ -369,7 +370,7 @@ namespace BrewMonster.Scripts.Task
}
// Initialize object
public bool Init(byte[] pActiveListBuf, int iActiveListLen, byte[] pFinishedListBuf,
public async UniTask<bool> Init(byte[] pActiveListBuf, int iActiveListLen, byte[] pFinishedListBuf,
int iFinishedListLen, byte[] pFinishedTimeListBuf, int iFinishedTimeListLen,
byte[] pFinishedCountListBuf, int iFinishedCountListLen, byte[] pStorageTaskListBuf, int iStorageTaskListLen)
{
@@ -378,7 +379,9 @@ namespace BrewMonster.Scripts.Task
{
return false;
}
// SceneLoader.SceneLoadProcess = SceneLoadProcess.Loading;
// SceneLoader.LoadingProgress = 0;
LoadingSceneController.Instance.ShowLoadingScene(true);
m_pActiveListBuf = new ActiveTaskList();
m_pActiveListBuf.ReadFromBuffer(pActiveListBuf);
@@ -413,6 +416,9 @@ namespace BrewMonster.Scripts.Task
ATaskTemplMan pTaskMan = GetTaskTemplMan();
pTaskMan.Release();
LoadingSceneController.Instance.ShowLoadingScene(true);
LoadingSceneController.Instance.UpdateUI(0f);
LoadingSceneController.Instance.SetLoadingText("Loading Tasks From Pack");
#if UNITY_EDITOR
if (TaskTest.Instance &&
@@ -424,19 +430,34 @@ namespace BrewMonster.Scripts.Task
else
{
string task_data_path = Path.Combine(Application.streamingAssetsPath, "data/tasks.data");
pTaskMan.LoadTasksFromPack(task_data_path, true);
await pTaskMan.LoadTasksFromPack(task_data_path, true, (x) =>
{
LoadingSceneController.Instance.UpdateUI(x);
});
}
#else
string task_data_path = Path.Combine(Application.streamingAssetsPath, "data/tasks.data");
pTaskMan.LoadTasksFromPack(task_data_path, true);
await pTaskMan.LoadTasksFromPack(task_data_path, true);
#endif
SceneLoader.LoadingProgress = 60;
LoadingSceneController.Instance.UpdateUI(0.7f);
LoadingSceneController.Instance.SetLoadingText("Loading NPC From Pack");
var task_npc_path = Path.Combine(Application.streamingAssetsPath, "data/task_npc.data");
pTaskMan.LoadNPCInfoFromPack(task_npc_path);
await pTaskMan.LoadNPCInfoFromPack(task_npc_path);
Debug.LogError("End LoadNPCInfoFromPack");
SceneLoader.LoadingProgress = 75;
LoadingSceneController.Instance.UpdateUI(0.75f);
LoadingSceneController.Instance.SetLoadingText("Verify Dynamic Tasks Pack");
var dyn_tasks_path = Path.Combine(Application.streamingAssetsPath, "data/dyn_tasks.data");
pTaskMan.VerifyDynTasksPack(dyn_tasks_path);
await pTaskMan.VerifyDynTasksPack(dyn_tasks_path);
InitActiveTaskList();
SceneLoader.LoadingProgress = 100;
LoadingSceneController.Instance.UpdateUI(1f);
LoadingSceneController.Instance.SetLoadingText("Entering Game");
SceneLoader.SceneLoadProcess = SceneLoadProcess.EndLoading;
LoadingSceneController.Instance.ShowLoadingScene(false);
m_bForceNavigateFinish = false;
@@ -1,4 +1,5 @@
using BrewMonster.Network;
using Cysharp.Threading.Tasks;
using PerfectWorld.Scripts.Task;
namespace BrewMonster.Scripts.Task
@@ -47,7 +48,7 @@ namespace BrewMonster.Scripts.Task
public interface TaskInterface
{
bool Init(byte[] pActiveListBuf, int iActiveListLen, byte[] pFinishedListBuf,
UniTask<bool> Init(byte[] pActiveListBuf, int iActiveListLen, byte[] pFinishedListBuf,
int iFinishedListLen, byte[] pFinishedTimeListBuf, int iFinishedTimeListLen,
byte[] pFinishedCountListBuf, int iFinishedCountListLen, byte[] pStorageTaskListBuf,
int iStorageTaskListLen);
+7 -2
View File
@@ -15,6 +15,7 @@ namespace BrewMonster.Scripts.Task
{
public static ATaskTemplMan m_pTaskMan; // use static to store loaded data across instances
public bool WasLoadTaskData = false;
public bool AutoLoadData;
[Header("Test Dlg Award Options")]
[SerializeField] private uint _awardItemID = 1001;
@@ -23,6 +24,10 @@ namespace BrewMonster.Scripts.Task
private void OnValidate()
{
WasLoadTaskData = m_pTaskMan != null && m_pTaskMan.TaskLoadedCount > 0;
if (!WasLoadTaskData && AutoLoadData)
{
LoadTaskData();
}
}
private void Update()
@@ -96,7 +101,7 @@ namespace BrewMonster.Scripts.Task
}
[ContextMenu("Load Data")]
void LoadTaskData()
async void LoadTaskData()
{
if (m_pTaskMan == null)
{
@@ -104,7 +109,7 @@ namespace BrewMonster.Scripts.Task
}
string path = Path.Combine(Application.streamingAssetsPath, "data/tasks.data");
WasLoadTaskData = m_pTaskMan.LoadTasksFromPack(path, true);
WasLoadTaskData = await m_pTaskMan.LoadTasksFromPack(path, true,(x)=>{});
}
[ContextMenu("Test Size")]
@@ -125,6 +125,9 @@ namespace BrewMonster.UI
return;
}
};
SceneLoader.SceneLoadProcess = SceneLoadProcess.Loading;
SceneLoader.LoadingProgress = 0;
LoadingSceneController.Instance.ShowLoadingScene(true);
#if TESTFAST
string nameScene = "LoginScene";
SceneManager.UnloadSceneAsync(nameScene);
+792
View File
@@ -0,0 +1,792 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &237530162348205230
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6954598778548246722}
- component: {fileID: 3039664736528355014}
- component: {fileID: 7270640488870520982}
m_Layer: 5
m_Name: PercentLabel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6954598778548246722
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 237530162348205230}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2870929995814517053}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.14340019}
m_SizeDelta: {x: 0, y: -24.9456}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3039664736528355014
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 237530162348205230}
m_CullTransparentMesh: 1
--- !u!114 &7270640488870520982
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 237530162348205230}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 23%
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 21.2
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &752022102156491388
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6794110919409434385}
- component: {fileID: 2006518316736665754}
- component: {fileID: 2487042404357809237}
m_Layer: 5
m_Name: BG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &6794110919409434385
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752022102156491388}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2870929995814517053}
m_Father: {fileID: 1498433891306440738}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2006518316736665754
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752022102156491388}
m_CullTransparentMesh: 1
--- !u!114 &2487042404357809237
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752022102156491388}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: b17924b6b7c78b74f8bd81beb6099972, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1253822099379841126
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8819184454638197523}
- component: {fileID: 3556704604394319723}
- component: {fileID: 655569369460596013}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8819184454638197523
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1253822099379841126}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1679867140415222605}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3556704604394319723
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1253822099379841126}
m_CullTransparentMesh: 1
--- !u!114 &655569369460596013
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1253822099379841126}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.09411765, g: 0.4988748, b: 0.85882354, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1350348288180899800
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2870929995814517053}
- component: {fileID: 3961381925820122199}
m_Layer: 5
m_Name: ProgressBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2870929995814517053
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1350348288180899800}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7973553455093132000}
- {fileID: 1679867140415222605}
- {fileID: 7448874308476023876}
- {fileID: 6954598778548246722}
- {fileID: 4146490789493023576}
m_Father: {fileID: 6794110919409434385}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 83.6369}
m_SizeDelta: {x: 1855.6492, y: 48.6686}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3961381925820122199
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1350348288180899800}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_TargetGraphic: {fileID: 4389115248635797559}
m_FillRect: {fileID: 8819184454638197523}
m_HandleRect: {fileID: 7640072662976260491}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!1 &1682473977380559532
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7973553455093132000}
- component: {fileID: 8477954588579120357}
- component: {fileID: 7662109531967672966}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7973553455093132000
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1682473977380559532}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2870929995814517053}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8477954588579120357
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1682473977380559532}
m_CullTransparentMesh: 1
--- !u!114 &7662109531967672966
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1682473977380559532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.3443396, g: 0.40371305, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &2213993380868078032
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4146490789493023576}
- component: {fileID: 4592186959237053483}
- component: {fileID: 2031915970332984306}
m_Layer: 5
m_Name: TaskLabel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4146490789493023576
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2213993380868078032}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2870929995814517053}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 27.5}
m_SizeDelta: {x: 0, y: -24.9456}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4592186959237053483
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2213993380868078032}
m_CullTransparentMesh: 1
--- !u!114 &2031915970332984306
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2213993380868078032}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 23%
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278255369
m_fontColor: {r: 0.034500837, g: 1, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 21.2
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &3384898060590067801
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7448874308476023876}
m_Layer: 5
m_Name: Handle Slide Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7448874308476023876
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3384898060590067801}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7640072662976260491}
m_Father: {fileID: 2870929995814517053}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6500472629937108760
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1498433891306440738}
- component: {fileID: 6418851540371260803}
m_Layer: 5
m_Name: LoadingUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1498433891306440738
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6500472629937108760}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6794110919409434385}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6418851540371260803
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6500472629937108760}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c0f91323d4b23b4428e423d2c724d821, type: 3}
m_Name:
m_EditorClassIdentifier:
goContent: {fileID: 752022102156491388}
progressBar: {fileID: 3961381925820122199}
percentText: {fileID: 7270640488870520982}
loadingText: {fileID: 2031915970332984306}
--- !u!1 &6559642003620323789
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1679867140415222605}
m_Layer: 5
m_Name: Fill Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1679867140415222605
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6559642003620323789}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8819184454638197523}
m_Father: {fileID: 2870929995814517053}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: -0.06518555, y: 0}
m_SizeDelta: {x: -10.1305, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6895589902788730412
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7640072662976260491}
- component: {fileID: 7048533629971895957}
- component: {fileID: 4389115248635797559}
m_Layer: 5
m_Name: Handle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &7640072662976260491
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6895589902788730412}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7448874308476023876}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7048533629971895957
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6895589902788730412}
m_CullTransparentMesh: 1
--- !u!114 &4389115248635797559
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6895589902788730412}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4b2c2bde3e2945e4ba4516d08d755aeb
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5f0e60c802cf01eacf4cb214f00e8b7e04dcae61d68d6ed1ce599f2ee0f09db9
size 200516379
oid sha256:5ec8cc7321de76e090597eb869ffde3b1340d1fe396c26bfdf2e09554b70d54b
size 200521903
+9 -7
View File
@@ -7,6 +7,7 @@ using UnityEngine;
using System.Runtime.InteropServices;
using BrewMonster.Network;
using BrewMonster.UI;
using Cysharp.Threading.Tasks;
namespace BrewMonster
{
@@ -56,7 +57,7 @@ namespace BrewMonster
public CECShortcutSet GetShortcutSet1(int n) { return m_aSCSets1[n]; }
public CECShortcutSet GetShortcutSet2(int n) { return m_aSCSets2[n]; }
private void OnMsgHstTaskData(ECMSG Msg)
private async UniTaskVoid OnMsgHstTaskData(ECMSG Msg)
{
// decode header to distinguish TASK_DATA vs TASK_VAR_DATA
// if (!(Msg.dwParam2 is cmd_header header))
@@ -85,12 +86,13 @@ namespace BrewMonster
m_pTaskInterface = null;
m_pTaskInterface = new CECTaskInterface(this);
if (!m_pTaskInterface.Init(
pCmd.active_list, (int)pCmd.active_list_size,
pCmd.finished_list, (int)pCmd.finished_list_size,
pCmd.finished_time_list, (int)pCmd.finished_time_list_size,
pCmd.finished_count, (int)pCmd.finished_count_size,
pCmd.storage_task, (int)pCmd.storage_task_size))
var initTask = await m_pTaskInterface.Init(
pCmd.active_list, (int)pCmd.active_list_size,
pCmd.finished_list, (int)pCmd.finished_list_size,
pCmd.finished_time_list, (int)pCmd.finished_time_list_size,
pCmd.finished_count, (int)pCmd.finished_count_size,
pCmd.storage_task, (int)pCmd.storage_task_size);
if (!initTask)
{
Debug.LogError("CECHostPlayer::OnMsgHstTaskData, failed to initialize task interface");
return;
+1 -1
View File
@@ -438,7 +438,7 @@ namespace BrewMonster
}
case int value when value == EC_MsgDef.MSG_HST_TASKDATA:
{
OnMsgHstTaskData(Msg);
OnMsgHstTaskData(Msg).Forget();
//Debug.LogError("[Dat]- OnMsgHstTaskData");
break;
}