The OxGFrame is a framework based on Unity for accelerating game development. Supports multi-platform Win, OSX, Android, iOS, WebGL.
/// <summary>
/// Init package by type
/// </summary>
/// <param name="packageInfo"></param>
/// <param name="autoUpdate"></param>
/// <returns></returns>
public static async UniTask<bool> InitPackage(PackageInfoWithBuild packageInfo, bool autoUpdate = false)
public class PackageOperation
{
/// <summary>
/// Ready operation for initialize (after events added)
/// </summary>
public void Ready()
}
Modified BundleDLCDemo sample.
Modified SetDefaultPackage determine.
Removed unuse samples from DiskUtils.
public void DriveUpdate(float dt) => this.HandleUpdate(dt);
public void DriveFixedUpdate(float dt) => this.HandleFixedUpdate(dt);
public void DriveLateUpdate(float dt) => this.HandleLateUpdate(dt);
public class PackageOperation
{
public delegate void OnPatchRepairFailed(PackageOperation itself);
public delegate void OnPatchInitPatchModeFailed(PackageOperation itself);
public delegate void OnPatchVersionUpdateFailed(PackageOperation itself);
public delegate void OnPatchManifestUpdateFailed(PackageOperation itself);
public delegate void OnPatchCheckDiskNotEnoughSpace(PackageOperation itself, int availableMegabytes, ulong patchTotalBytes);
public delegate void OnPatchDownloadFailed(PackageOperation itself, string fileName, string error);
}
public class PackageOperation
{
/// <summary>
/// Enable or disable disk space check procedure (default is true)
/// </summary>
public bool checkDiskSpace = true;
public OnPatchRepairFailed onPatchRepairFailed;
public OnPatchInitPatchModeFailed onPatchInitPatchModeFailed;
public OnPatchVersionUpdateFailed onPatchVersionUpdateFailed;
public OnPatchManifestUpdateFailed onPatchManifestUpdateFailed;
public OnPatchCheckDiskNotEnoughSpace onPatchCheckDiskNotEnoughSpace;
public OnPatchDownloadFailed onPatchDownloadFailed;
public void UserTryPatchRepair()
public void UserTryInitPatchMode()
public void UserTryPatchVersionUpdate()
public void UserTryPatchManifestUpdate()
public void UserTryCreateDownloader()
}
method ShowAnime => ShowAnimation
method HideAnime => HideAnimation
delegate AnimeEndCb => AnimationEnd
param animeEndCb => animationEnd
Replace all in Visual Studio
public static int GetStackByStackCount(string canvasName)
public static int GetStackByStackCount(int groupId, string canvasName)
How to use it
if (Keyboard.current.escapeKey.wasReleasedThisFrame)
{
if (CoreFrames.UIFrame.GetStackByStackCount(groupId, canvasName) > 0)
{
CoreFrames.UIFrame.CloseStackByStack(groupId, canvasName);
}
else
{
Debug.Log("Open Esc Menu!!!");
}
}
public enum NodeType
{
Fixed, // Normal => Fixed
TopFixed, // Fixed => TopFixed
Popup, // Same
TopPopup, // Same
LoadingPopup, // Same
SysPopup, // Same
TopSysPopup, // Same
AwaitingPopup // Same
}
// Factory Mode
public static PackageOperation CreateOperation(string groupName, PackageInfoWithBuild packageInfo, bool skipDownload = false)
public static PackageOperation CreateOperation(string groupName, PackageInfoWithBuild[] packageInfos, bool skipDownload = false)
// Use Example
var packageOperations = new PackageOperation[]
{
new PackageOperation
(
"DLC Package 1",
new DlcPackageInfoWithBuild()
{
buildMode = BuildMode.ScriptableBuildPipeline,
packageName = "Dlc1Package",
dlcVersion = "latest"
},
false
),
new PackageOperation
(
"DLC Pacakge 2",
new DlcPackageInfoWithBuild()
{
buildMode = BuildMode.ScriptableBuildPipeline,
packageName = "Dlc2Package",
dlcVersion = "latest"
},
false
)
};
public abstract class PackageInfoWithBuild
{
[Tooltip("Only for EditorSimulateMode")]
public BuildMode buildMode;
public string packageName;
/// <summary>
/// Custom host server
/// </summary>
[HideInInspector]
public string hostServer = null;
/// <summary>
/// Custom fallback host server
/// </summary>
[HideInInspector]
public string fallbackHostServer = null;
public IBuildinQueryServices builtinQueryService = null;
public IDeliveryQueryServices deliveryQueryService = null;
public IDeliveryLoadServices deliveryLoadService = null;
}
#region Binding Components
protected Image _bgImg;
protected Text _msgTxt;
/// <summary>
/// Auto Binding Section
/// </summary>
protected override void OnAutoBind()
{
base.OnAutoBind();
this._bgImg = this.collector.GetNodeComponent<Image>("Bg*Img");
this._msgTxt = this.collector.GetNodeComponent<Text>("Msg*Txt");
}
#endregion