Open Project 기능 개발
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
using Ookii.Dialogs;
|
using Ookii.Dialogs;
|
||||||
|
using Studio.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
using TriLibCore.SFB;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XRLib.UI;
|
using XRLib.UI;
|
||||||
@@ -22,7 +26,7 @@ namespace Studio.UI
|
|||||||
|
|
||||||
private RectTransform Footer;
|
private RectTransform Footer;
|
||||||
public TextMeshProUGUI Text_ProjectName;
|
public TextMeshProUGUI Text_ProjectName;
|
||||||
public TextMeshProUGUI Text_ProjectMetaInfo;
|
public Image Image_ProjectMetaInfo;
|
||||||
public Button Button_Open;
|
public Button Button_Open;
|
||||||
|
|
||||||
public Action onClickOpen;
|
public Action onClickOpen;
|
||||||
@@ -30,6 +34,7 @@ namespace Studio.UI
|
|||||||
public override void AfterAwake()
|
public override void AfterAwake()
|
||||||
{
|
{
|
||||||
recentProjectItemPrefab = Resources.Load<GameObject>("Prefabs/UI/PRF_QuickStartItem");
|
recentProjectItemPrefab = Resources.Load<GameObject>("Prefabs/UI/PRF_QuickStartItem");
|
||||||
|
InputField_ProjectRoute.onEndEdit.AddListener(OnEndEditProjectRoute);
|
||||||
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
|
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
|
||||||
Button_Open.onClick.AddListener(OnClickOpen);
|
Button_Open.onClick.AddListener(OnClickOpen);
|
||||||
|
|
||||||
@@ -39,10 +44,38 @@ namespace Studio.UI
|
|||||||
CreateRecentProjectItem();
|
CreateRecentProjectItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int MaxRecentCount = 5;
|
|
||||||
|
private void OnEndEditProjectRoute(string input)
|
||||||
|
{
|
||||||
|
Footer.gameObject.SetActive(true);
|
||||||
|
var name = Path.GetFileNameWithoutExtension(input);
|
||||||
|
Text_ProjectName.text = name;
|
||||||
|
|
||||||
|
string json = File.ReadAllText(input);
|
||||||
|
var metaInfo = JsonConvert.DeserializeObject<ProjectData>(json).sceneStartSetting.appSetting;
|
||||||
|
var bytes = Convert.FromBase64String(metaInfo.splashImageByte);
|
||||||
|
|
||||||
|
Texture2D texture = new Texture2D(2, 2);
|
||||||
|
if (texture.LoadImage(bytes))
|
||||||
|
{
|
||||||
|
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||||
|
Image_ProjectMetaInfo.sprite = sprite;
|
||||||
|
|
||||||
|
float height = Image_ProjectMetaInfo.rectTransform.rect.height;
|
||||||
|
float newWidth = Image_ProjectMetaInfo.rectTransform.rect.height / metaInfo.ratio;
|
||||||
|
Image_ProjectMetaInfo.rectTransform.sizeDelta = new Vector2(newWidth, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnClickFileExplorer()
|
private void OnClickFileExplorer()
|
||||||
{
|
{
|
||||||
|
var paths = StandaloneFileBrowser.OpenFilePanel("Select Project", "", "ocs", false);
|
||||||
|
|
||||||
|
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
|
||||||
|
{
|
||||||
|
InputField_ProjectRoute.text = paths[0].Name;
|
||||||
|
InputField_ProjectRoute.onEndEdit?.Invoke(InputField_ProjectRoute.text);
|
||||||
|
}
|
||||||
onClickFileExplorer?.Invoke();
|
onClickFileExplorer?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +94,6 @@ namespace Studio.UI
|
|||||||
{
|
{
|
||||||
Footer.gameObject.SetActive(true);
|
Footer.gameObject.SetActive(true);
|
||||||
Text_ProjectName.text = "test Name";
|
Text_ProjectName.text = "test Name";
|
||||||
Text_ProjectMetaInfo.text = "test MetaInfo";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClickOpen()
|
private void OnClickOpen()
|
||||||
@@ -78,5 +110,10 @@ namespace Studio.UI
|
|||||||
{
|
{
|
||||||
SetActive(false);
|
SetActive(false);
|
||||||
}
|
}
|
||||||
|
public string GetProjectRoute()
|
||||||
|
{
|
||||||
|
var route = InputField_ProjectRoute.text;
|
||||||
|
return route;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: -313, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!114 &8471333801798805777
|
--- !u!114 &8471333801798805777
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -95,7 +95,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &1400210738098770660
|
--- !u!224 &1400210738098770660
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -379,6 +379,81 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_HorizontalFit: 2
|
m_HorizontalFit: 2
|
||||||
m_VerticalFit: 0
|
m_VerticalFit: 0
|
||||||
|
--- !u!1 &2793506983804135456
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6701481719810646188}
|
||||||
|
- component: {fileID: 4642786582748789513}
|
||||||
|
- component: {fileID: 3962855974617539056}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Image_ProjectMetaInfo
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &6701481719810646188
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2793506983804135456}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1733474418316772572}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 30, y: -75}
|
||||||
|
m_SizeDelta: {x: 0, y: 100}
|
||||||
|
m_Pivot: {x: 0, y: 1}
|
||||||
|
--- !u!222 &4642786582748789513
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2793506983804135456}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &3962855974617539056
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2793506983804135456}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 0}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
--- !u!1 &2874945760003473324
|
--- !u!1 &2874945760003473324
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -433,7 +508,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &3519767485975804969
|
--- !u!224 &3519767485975804969
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -441,7 +516,7 @@ RectTransform:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 3548633605584249014}
|
m_GameObject: {fileID: 3548633605584249014}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
@@ -510,7 +585,7 @@ MonoBehaviour:
|
|||||||
Button_Server: {fileID: 0}
|
Button_Server: {fileID: 0}
|
||||||
Content: {fileID: 0}
|
Content: {fileID: 0}
|
||||||
Text_ProjectName: {fileID: 0}
|
Text_ProjectName: {fileID: 0}
|
||||||
Text_ProjectMetaInfo: {fileID: 0}
|
Image_ProjectMetaInfo: {fileID: 0}
|
||||||
Button_Open: {fileID: 0}
|
Button_Open: {fileID: 0}
|
||||||
--- !u!1 &3667883360357675757
|
--- !u!1 &3667883360357675757
|
||||||
GameObject:
|
GameObject:
|
||||||
@@ -550,7 +625,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 69, y: -30}
|
m_AnchoredPosition: {x: 69, y: -30}
|
||||||
m_SizeDelta: {x: 460, y: 400}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!114 &1384644586455371387
|
--- !u!114 &1384644586455371387
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -746,7 +821,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &7181377966771834519
|
--- !u!224 &7181377966771834519
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -763,9 +838,9 @@ RectTransform:
|
|||||||
- {fileID: 8242514978822736773}
|
- {fileID: 8242514978822736773}
|
||||||
m_Father: {fileID: 6743587899122872675}
|
m_Father: {fileID: 6743587899122872675}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 165, y: -200}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 330, y: 200}
|
m_SizeDelta: {x: 330, y: 200}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!222 &7865109430944762357
|
--- !u!222 &7865109430944762357
|
||||||
@@ -1043,9 +1118,9 @@ RectTransform:
|
|||||||
- {fileID: 3401883300906372988}
|
- {fileID: 3401883300906372988}
|
||||||
m_Father: {fileID: 3951532803893592897}
|
m_Father: {fileID: 3951532803893592897}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 165, y: -25}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 330, y: 50}
|
m_SizeDelta: {x: 330, y: 50}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &7503521630694973903
|
--- !u!222 &7503521630694973903
|
||||||
@@ -1223,7 +1298,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 30, y: -30}
|
m_AnchoredPosition: {x: 30, y: -30}
|
||||||
m_SizeDelta: {x: 136.26, y: 28.76}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!222 &8453890977499909358
|
--- !u!222 &8453890977499909358
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
@@ -1371,9 +1446,9 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 3951532803893592897}
|
m_Father: {fileID: 3951532803893592897}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 370, y: -25}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 50, y: 50}
|
m_SizeDelta: {x: 50, y: 50}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &7382446178276603782
|
--- !u!222 &7382446178276603782
|
||||||
@@ -1491,7 +1566,7 @@ RectTransform:
|
|||||||
m_Father: {fileID: 2551832815007717163}
|
m_Father: {fileID: 2551832815007717163}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 20, y: 20}
|
m_SizeDelta: {x: 20, y: 20}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
@@ -1692,9 +1767,9 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 3951532803893592897}
|
m_Father: {fileID: 3951532803893592897}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 435, y: -25}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 50, y: 50}
|
m_SizeDelta: {x: 50, y: 50}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &5442404928637345891
|
--- !u!222 &5442404928637345891
|
||||||
@@ -1817,7 +1892,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 230, y: -115}
|
m_AnchoredPosition: {x: 230, y: -115}
|
||||||
m_SizeDelta: {x: 460, y: 50}
|
m_SizeDelta: {x: 460, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &7004352675163465454
|
--- !u!114 &7004352675163465454
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -1874,7 +1949,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &1733474418316772572
|
--- !u!224 &1733474418316772572
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1890,6 +1965,7 @@ RectTransform:
|
|||||||
- {fileID: 6611736758746230093}
|
- {fileID: 6611736758746230093}
|
||||||
- {fileID: 1400210738098770660}
|
- {fileID: 1400210738098770660}
|
||||||
- {fileID: 7531454988131726038}
|
- {fileID: 7531454988131726038}
|
||||||
|
- {fileID: 6701481719810646188}
|
||||||
m_Father: {fileID: 3519767485975804969}
|
m_Father: {fileID: 3519767485975804969}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
@@ -2090,7 +2166,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 50.89, y: 23.01}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &2661312639398998131
|
--- !u!222 &2661312639398998131
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|||||||
@@ -8719,6 +8719,106 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: Panel_OpenProjectInfo
|
value: Panel_OpenProjectInfo
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 460
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_SizeDelta.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 230
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -115
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5732910410826313350, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5732910410826313350, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5732910410826313350, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 136.26
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5732910410826313350, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 68.13
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5732910410826313350, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -15
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6743587899122872675, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6743587899122872675, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_SizeDelta.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchorMin.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
|
|||||||
@@ -29,35 +29,38 @@ namespace Studio.Command
|
|||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
{
|
{
|
||||||
connector = ManagerHub.instance.Get<CustomAssetConnector>();
|
|
||||||
var projectManager = ManagerHub.instance.Get<ProjectManager>();
|
var projectManager = ManagerHub.instance.Get<ProjectManager>();
|
||||||
|
projectManager.LoadSceneSettingData();
|
||||||
|
|
||||||
List<AssetData> assets = projectManager.curProjectData.assetDatas;
|
//connector = ManagerHub.instance.Get<CustomAssetConnector>();
|
||||||
|
//var projectManager = ManagerHub.instance.Get<ProjectManager>();
|
||||||
|
|
||||||
string path = GetOpenFilePath();
|
//List<AssetData> assets = projectManager.curProjectData.assetDatas;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(path))
|
//string path = GetOpenFilePath();
|
||||||
return;
|
|
||||||
|
|
||||||
ProjectData projectData = GetFileData(path);
|
//if (string.IsNullOrEmpty(path))
|
||||||
|
// return;
|
||||||
|
|
||||||
if (projectData == null)
|
//ProjectData projectData = GetFileData(path);
|
||||||
return;
|
|
||||||
|
|
||||||
CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
|
//if (projectData == null)
|
||||||
|
// return;
|
||||||
|
|
||||||
foreach (AssetData asset in assets)
|
//CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
|
||||||
{
|
|
||||||
LoadAsset(asset);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (AssetData asset in assets)
|
//foreach (AssetData asset in assets)
|
||||||
{
|
//{
|
||||||
RestoreHierarchy(asset);
|
// LoadAsset(asset);
|
||||||
}
|
//}
|
||||||
|
|
||||||
projectManager.curProjectPath = path;
|
//foreach (AssetData asset in assets)
|
||||||
projectManager.curProjectData = projectData;
|
//{
|
||||||
|
// RestoreHierarchy(asset);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//projectManager.curProjectPath = path;
|
||||||
|
//projectManager.curProjectData = projectData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetOpenFilePath()
|
private string GetOpenFilePath()
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Studio.Util
|
|||||||
public class AppSetting
|
public class AppSetting
|
||||||
{
|
{
|
||||||
public string splashImageByte;
|
public string splashImageByte;
|
||||||
|
public float ratio;
|
||||||
public string animationStyle;
|
public string animationStyle;
|
||||||
public string progressBarStyle;
|
public string progressBarStyle;
|
||||||
public bool autoStart;
|
public bool autoStart;
|
||||||
|
|||||||
@@ -47,21 +47,25 @@ namespace Studio.Manage
|
|||||||
}
|
}
|
||||||
public void LoadSceneSettingData()
|
public void LoadSceneSettingData()
|
||||||
{
|
{
|
||||||
string path = Path.Combine(Application.persistentDataPath, "SceneStartSetting.json");
|
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
|
||||||
|
var filePath = canvas_Popup.panel_openprojectinfo.GetProjectRoute();
|
||||||
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(path);
|
string json = File.ReadAllText(filePath);
|
||||||
var loadedSetting = JsonConvert.DeserializeObject<SceneStartSetting>(json);
|
|
||||||
|
|
||||||
onAppSetting?.Invoke(loadedSetting.appSetting);
|
curProjectName = Path.GetFileNameWithoutExtension(filePath);
|
||||||
onAPISetting?.Invoke(loadedSetting.apiSetting);
|
curProjectPath = Path.GetDirectoryName(filePath);
|
||||||
onMQTTSetting?.Invoke(loadedSetting.mqttSetting);
|
curProjectData = JsonConvert.DeserializeObject<ProjectData>(json);
|
||||||
onSaveModelDatas?.Invoke(loadedSetting.factorySetting);
|
|
||||||
|
onAppSetting?.Invoke(curProjectData.sceneStartSetting.appSetting);
|
||||||
|
onAPISetting?.Invoke(curProjectData.sceneStartSetting.apiSetting);
|
||||||
|
onMQTTSetting?.Invoke(curProjectData.sceneStartSetting.mqttSetting);
|
||||||
|
onSaveModelDatas?.Invoke(curProjectData.sceneStartSetting.factorySetting);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("JSON file not found: " + path);
|
Debug.LogWarning("JSON file not found: " + filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void SaveProjectSettingData()
|
public void SaveProjectSettingData()
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ namespace Studio
|
|||||||
|
|
||||||
public override void AfterAwake()
|
public override void AfterAwake()
|
||||||
{
|
{
|
||||||
GetComponent<Canvas>().sortingOrder = 1;
|
|
||||||
var renderObjectHandler = ManagerHub.instance.Get<RenderObjectHandler>();
|
var renderObjectHandler = ManagerHub.instance.Get<RenderObjectHandler>();
|
||||||
panel_objectinfo.onTransformChanged += renderObjectHandler.OnTransformChanged;
|
panel_objectinfo.onTransformChanged += renderObjectHandler.OnTransformChanged;
|
||||||
|
|
||||||
@@ -79,6 +78,7 @@ namespace Studio
|
|||||||
var quitManager = FindAnyObjectByType<QuitManager>();
|
var quitManager = FindAnyObjectByType<QuitManager>();
|
||||||
|
|
||||||
panel_newprojectinfo.onClickCreate += () => CommandInvoker.instance.Invoke(new NewProjectCommand());
|
panel_newprojectinfo.onClickCreate += () => CommandInvoker.instance.Invoke(new NewProjectCommand());
|
||||||
|
panel_openprojectinfo.onClickOpen += () => CommandInvoker.instance.Invoke(new LoadProjectCommand());
|
||||||
|
|
||||||
panel_apiconnectmodal.onClickFilterButton += dataManager.SetFilterData;
|
panel_apiconnectmodal.onClickFilterButton += dataManager.SetFilterData;
|
||||||
panel_apiconnectmodal.onSaveAPIData += dataManager.SetAPIData;
|
panel_apiconnectmodal.onSaveAPIData += dataManager.SetAPIData;
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ namespace XED.UI
|
|||||||
private TMP_InputField InputField_LanguagePack;
|
private TMP_InputField InputField_LanguagePack;
|
||||||
private Button Button_LanguagePack;
|
private Button Button_LanguagePack;
|
||||||
|
|
||||||
|
private float ratio;
|
||||||
|
|
||||||
public void Active(bool isActive)
|
public void Active(bool isActive)
|
||||||
{
|
{
|
||||||
gameObject.SetActive(isActive);
|
gameObject.SetActive(isActive);
|
||||||
@@ -134,6 +136,8 @@ namespace XED.UI
|
|||||||
{
|
{
|
||||||
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||||
Image_Selected.sprite = sprite;
|
Image_Selected.sprite = sprite;
|
||||||
|
|
||||||
|
ratio = texture.height / (float)texture.width;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -154,6 +158,7 @@ namespace XED.UI
|
|||||||
{
|
{
|
||||||
var bytes = Image_Selected.sprite.texture.EncodeToPNG();
|
var bytes = Image_Selected.sprite.texture.EncodeToPNG();
|
||||||
appSetting.splashImageByte = Convert.ToBase64String(bytes);
|
appSetting.splashImageByte = Convert.ToBase64String(bytes);
|
||||||
|
appSetting.ratio = ratio;
|
||||||
}
|
}
|
||||||
appSetting.animationStyle = Dropdown_AnimationStyle.options[Dropdown_AnimationStyle.value].text;
|
appSetting.animationStyle = Dropdown_AnimationStyle.options[Dropdown_AnimationStyle.value].text;
|
||||||
appSetting.progressBarStyle = Dropdown_ProgressBarStyle.options[Dropdown_ProgressBarStyle.value].text;
|
appSetting.progressBarStyle = Dropdown_ProgressBarStyle.options[Dropdown_ProgressBarStyle.value].text;
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ MonoBehaviour:
|
|||||||
- line: '| width: 1'
|
- line: '| width: 1'
|
||||||
- line: '| height: 1'
|
- line: '| height: 1'
|
||||||
- line: '| m_SplashScreenLogos: []'
|
- line: '| m_SplashScreenLogos: []'
|
||||||
- line: '| m_VirtualRealitySplashScreen: {instanceID: 0}'
|
- line: '| m_VirtualRealitySplashScreen: {fileID: 2800000, guid: b72c64868a74dd04e9b605a346744fb5,
|
||||||
|
type: 3}'
|
||||||
- line: '| m_HolographicTrackingLossScreen: {instanceID: 0}'
|
- line: '| m_HolographicTrackingLossScreen: {instanceID: 0}'
|
||||||
- line: '| defaultScreenWidth: 1920'
|
- line: '| defaultScreenWidth: 1920'
|
||||||
- line: '| defaultScreenHeight: 1080'
|
- line: '| defaultScreenHeight: 1080'
|
||||||
|
|||||||
Reference in New Issue
Block a user