mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 编辑器拓展资源运行模式
[+] 编辑器拓展资源运行模式
This commit is contained in:
@@ -66,7 +66,7 @@ namespace TEngine.Editor.Inspector
|
||||
{
|
||||
if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
|
||||
{
|
||||
EditorGUILayout.EnumPopup("Resource Mode", t.playMode);
|
||||
EditorGUILayout.EnumPopup("Resource Mode", t.PlayMode);
|
||||
|
||||
EditorGUILayout.EnumPopup("VerifyLevel", t.verifyLevel);
|
||||
|
||||
|
@@ -28,7 +28,7 @@ MonoBehaviour:
|
||||
m_AtlasFolder: Assets/AssetRaw/UIRaw
|
||||
m_ResourceVersionFileName: ResourceVersion.txt
|
||||
HostServerURL: http://127.0.0.1:8081/AssetsRoot/
|
||||
FallbackHostServerURL:
|
||||
FallbackHostServerURL: http://127.0.0.1:8081/AssetsRoot/
|
||||
EnableUpdateData: 1
|
||||
WindowsUpdateDataUrl: http://127.0.0.1:8081/AssetsRoot/UpdateData.json
|
||||
MacOSUpdateDataUrl: http://127.0.0.1
|
||||
|
@@ -101,7 +101,7 @@ namespace TEngine
|
||||
transform.localScale = Vector3.one;
|
||||
|
||||
m_LocalizationManager.SetLocalizationHelper(localizationHelper);
|
||||
m_LocalizationManager.Language = resourceModule.playMode == EPlayMode.EditorSimulateMode && rootModule.EditorLanguage != Language.Unspecified
|
||||
m_LocalizationManager.Language = resourceModule.PlayMode == EPlayMode.EditorSimulateMode && rootModule.EditorLanguage != Language.Unspecified
|
||||
? rootModule.EditorLanguage : m_LocalizationManager.SystemLanguage;
|
||||
}
|
||||
|
||||
|
@@ -146,9 +146,18 @@ namespace TEngine
|
||||
YooAssets.SetDefaultPackage(package);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
//编辑器模式使用。
|
||||
EPlayMode playMode = (EPlayMode)UnityEditor.EditorPrefs.GetInt("EditorResourceMode");
|
||||
Log.Warning($"编辑器模式使用:{playMode}");
|
||||
#else
|
||||
//运行时使用。
|
||||
EPlayMode playMode = PlayMode;
|
||||
#endif
|
||||
|
||||
// 编辑器下的模拟模式
|
||||
InitializationOperation initializationOperation = null;
|
||||
if (PlayMode == EPlayMode.EditorSimulateMode)
|
||||
if (playMode == EPlayMode.EditorSimulateMode)
|
||||
{
|
||||
var createParameters = new EditorSimulateModeParameters();
|
||||
createParameters.SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(packageName);
|
||||
@@ -156,7 +165,7 @@ namespace TEngine
|
||||
}
|
||||
|
||||
// 单机运行模式
|
||||
if (PlayMode == EPlayMode.OfflinePlayMode)
|
||||
if (playMode == EPlayMode.OfflinePlayMode)
|
||||
{
|
||||
var createParameters = new OfflinePlayModeParameters();
|
||||
createParameters.DecryptionServices = new GameDecryptionServices();
|
||||
@@ -164,7 +173,7 @@ namespace TEngine
|
||||
}
|
||||
|
||||
// 联机运行模式
|
||||
if (PlayMode == EPlayMode.HostPlayMode)
|
||||
if (playMode == EPlayMode.HostPlayMode)
|
||||
{
|
||||
var createParameters = new HostPlayModeParameters();
|
||||
createParameters.DecryptionServices = new GameDecryptionServices();
|
||||
|
@@ -43,7 +43,31 @@ namespace TEngine
|
||||
/// <summary>
|
||||
/// 资源系统运行模式。
|
||||
/// </summary>
|
||||
public EPlayMode playMode = EPlayMode.EditorSimulateMode;
|
||||
[SerializeField] private EPlayMode playMode = EPlayMode.EditorSimulateMode;
|
||||
|
||||
/// <summary>
|
||||
/// 资源系统运行模式。
|
||||
/// <remarks>编辑器内优先使用。</remarks>
|
||||
/// </summary>
|
||||
public EPlayMode PlayMode
|
||||
{
|
||||
get
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//编辑器模式使用。
|
||||
return (EPlayMode)UnityEditor.EditorPrefs.GetInt("EditorResourceMode");
|
||||
#else
|
||||
//运行时使用。
|
||||
return playMode;
|
||||
#endif
|
||||
}
|
||||
set
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
playMode = value;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载文件校验等级。
|
||||
|
@@ -239,12 +239,11 @@ public class FrameworkGlobalSettings
|
||||
get { return m_ConfigFolderName; }
|
||||
}
|
||||
|
||||
[LabelText("代码生成脚本命名空间")]
|
||||
[SerializeField] private string @namespace = "GameLogic";
|
||||
|
||||
public string NameSpace => @namespace;
|
||||
|
||||
[SerializeField] [LabelText("代码生成脚本名映射")]
|
||||
[SerializeField]
|
||||
private List<ScriptGenerateRuler> scriptGenerateRule = new List<ScriptGenerateRuler>()
|
||||
{
|
||||
new("m_go", "GameObject"),
|
||||
|
Reference in New Issue
Block a user