-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
namespace Editor | ||
using System.Diagnostics; | ||
using UnityEditor; | ||
|
||
namespace Microsoft.Extensions.Hosting.Unity.Editor | ||
{ | ||
public class MonoBehaviourHostRootEditor | ||
[CustomEditor(typeof(MonoBehaviourHostRoot))] | ||
public class MonoBehaviourHostRootEditor : UnityEditor.Editor | ||
{ | ||
|
||
private const string GITHUB_URL = "https://github.com/amelkor/Microsoft.Extensions.Hosting.Unity"; | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
EditorGUILayout.HelpBox( | ||
"This script is controlled by HostManager component and keeps resolved MonoBehaviour services.", | ||
MessageType.Info); | ||
|
||
// ReSharper disable once InvertIf | ||
if (EditorGUILayout.LinkButton("For additional information visit the GitHub link")) | ||
{ | ||
var ps = new ProcessStartInfo(GITHUB_URL) | ||
{ | ||
UseShellExecute = true, | ||
Verb = "open" | ||
}; | ||
Process.Start(ps); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
namespace Microsoft.Extensions.Hosting.Unity.Configuration | ||
using System.IO; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Microsoft.Extensions.Hosting.Unity.Configuration | ||
{ | ||
public class GlobalSettings | ||
public class GlobalSettingsConfigurationSource<TSettings> : IConfigurationSource where TSettings : GlobalSettings, new() | ||
{ | ||
internal TSettings Provider { get; private set; } | ||
|
||
public IConfigurationProvider Build(IConfigurationBuilder builder) | ||
{ | ||
var settings = new TSettings(); | ||
|
||
if (!File.Exists(GlobalSettings.LocalFilePath)) | ||
settings.Save(); | ||
else | ||
settings.Load(); | ||
|
||
Provider = settings; | ||
return settings; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.