Project build: https://github.com/eduhub123/MonkeyStory2GameBuilder
Script Auto Build: build_game.bat
Trong script build cần config các thông tin:
UNITY_PATH=<Path Unity Editor>
ADDRESSABLE_PROJECT_PATH=<Path Build Project>
MAIN_PROJECT_PATH=<Path Monkey Story 2.0 Project>
Script Build c#: GameBuild.cs
Cách download game trong MS 2.0
Cấu trúc
public interface IGameService
{
public void DownloadGameBundle(int gameId, Action<bool> callback);
public void LoadGameCatalogs(int gameId, Action<bool> callback);
}
Download Game:
IGameService gameService = SupportSystem.Instance[SupportSystem.ServiceIDs.GameService] as IGameService;
gameService.DownloadGameBundle(gameConfigData.GameID, IsSuccess =>
{
//Callback sau khi download xong
});
Load Catalogs
IGameService gameService = SupportSystem.Instance[SupportSystem.ServiceIDs.GameService] as IGameService;
gameService.LoadGameCatalogs(gameConfigData.GameID, IsSuccess =>
{
if (IsSuccess)
//Load Game
else
{
Debug.LogError("Load Game Catalogs Failed");
}
});
Sau khi load catalogs thành công thì có thể load game từ Addressables như bình thường