mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
新增Setting面板设置
新增Setting面板设置
This commit is contained in:
8
UnityProject/Assets/Editor/TEngineSettingsProvider.meta
Normal file
8
UnityProject/Assets/Editor/TEngineSettingsProvider.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cace8d5078f400048a8afde10e2bf41d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -0,0 +1,36 @@
|
|||||||
|
using TEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
public static class TEngineSettingsProvider
|
||||||
|
{
|
||||||
|
[MenuItem("TEngine/Settings/TEngine UpdateSettings", priority = -1)]
|
||||||
|
public static void OpenSettings() => SettingsService.OpenProjectSettings("Project/TEngine/UpdateSettings");
|
||||||
|
|
||||||
|
private const string SettingsPath = "Project/TEngine/UpdateSettings";
|
||||||
|
|
||||||
|
[SettingsProvider]
|
||||||
|
public static SettingsProvider CreateMySettingsProvider()
|
||||||
|
{
|
||||||
|
return new SettingsProvider(SettingsPath, SettingsScope.Project)
|
||||||
|
{
|
||||||
|
label = "TEngine/UpdateSettings",
|
||||||
|
guiHandler = (searchContext) =>
|
||||||
|
{
|
||||||
|
var settings = Settings.UpdateSetting;
|
||||||
|
var serializedObject = new SerializedObject(settings);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("projectName"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("HotUpdateAssemblies"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("AOTMetaAssemblies"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("LogicMainDllName"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("AssemblyTextAssetExtension"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("AssemblyTextAssetPath"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateStyle"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("ResDownLoadPath"));
|
||||||
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("FallbackResDownLoadPath"));
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
},
|
||||||
|
keywords = new[] { "TEngine", "Settings", "Custom" }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1c738d23f551c84e9e12af687389aeb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -0,0 +1,32 @@
|
|||||||
|
using TEngine.Editor.UI;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
public static class TEngineUISettingsProvider
|
||||||
|
{
|
||||||
|
[MenuItem("TEngine/Settings/TEngineUISettings", priority = -1)]
|
||||||
|
public static void OpenSettings() => SettingsService.OpenProjectSettings("Project/TEngine/UISettings");
|
||||||
|
|
||||||
|
private const string SettingsPath = "Project/TEngine/UISettings";
|
||||||
|
|
||||||
|
[SettingsProvider]
|
||||||
|
public static SettingsProvider CreateMySettingsProvider()
|
||||||
|
{
|
||||||
|
return new SettingsProvider(SettingsPath, SettingsScope.Project)
|
||||||
|
{
|
||||||
|
label = "TEngine/UISettings",
|
||||||
|
guiHandler = (searchContext) =>
|
||||||
|
{
|
||||||
|
var scriptGeneratorSetting = ScriptGeneratorSetting.Instance;
|
||||||
|
var scriptGenerator = new SerializedObject(scriptGeneratorSetting);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(scriptGenerator.FindProperty("_codePath"));
|
||||||
|
EditorGUILayout.PropertyField(scriptGenerator.FindProperty("_namespace"));
|
||||||
|
EditorGUILayout.PropertyField(scriptGenerator.FindProperty("_widgetName"));
|
||||||
|
EditorGUILayout.PropertyField(scriptGenerator.FindProperty("CodeStyle"));
|
||||||
|
EditorGUILayout.PropertyField(scriptGenerator.FindProperty("scriptGenerateRule"));
|
||||||
|
scriptGenerator.ApplyModifiedProperties();
|
||||||
|
},
|
||||||
|
keywords = new[] { "TEngine", "Settings", "Custom" }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2672376ad13242bcb6869e90c4def052
|
||||||
|
timeCreated: 1742814408
|
Reference in New Issue
Block a user