배치된 오브젝트 저장 및 저장된 오브젝트 불러오기 기능 추가 #91

Merged
UVCXR merged 3 commits from jym/250524_01 into main 2025-05-24 17:04:14 +09:00
37 changed files with 4890 additions and 1682 deletions

View File

@@ -850,10 +850,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8351073445621197384}
- {fileID: 7343312561069943535}
- {fileID: 5432522367969156775}
- {fileID: 278239820566090254}
- {fileID: 7093248375770478575}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -911,7 +909,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 25457a0961cc0bb4a949d5fe58c2ada6, type: 3}
m_Name:
m_EditorClassIdentifier:
selectedURLs: []
--- !u!1 &2774336303168765450
GameObject:
m_ObjectHideFlags: 0
@@ -925,7 +922,7 @@ GameObject:
- component: {fileID: 4194680172313760227}
- component: {fileID: 4161472474340858527}
m_Layer: 5
m_Name: Contents
m_Name: ContentArea
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -938,7 +935,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2774336303168765450}
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_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -946,7 +943,7 @@ RectTransform:
- {fileID: 7853657062583654302}
- {fileID: 5597721997679764478}
- {fileID: 3968252631811439720}
m_Father: {fileID: 7257151592976347537}
m_Father: {fileID: 7093248375770478575}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@@ -1265,8 +1262,9 @@ GameObject:
- component: {fileID: 6840359962142578336}
- component: {fileID: 1993039467431344961}
- component: {fileID: 3994860411736980792}
- component: {fileID: 1699707003209144614}
m_Layer: 5
m_Name: Title
m_Name: HaederArea
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -1279,13 +1277,14 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4322829904092401199}
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_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3734078514979837023}
m_Father: {fileID: 7257151592976347537}
- {fileID: 278239820566090254}
m_Father: {fileID: 7093248375770478575}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@@ -1345,6 +1344,18 @@ MonoBehaviour:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 1, y: -1}
m_UseGraphicAlpha: 1
--- !u!114 &1699707003209144614
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4322829904092401199}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fa81ed666c3432441a47113a8812fc7c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &4527343414870565064
GameObject:
m_ObjectHideFlags: 0
@@ -1772,6 +1783,43 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &6010522723516701095
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7093248375770478575}
m_Layer: 5
m_Name: Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7093248375770478575
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6010522723516701095}
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:
- {fileID: 8351073445621197384}
- {fileID: 5432522367969156775}
m_Father: {fileID: 7257151592976347537}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6802457156864953380
GameObject:
m_ObjectHideFlags: 0
@@ -2567,13 +2615,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8415573258789961671}
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_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3421495713549568527}
m_Father: {fileID: 7257151592976347537}
m_Father: {fileID: 8351073445621197384}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}

File diff suppressed because it is too large Load Diff

View File

