forked from sin365/AxibugEmuOnline
å¤多平台打包
This commit is contained in:
parent
3ffa4e77c1
commit
fef8fe42a8
AxibugEmuOnline.Client/Assets
AxiProjectTools
Plugins/AxiReplay
Script/AppMain/AxiInputSP.Settings
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR_WIN
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -37,12 +38,12 @@ namespace AxibugEmuOnline.Editors
|
||||
}
|
||||
|
||||
[MenuItem("Axibug盧濂묏야/Switch/AxibugNSPTools/Build With RepackNSP(댔관NSP깻路劤뭐쉔NPS)")]
|
||||
static void BuildWithRepackNSP()
|
||||
public static void BuildWithRepackNSP()
|
||||
{
|
||||
if (!CheckEnvironmentVariable())
|
||||
return;
|
||||
|
||||
if (!EditorUtility.DisplayDialog("횅훰관斤口", $"셨崎댔관?", "셨崎", "혤句"))
|
||||
if (!EditorUtility.DisplayDialog("댔관", $"횅훰댔관NSP?", "셨崎", "혤句"))
|
||||
return;
|
||||
|
||||
var levels = new List<string>();
|
||||
@ -325,3 +326,4 @@ namespace AxibugEmuOnline.Editors
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
@ -0,0 +1,118 @@
|
||||
#if UNITY_EDITOR
|
||||
using AxibugEmuOnline.Editors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
|
||||
public static class AxiAutoBuild
|
||||
{
|
||||
[MenuItem("Axibug移植工具/AutoBuild/Build ALL")]
|
||||
public static void Build_Build_ALL()
|
||||
{
|
||||
Build_Global(BuildTarget.Android);
|
||||
Build_Global(BuildTarget.iOS);
|
||||
Build_Global(BuildTarget.StandaloneWindows);
|
||||
Build_Global(BuildTarget.StandaloneLinux64);
|
||||
Build_Global(BuildTarget.WSAPlayer);
|
||||
AxibugNSPTools.BuildWithRepackNSP();
|
||||
}
|
||||
|
||||
[MenuItem("Axibug移植工具/AutoBuild/Android")]
|
||||
public static void Build_Android()
|
||||
{
|
||||
Build_Global(BuildTarget.Android);
|
||||
}
|
||||
|
||||
[MenuItem("Axibug移植工具/AutoBuild/IOS")]
|
||||
public static void Build_IOS()
|
||||
{
|
||||
Build_Global(BuildTarget.iOS);
|
||||
}
|
||||
[MenuItem("Axibug移植工具/AutoBuild/PC")]
|
||||
public static void Build_PC()
|
||||
{
|
||||
Build_Global(BuildTarget.StandaloneWindows);
|
||||
}
|
||||
[MenuItem("Axibug移植工具/AutoBuild/Linux")]
|
||||
public static void Build_Linux64()
|
||||
{
|
||||
Build_Global(BuildTarget.StandaloneLinux64);
|
||||
}
|
||||
[MenuItem("Axibug移植工具/AutoBuild/UWP")]
|
||||
public static void Build_UWP()
|
||||
{
|
||||
Build_Global(BuildTarget.WSAPlayer);
|
||||
}
|
||||
|
||||
[MenuItem("Axibug移植工具/AutoBuild/EmbeddedLinux")]
|
||||
public static void Build_EmbeddedLinux()
|
||||
{
|
||||
Build_Global(BuildTarget.EmbeddedLinux);
|
||||
}
|
||||
|
||||
[MenuItem("Axibug移植工具/AutoBuild/Switch")]
|
||||
public static void Build_Switch()
|
||||
{
|
||||
AxibugNSPTools.BuildWithRepackNSP();
|
||||
}
|
||||
|
||||
|
||||
public static void Build_Global(BuildTarget target)
|
||||
{
|
||||
if (!EditorUtility.DisplayDialog("打包", $"确认打包{target}?", "继续", "取消"))
|
||||
return;
|
||||
|
||||
var levels = new List<string>();
|
||||
foreach (var scene in EditorBuildSettings.scenes)
|
||||
{
|
||||
if (scene.enabled)
|
||||
levels.Add(scene.path);
|
||||
}
|
||||
|
||||
var buildOpt = EditorUserBuildSettings.development ? BuildOptions.Development : BuildOptions.None;
|
||||
if (EditorUserBuildSettings.buildWithDeepProfilingSupport)
|
||||
buildOpt |= BuildOptions.EnableDeepProfilingSupport;
|
||||
if (EditorUserBuildSettings.allowDebugging)
|
||||
buildOpt |= BuildOptions.AllowDebugging;
|
||||
|
||||
string targetName = $"{Application.productName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}";
|
||||
|
||||
targetName += target switch
|
||||
{
|
||||
BuildTarget.Android => ".apk",
|
||||
BuildTarget.iOS => ".ipa",
|
||||
BuildTarget.StandaloneWindows => ".exe",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
|
||||
string _locationPathName = $"Output/{target}/{targetName}";
|
||||
string FullPath = Path.GetFullPath(Path.Combine(Application.dataPath, "..", _locationPathName));
|
||||
string dirPath = Path.GetDirectoryName(FullPath);
|
||||
if (!Directory.Exists(dirPath))
|
||||
Directory.CreateDirectory(dirPath);
|
||||
|
||||
var options = new BuildPlayerOptions
|
||||
{
|
||||
scenes = levels.ToArray(),
|
||||
locationPathName = _locationPathName,
|
||||
target = target,
|
||||
options = buildOpt
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
BuildReport report = BuildPipeline.BuildPlayer(options);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[AutoBuild] Unity Build {target} 错误:{ex.ToString()}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3b8550d3919d1044b50eb20f0c50fb8
|
@ -34,6 +34,22 @@ namespace AxiReplay
|
||||
m_targetFrameRate = targetFrameRate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 临时方法(暂行)
|
||||
/// </summary>
|
||||
/// <param name="mRemoteForwardCount"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public int TempFrameCount(int mRemoteForwardCount)
|
||||
{
|
||||
if (mRemoteForwardCount == 0)
|
||||
return 0;
|
||||
if (mRemoteForwardCount < 5)
|
||||
return 1;
|
||||
else
|
||||
return (int)Math.Ceiling(mRemoteForwardCount / 5f);
|
||||
}
|
||||
|
||||
void CalcCacheCount()
|
||||
{
|
||||
double deltaMax = 0;
|
||||
|
@ -103,7 +103,8 @@ namespace AxiReplay
|
||||
|
||||
|
||||
//if (targetFrame == mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count > 0)
|
||||
if (targetFrame == mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count >= mRemoteForwardCount)
|
||||
//if (targetFrame == mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count >= mRemoteForwardCount)
|
||||
if (targetFrame == mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count >= frameProfiler.TempFrameCount(mRemoteForwardCount))
|
||||
{
|
||||
//当前帧追加
|
||||
mCurrClientFrameIdx = targetFrame;
|
||||
|
@ -36,7 +36,7 @@ namespace AxiInputSP.Setting
|
||||
controllers[0].ColletAllKey();
|
||||
return;
|
||||
#endif
|
||||
#region P1
|
||||
#region
|
||||
//P1 键盘
|
||||
controllers[0].SetKey((ulong)EnumButtonType.START, AxiInputEx.ByKeyCode(KeyCode.Return));
|
||||
controllers[0].SetKey((ulong)EnumButtonType.SELECT, AxiInputEx.ByKeyCode(KeyCode.RightShift));
|
||||
|
Loading…
Reference in New Issue
Block a user