Merge branch 'develop' into feature-multiProject

This commit is contained in:
Andrew Cassidy 2020-10-09 17:28:00 -07:00
commit f5af8a4d53
2 changed files with 3 additions and 2 deletions

View File

@ -5,8 +5,8 @@ using UnityEngine.UI;
namespace ConformalDecals.UI { namespace ConformalDecals.UI {
[KSPAddon(KSPAddon.Startup.Instantly, true)] [KSPAddon(KSPAddon.Startup.Instantly, true)]
public class UILoader : MonoBehaviour { public class UILoader : MonoBehaviour {
private static readonly string Path = KSPUtil.ApplicationRootPath + "GameData/ConformalDecals/Resources/";
private static string _path;
private static GameObject _textEntryPrefab; private static GameObject _textEntryPrefab;
private static GameObject _fontMenuPrefab; private static GameObject _fontMenuPrefab;
private static GameObject _colorPickerPrefab; private static GameObject _colorPickerPrefab;
@ -16,7 +16,8 @@ namespace ConformalDecals.UI {
public static GameObject ColorPickerPrefab => _colorPickerPrefab; public static GameObject ColorPickerPrefab => _colorPickerPrefab;
private void Awake() { private void Awake() {
var prefabs = AssetBundle.LoadFromFile(Path + "ui.conformaldecals"); _path = KSPUtil.ApplicationRootPath + "GameData/ConformalDecals/Resources/";
var prefabs = AssetBundle.LoadFromFile(_path + "ui.conformaldecals");
_textEntryPrefab = prefabs.LoadAsset("TextEntryPanel") as GameObject; _textEntryPrefab = prefabs.LoadAsset("TextEntryPanel") as GameObject;
_fontMenuPrefab = prefabs.LoadAsset("FontMenuPanel") as GameObject; _fontMenuPrefab = prefabs.LoadAsset("FontMenuPanel") as GameObject;