@@ -1797,6 +1797,10 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 136411123651892915, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: -30
objectReference: {fileID: 0}
- target: {fileID: 1006177941616694947, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 1
@@ -1821,66 +1825,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -85
objectReference: {fileID: 0}
- target: {fileID: 1251556539314681174, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1251556539314681174, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1251556539314681174, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1251556539314681174, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1453934114001025659, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1453934114001025659, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1453934114001025659, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1453934114001025659, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2374106145558075720, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2374106145558075720, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2895846756970397937, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_Color.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2895846756970397937, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_Color.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2895846756970397937, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_Color.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3254036307801150249, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3254036307801150249, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3531496374987278801, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
@@ -1897,10 +1841,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4049328991925839773, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4171474248864594299, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
@@ -1921,46 +1861,6 @@ PrefabInstance:
propertyPath: m_Name
value: Panel_NewProjectInfo
objectReference: {fileID: 0}
- target: {fileID: 6092324537095634317, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6933982812649115435, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6933982812649115435, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6933982812649115435, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.x
value: 136.26
objectReference: {fileID: 0}
- target: {fileID: 6933982812649115435, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 68.13
objectReference: {fileID: 0}
- target: {fileID: 6933982812649115435, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: -40
objectReference: {fileID: 0}
- target: {fileID: 7216954628468018826, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7216954628468018826, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7216954628468018826, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7216954628468018826, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7820417904637097140, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
@@ -2057,38 +1957,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8036671826876076572, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.x
value: 60.67
objectReference: {fileID: 0}
- target: {fileID: 8036671826876076572, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.y
value: 23.01
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.x
value: 380
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 190
objectReference: {fileID: 0}
- target: {fileID: 8106588635392288030, guid: 84dfc296b72fa084b86783a94204fe9c, type: 3}
propertyPath: m_AnchoredPosition.y
value: -145
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -2193,23 +2061,23 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3548633605584249014, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.x
value: 435
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3625024966114329480, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.y
value: -25
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMax.y
@@ -2225,7 +2093,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.y
value: 50
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3951532803893592897, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.x
@@ -2237,43 +2105,43 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4188235441515691998, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.x
value: 50.89
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4188235441515691998, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.y
value: 23.01
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611736758746230093, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.x
value: 136.26
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611736758746230093, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.y
value: 28.76
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6743587899122872675, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.x
value: 460
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6743587899122872675, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_SizeDelta.y
value: 50
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.x
value: 370
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7142951765868690235, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.y
value: -25
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7415030585086245894, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_Color.b
@@ -2289,19 +2157,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.x
value: 165
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8418443472057348741, guid: 8795ea0c7698ec949b563139a3f042d9, type: 3}
propertyPath: m_AnchoredPosition.y
value: -25
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1439898dc68446940b764bda65d2b285
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -187,6 +187,22 @@ namespace Studio.AssetTool
}
childAsset.renderObject.transform.parent = parentAsset.renderObject.transform;
}
public void OnLoadAsset(AssetData asset)
{
AssetLibraryItem item = assetScrollView.FindItem(asset.name, AssetLibraryItemType.file);
OnAssetSelected(item);
selectRenderObject.transform.position = new Vector3(asset.position.x, asset.position.y, asset.position.z);
selectRenderObject.transform.eulerAngles = new Vector3(asset.rotation.x, asset.rotation.y, asset.rotation.z);
selectRenderObject.transform.localScale = new Vector3(asset.scale.x, asset.scale.y, asset.scale.z);
OnAssetDropped(item);
}
public void OnRestoreHierarchy(HierarchyItem parentItem, HierarchyItem childItem)
{
componentScrollView.selectedItems.Add(childItem);
componentScrollView.SetToChildItem(childItem, parentItem);
componentScrollView.DeselectAll();
}
public void OnDeselectAll()
{

View File

@@ -7,7 +7,7 @@ namespace Studio.Repositories
{
public class CustomAssetDataRepository
{
List<CustomAssetData> assetDatas = new List<CustomAssetData>();
public List<CustomAssetData> assetDatas = new List<CustomAssetData>();
public bool isEmpty => assetDatas.Count == 0;

View File

@@ -31,6 +31,7 @@ namespace Studio.AssetTool
private bool isSaveTaskComplete = true;
public bool isLoadTaskComplete = true;
public Transform fbxAnchor;
public Action onLoadComplete;
public FBXFileManager()
{
@@ -231,6 +232,7 @@ namespace Studio.AssetTool
connector.assetScrollView.AddItem(folderName, null, AssetLibraryItemType.folder);
AssetLibraryItem item = connector.assetScrollView.AddItem(assetData.assetName, assetData.gameObject, AssetLibraryItemType.file, urlSectionItem);
onLoadComplete?.Invoke();
}
}
}

View File

@@ -1,7 +1,5 @@
using Studio.AssetTool;
using Studio.Command;
using Studio.Manage;
using UnityEngine;
namespace Studio
{
@@ -17,7 +15,8 @@ namespace Studio
public void Execute()
{
var assetManager = ManagerHub.instance.Get<AssetManager>();
assetManager.LoadLocalFBXDirectorys();
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
assetManager.LoadLocalFBXDirectorys(canvas_Popup.panel_assetmanager.GetAssetManagerData().localAssetsPaths);
}
}
}

View File

@@ -14,7 +14,11 @@ namespace Studio.Command
public void Execute()
{
var projectManager = ManagerHub.instance.Get<ProjectManager>();
projectManager.NewProjectSettingData();
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var projectName = canvas_Popup.panel_newprojectinfo.GetProjectName();
var projectPath = canvas_Popup.panel_newprojectinfo.GetProjectRoute();
projectManager.NewProjectSettingData(projectName, projectPath);
//CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
}

View File

@@ -0,0 +1,22 @@
using Studio.Manage;
namespace Studio.Command
{
public class OpenProjectCommand : IIrreversibleCommand
{
public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public bool CanExecute()
{
throw new System.NotImplementedException();
}
public void Execute()
{
var projectManager = ManagerHub.instance.Get<ProjectManager>();
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
projectManager.OpenProejctSettingData(canvas_Popup.panel_openprojectinfo.GetProjectRoute());
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 23bc6c2724e5b5c4f8a51420ad4b8d06

View File

@@ -0,0 +1,26 @@
using Studio.Command;
using Studio.Manage;
using UnityEngine;
namespace Studio
{
public class TopMenuNewProjectCommand : IIrreversibleCommand
{
public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public bool CanExecute()
{
throw new System.NotImplementedException();
}
public void Execute()
{
var projectManager = ManagerHub.instance.Get<ProjectManager>();
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var projectName = canvas_Popup.panel_topmenunewprojectinfo.GetProjectName();
var projectPath = canvas_Popup.panel_topmenunewprojectinfo.GetProjectRoute();
projectManager.NewProjectSettingData(projectName, projectPath);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6da120c5828408748b14ce26595a71dc

View File

@@ -0,0 +1,25 @@
using Studio.Command;
using Studio.Manage;
using UnityEngine;
namespace Studio
{
public class TopMenuOpenProjectCommand : IIrreversibleCommand
{
public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public bool CanExecute()
{
throw new System.NotImplementedException();
}
public void Execute()
{
var projectManager = ManagerHub.instance.Get<ProjectManager>();
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var projectPath = canvas_Popup.panel_topmenuopenprojectinfo.GetProjectRoute();
projectManager.OpenProejctSettingData(projectPath);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4df673e7f08965a498147d86a45602cf

View File

@@ -5,8 +5,8 @@ namespace Studio.Util
{
public class ProjectData
{
public string updateDate;
public SceneStartSetting sceneStartSetting;
public AssetManagerData assetManagerData;
public List<AssetData> assetDatas;
}
@@ -82,6 +82,12 @@ namespace Studio.Util
public string dataValue;
}
public class AssetManagerData
{
public List<string> serverAssetsPaths = new List<string>();
public List<string> localAssetsPaths = new List<string>();
}
public class AssetData
{
public int id;

View File

@@ -14,12 +14,14 @@ namespace Studio
{
folderPath.Clear();
}
public void LoadLocalFBXDirectorys()
public void LoadLocalFBXDirectorys(List<string> folderPaths)
{
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
folderPath.Clear();
var fbxFileManager = ManagerHub.instance.Get<FBXFileManager>();
foreach(var path in canvas_Popup.panel_assetmanager.selectedURLs)
foreach(var path in folderPaths)
{
if (folderPath.Contains(path))
continue;

View File

@@ -27,6 +27,12 @@ namespace Studio.Manage
canvas_popup.panel_openprojectinfo.onClickOpen += canvas_popup.panel_start.Close;
canvas_popup.panel_openprojectinfo.onClickOpen += canvas_popup.panel_openprojectinfo.Close;
canvas_popup.panel_topmenunewprojectinfo.onClickCreate += canvas_static.panel_scenetab.Init;
canvas_popup.panel_topmenunewprojectinfo.onClickCreate += canvas_popup.panel_topmenunewprojectinfo.Close;
canvas_popup.panel_topmenuopenprojectinfo.onClickOpen += canvas_static.panel_scenetab.Init;
canvas_popup.panel_topmenuopenprojectinfo.onClickOpen += canvas_popup.panel_topmenuopenprojectinfo.Close;
canvas_popup.panel_startsetting.onClickAppSetting += canvas_popup.panel_appsetting.Active;
canvas_popup.panel_startsetting.onClickAuthSetting += canvas_popup.panel_authsetting.Active;
canvas_popup.panel_startsetting.onClickAPISetting += canvas_popup.panel_apisetting.Active;

View File

@@ -8,6 +8,8 @@ using Studio.Util;
using UnityEngine;
using System.Linq;
using Studio.HierarchyTree;
using Studio.Command;
using Studio.AssetLibraryTree;
namespace Studio.Manage
{
@@ -24,28 +26,55 @@ namespace Studio.Manage
public Action<MQTTSetting> onMQTTSetting;
public Action<Dynamic3DModelSetting> onSaveModelDatas;
public Action<AssetManagerData> onAssetManagerDatas;
private CustomAssetConnector connector;
private Dictionary<int, HierarchyItem> itemDict = new Dictionary<int, HierarchyItem>();
public override void Init()
{
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var fbxFileManager = ManagerHub.instance.Get<FBXFileManager>();
fbxFileManager.onLoadComplete += LoadCustomAsset;
onAppSetting += canvas_Popup.panel_appsetting.SetAppSetting;
onAPISetting += canvas_Popup.panel_apisetting.SetAPISetting;
onMQTTSetting += canvas_Popup.panel_mqttsetting.SetMQTTSetting;
onSaveModelDatas += canvas_Popup.panel_3dfactorysetting.SetDynamic3DModelSetting;
onAssetManagerDatas += canvas_Popup.panel_assetmanager.SetAssetManager;
}
public void NewProjectSettingData()
private void ResetProjectSettingData()
{
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
connector = ManagerHub.instance.Get<CustomAssetConnector>();
curProjectName = canvas_Popup.panel_newprojectinfo.GetProjectName();
curProjectPath = canvas_Popup.panel_newprojectinfo.GetProjectRoute();
curProjectTemplate = canvas_Popup.panel_newprojectinfo.GetProjectTemplate();
curProjectData = null;
onAppSetting?.Invoke(null);
onAPISetting?.Invoke(null);
onMQTTSetting?.Invoke(null);
onSaveModelDatas?.Invoke(null);
onAssetManagerDatas?.Invoke(null);
foreach (var customAssetData in connector.connectedAssets)
{
connector.assetScrollView.RemoveItem(customAssetData.assetData.folderName, AssetLibraryItemType.folder);
connector.assetScrollView.RemoveItem(customAssetData.assetData.assetName, AssetLibraryItemType.file);
}
CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
}
public void LoadSceneSettingData()
public void NewProjectSettingData(string proejctName, string projectPath)
{
curProjectName = proejctName;
curProjectPath = projectPath;
curProjectTemplate = string.Empty;
curProjectData = null;
ResetProjectSettingData();
}
public void OpenProejctSettingData(string filePath)
{
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var filePath = canvas_Popup.panel_openprojectinfo.GetProjectRoute();
var assetManager = ManagerHub.instance.Get<AssetManager>();
ResetProjectSettingData();
if (File.Exists(filePath))
{
@@ -55,6 +84,8 @@ namespace Studio.Manage
curProjectPath = Path.GetDirectoryName(filePath);
curProjectData = JsonConvert.DeserializeObject<ProjectData>(json);
assetManager.LoadLocalFBXDirectorys(curProjectData.assetManagerData.localAssetsPaths);
onAppSetting?.Invoke(curProjectData.sceneStartSetting.appSetting);
onAPISetting?.Invoke(curProjectData.sceneStartSetting.apiSetting);
onMQTTSetting?.Invoke(curProjectData.sceneStartSetting.mqttSetting);
@@ -82,8 +113,8 @@ namespace Studio.Manage
.Select(asset => CreateAssetData(asset.hierarchyItem))
.ToList();
curProjectData = CreateProjectData(assetDatas);
string json = JsonConvert.SerializeObject(curProjectData, Formatting.Indented);
FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write);
StreamWriter writer = new StreamWriter(fs, System.Text.Encoding.Unicode);
writer.Write(json);
@@ -106,8 +137,8 @@ namespace Studio.Manage
{
return new ProjectData
{
updateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
sceneStartSetting = CreateSceneStartSettingData(),
assetManagerData = CreateAssetManagerData(),
assetDatas = assetDatas
};
}
@@ -123,11 +154,58 @@ namespace Studio.Manage
return sceneStartSetting;
}
private AssetManagerData CreateAssetManagerData()
{
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
var assetManagerData = canvas_Popup.panel_assetmanager.GetAssetManagerData();
return assetManagerData;
}
private string GetSaveFilePath()
{
var data = StandaloneFileBrowser.SaveFilePanel("SaveProject", "", curProjectName, ".ocs");
return data.Name;
}
private void LoadCustomAsset()
{
if (curProjectData == null)
return;
connector = ManagerHub.instance.Get<CustomAssetConnector>();
List<AssetData> assets = curProjectData.assetDatas;
CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
foreach (AssetData asset in assets)
{
LoadAsset(asset);
itemDict.Add(asset.id, connector.connectedAssets.Last().hierarchyItem);
}
foreach (AssetData asset in assets)
{
RestoreHierarchy(asset);
}
onAssetManagerDatas?.Invoke(curProjectData.assetManagerData);
}
private void LoadAsset(AssetData asset)
{
connector.OnLoadAsset(asset);
}
private void RestoreHierarchy(AssetData asset)
{
foreach (int id in asset.children)
{
HierarchyItem parent = itemDict[asset.id];
HierarchyItem child = itemDict[id];
if (parent == null || child == null)
continue;
connector.OnRestoreHierarchy(parent, child);
}
}
}
}

View File

@@ -17,6 +17,9 @@ namespace Studio.Manage
GameObject assetLibraryWindow = canvas_Popup.panel_assetlibrary.gameObject;
GameObject repository = canvas_Popup.panel_datarepository.gameObject;
canvas_static.panel_studiotopbar.onClickNewProject += canvas_Popup.panel_topmenunewprojectinfo.Open;
canvas_static.panel_studiotopbar.onClickOpenProject += canvas_Popup.panel_topmenuopenprojectinfo.Open;
canvas_static.panel_studiotopbar.onClickAssetManager += canvas_Popup.panel_assetmanager.Open;
canvas_static.panel_studiotopbar.onClickAssetLibraryWindow += (() => assetLibraryWindow.SetActive(true));
canvas_static.panel_studiotopbar.onClickHierarchyWindow += (() => hierarchyWindow.SetActive(true));

View File

@@ -17,6 +17,8 @@ namespace Studio
public Panel_Start panel_start;
public Panel_NewProjectInfo panel_newprojectinfo;
public Panel_OpenProjectInfo panel_openprojectinfo;
public Panel_TopMenuNewProjectInfo panel_topmenunewprojectinfo;
public Panel_TopMenuOpenProjectInfo panel_topmenuopenprojectinfo;
public Panel_StartSetting panel_startsetting;
public Panel_AppSetting panel_appsetting;
@@ -85,9 +87,12 @@ namespace Studio
var quitManager = FindAnyObjectByType<QuitManager>();
panel_newprojectinfo.onClickCreate += () => CommandInvoker.instance.Invoke(new NewProjectCommand());
//panel_openprojectinfo.onClickOpen += () => CommandInvoker.instance.Invoke(new LoadProjectCommand());
panel_openprojectinfo.onClickOpen += () => CommandInvoker.instance.Invoke(new OpenProjectCommand());
panel_assetmanager.onSelectedURLs += () => CommandInvoker.instance.Invoke(new LoadLocalAssetCommand());
panel_topmenunewprojectinfo.onClickCreate += () => CommandInvoker.instance.Invoke(new TopMenuNewProjectCommand());
panel_topmenuopenprojectinfo.onClickOpen += () => CommandInvoker.instance.Invoke(new TopMenuOpenProjectCommand());
panel_apiconnectmodal.onClickFilterButton += dataManager.SetFilterData;
panel_apiconnectmodal.onSaveAPIData += dataManager.SetAPIData;

View File

@@ -30,6 +30,7 @@ namespace Studio.UI
statusPanel.SetMode(ModePanel.ProgramMode.ObjectLayout);
//panel_studiotopbar.onClickAssetLibraryWindow += fbxFileManager.LoadLocalData;
panel_studiotopbar.onClickNewProject += () => CommandInvoker.instance.Invoke(new SaveProjectCommand());
panel_studiotopbar.onClickSaveProject += () => CommandInvoker.instance.Invoke(new SaveProjectCommand());
}
}

View File

@@ -19,6 +19,10 @@ namespace Studio
InputField_URL.onEndEdit.AddListener(OnEndEditInputFieldURL);
Button_SelectedFolder.onClick.AddListener(OnClickSelectedFolderButton);
}
public void SetData(string path)
{
InputField_URL.text = path;
}
private void OnEndEditInputFieldURL(string input)
{
if (string.IsNullOrEmpty(input))

View File

@@ -55,9 +55,9 @@ namespace Studio
item.SetData(dynamicObjectDatas, modelList);
dynamicObjectItems.Add(item);
UpdateLayout();
UpdateLayoutAddItem();
}
private void UpdateLayout()
private void UpdateLayoutAddItem()
{
var sizeDelta = Panel_3DGenerationSetting.sizeDelta;
sizeDelta.y += prf_dynamicObjectItem.rectTransform.rect.height + 10f;
@@ -67,6 +67,16 @@ namespace Studio
Button_AddDynamicObjectItem.transform.SetAsLastSibling();
}
private void UpdateLayoutRemoveItem()
{
var sizeDelta = Panel_3DGenerationSetting.sizeDelta;
sizeDelta.y -= prf_dynamicObjectItem.rectTransform.rect.height + 10f;
Panel_3DGenerationSetting.sizeDelta = sizeDelta;
LayoutRebuilder.ForceRebuildLayoutImmediate(Content);
Button_AddDynamicObjectItem.transform.SetAsLastSibling();
}
private void OnUISetting(UI_DynamicObjectItem rectTransform)
{
onUISetting?.Invoke(rectTransform);
@@ -75,6 +85,7 @@ namespace Studio
{
dynamicObjectItems.Remove(item);
Destroy(item.gameObject);
UpdateLayoutRemoveItem();
}
public Dynamic3DModelSetting GetDynamic3DModelSetting()
{
@@ -87,6 +98,16 @@ namespace Studio
}
public void SetDynamic3DModelSetting(Dynamic3DModelSetting saveModelDatas)
{
foreach(var item in dynamicObjectItems)
{
Destroy(item.gameObject);
UpdateLayoutRemoveItem();
}
dynamicObjectItems.Clear();
if (saveModelDatas == null)
return;
foreach(var modelData in saveModelDatas.modelDatas)
{
var item = Instantiate(prf_dynamicObjectItem, DynamicObjectItemContent);
@@ -96,7 +117,7 @@ namespace Studio
item.SetModelData(modelData);
dynamicObjectItems.Add(item);
UpdateLayout();
UpdateLayoutAddItem();
}
}
}

View File

@@ -56,7 +56,16 @@ namespace Studio
}
public void SetAPISetting(APISetting apiSetting)
{
foreach(var apiConnection in apiSetting.apiConnections)
foreach(var item in apiConnectionItems)
{
Destroy(item.gameObject);
}
apiConnectionItems.Clear();
if (apiSetting == null)
return;
foreach (var apiConnection in apiSetting.apiConnections)
{
var item = Instantiate(prf_APIConnectionItem, Content);
item.onRemoveAPIConnectionItem += RemoveAPIConnectionItem;

View File

@@ -170,20 +170,35 @@ namespace Studio.UI
}
public void SetAppSetting(AppSetting appSetting)
{
var bytes = Convert.FromBase64String(appSetting.splashImageByte);
Texture2D texture = new Texture2D(2, 2);
if (texture.LoadImage(bytes))
if (appSetting == null)
{
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 = null;
Dropdown_AnimationStyle.value = 0;
Dropdown_ProgressBarStyle.value = 0;
Toggle_AutoStart.isOn = true;
Dropdown_DefaultLangauge.value = 0;
InputField_LanguagePack.text = string.Empty;
return;
}
Dropdown_AnimationStyle.value = Dropdown_AnimationStyle.options.FindIndex(option => option.text == appSetting.animationStyle);
Dropdown_ProgressBarStyle.value = Dropdown_ProgressBarStyle.options.FindIndex(option => option.text == appSetting.progressBarStyle);
Toggle_AutoStart.isOn = appSetting.autoStart;
Dropdown_DefaultLangauge.value = Dropdown_DefaultLangauge.options.FindIndex(option => option.text == appSetting.defaultLanauge);
InputField_LanguagePack.text = appSetting.languagePackPath;
if (!string.IsNullOrEmpty(appSetting.splashImageByte))
{
var bytes = Convert.FromBase64String(appSetting.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_Selected.sprite = sprite;
}
Dropdown_AnimationStyle.value = Dropdown_AnimationStyle.options.FindIndex(option => option.text == appSetting.animationStyle);
Dropdown_ProgressBarStyle.value = Dropdown_ProgressBarStyle.options.FindIndex(option => option.text == appSetting.progressBarStyle);
Toggle_AutoStart.isOn = appSetting.autoStart;
Dropdown_DefaultLangauge.value = Dropdown_DefaultLangauge.options.FindIndex(option => option.text == appSetting.defaultLanauge);
InputField_LanguagePack.text = appSetting.languagePackPath;
}
}
}
}

View File

@@ -1,3 +1,4 @@
using Studio.Util;
using System;
using System.Collections.Generic;
using UnityEngine;
@@ -25,7 +26,7 @@ namespace Studio
private UI_FolderPathItem prf_folderPathItem;
private List<UI_FolderPathItem> folderPathItems = new List<UI_FolderPathItem>();
public List<string> selectedURLs = new List<string>();
private List<string> selectedURLs = new List<string>();
public Action onSelectedURLs;
@@ -85,5 +86,36 @@ namespace Studio
}
onSelectedURLs?.Invoke();
}
public AssetManagerData GetAssetManagerData()
{
var assetManagerData = new AssetManagerData();
assetManagerData.localAssetsPaths.AddRange(selectedURLs);
return assetManagerData;
}
public void SetAssetManager(AssetManagerData assetManagerData)
{
selectedURLs.Clear();
foreach(var item in folderPathItems)
{
Destroy(item.gameObject);
}
folderPathItems.Clear();
if (assetManagerData == null)
return;
foreach (var localPath in assetManagerData.localAssetsPaths)
{
var item = Instantiate(prf_folderPathItem, Content_LocalAssets);
item.onEndEditInputFieldURL += LoadAsstsPath;
item.SetData(localPath);
folderPathItems.Add(item);
selectedURLs.Add(item.GetURL());
Button_AddFolderPathItem.transform.SetAsLastSibling();
}
}
}
}

View File

@@ -55,6 +55,15 @@ namespace Studio
}
public void SetMQTTSetting(MQTTSetting mqttSetting)
{
foreach(var item in mqttConnectionItems)
{
Destroy(item.gameObject);
}
mqttConnectionItems.Clear();
if (mqttSetting == null)
return;
foreach (var mqttConnection in mqttSetting.mqttConnections)
{
var item = Instantiate(prf_MQTTConnectionItem, Content);

View File

@@ -53,17 +53,21 @@ namespace Studio.UI
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))
if (!string.IsNullOrEmpty(metaInfo.splashImageByte))
{
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
Image_ProjectMetaInfo.sprite = sprite;
var bytes = Convert.FromBase64String(metaInfo.splashImageByte);
float height = Image_ProjectMetaInfo.rectTransform.rect.height;
float newWidth = Image_ProjectMetaInfo.rectTransform.rect.height / metaInfo.ratio;
Image_ProjectMetaInfo.rectTransform.sizeDelta = new Vector2(newWidth, height);
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);
}
}
}

View File

@@ -28,13 +28,20 @@ namespace Studio
Toggle_SceneStartSetting.onValueChanged.AddListener(OnSceneStartSettingValueChanged);
Button_AddSceneTab.onClick.AddListener(OnClickAddSceneTabButton);
foreach (var sceneTabButton in sceneTabButtons)
{
Destroy(sceneTabButton.gameObject);
}
sceneTabButtons.Clear();
index = 0;
Toggle_SceneStartSetting.isOn = true;
OnClickAddSceneTabButton();
}
private void OnSceneStartSettingValueChanged(bool isOn)
{
Debug.Log(isOn);
onSceneSettingTab?.Invoke(isOn);
}
private void OnClickAddSceneTabButton()

View File

@@ -41,7 +41,12 @@ namespace Studio
if(isOn == false)
{
preSelectedToggle = selectedToggle;
selectedToggle.isOn = isOn;
if (selectedToggle != null)
{
selectedToggle.isOn = isOn;
}
}
else
{

View File

@@ -0,0 +1,61 @@
using System;
using TMPro;
using TriLibCore.SFB;
using UnityEngine;
using UnityEngine.UI;
using XRLib.UI;
namespace Studio
{
public class Panel_TopMenuNewProjectInfo : PanelBase
{
public TMP_InputField InputField_ProjectName;
public TMP_InputField InputField_ProjectRoute;
public Button Button_FileExplorer;
public Button Button_Create;
public Button Button_Cancel;
public Action onClickCreate;
public override void AfterAwake()
{
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
Button_Create.onClick.AddListener(OnClickCreate);
Button_Cancel.onClick.AddListener(Close);
}
private void OnClickFileExplorer()
{
var paths = StandaloneFileBrowser.OpenFolderPanel("Select Folder", "", false);
if (paths.Count > 0 && !string.IsNullOrEmpty(paths[0].Name))
{
InputField_ProjectRoute.text = paths[0].Name;
}
}
private void OnClickCreate()
{
onClickCreate?.Invoke();
}
public void Open()
{
SetActive(true);
}
public void Close()
{
SetActive(false);
}
public string GetProjectName()
{
var name = InputField_ProjectName.text;
return name;
}
public string GetProjectRoute()
{
var route = InputField_ProjectRoute.text;
return route;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 30d2a39cb76a2a6428f6cf8d0348068f

View File

@@ -0,0 +1,56 @@
using System;
using TMPro;
using TriLibCore.SFB;
using UnityEngine;
using UnityEngine.UI;
using XRLib.UI;
namespace Studio
{
public class Panel_TopMenuOpenProjectInfo : PanelBase
{
public TMP_InputField InputField_ProjectName;
public TMP_InputField InputField_ProjectRoute;
public Button Button_FileExplorer;
public Button Button_Open;
public Button Button_Cancel;
public Action onClickOpen;
public override void AfterAwake()
{
Button_FileExplorer.onClick.AddListener(OnClickFileExplorer);
Button_Open.onClick.AddListener(OnClickOpen);
Button_Cancel.onClick.AddListener(Close);
}
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;
}
}
private void OnClickOpen()
{
onClickOpen?.Invoke();
}
public void Open()
{
SetActive(true);
}
public void Close()
{
SetActive(false);
}
public string GetProjectRoute()
{
var route = InputField_ProjectRoute.text;
return route;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7defec43ad8d43745b87a1f6fe4da2f7