LoadProjectCommand 삭제
This commit is contained in:
@@ -21,7 +21,6 @@ namespace Studio.AssetTool
|
||||
public AssetLibraryPooledScrollView assetScrollView;
|
||||
public AssetLibraryScrollRect assetScrollRect;
|
||||
public HierarchyPooledScrollView componentScrollView;
|
||||
public HierarchyPooledScrollView InterworkingDataScrollView;
|
||||
public Panel_ObjectDistance panel_ObjectDistance;
|
||||
public GameObject renderObjectPrefab;
|
||||
public float objectShowDistance = 1000.0f;
|
||||
@@ -36,12 +35,8 @@ namespace Studio.AssetTool
|
||||
public System.Action onRemoveObjects;
|
||||
public System.Action onAssetDropped;
|
||||
|
||||
public CustomAssetEventHandler assetEventHandler;
|
||||
public SceneDataContainer sceneDataContainer;
|
||||
public CustomAssetConnector()
|
||||
{
|
||||
assetEventHandler = new CustomAssetEventHandler();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
//interferedObjectManager = ManagerHub.instance.Get<InterferedObjectManager>();
|
||||
@@ -52,7 +47,7 @@ namespace Studio.AssetTool
|
||||
assetScrollView = EventConnector.instance.GetCanvas<Canvas_Popup>().panel_assetlibrary.scrollView;
|
||||
componentScrollView = EventConnector.instance.GetCanvas<Canvas_Popup>().panel_hierarchy.scrollView;
|
||||
panel_ObjectDistance = EventConnector.instance.GetCanvas<Canvas_Popup>().panel_objectdistance;
|
||||
InterworkingDataScrollView = EventConnector.instance.GetCanvas<Canvas_Popup>().panel_interworkingdatalist.scrollView;
|
||||
//InterworkingDataScrollView = EventConnector.instance.GetCanvas<Canvas_Popup>().panel_interworkingdatalist.scrollView;
|
||||
|
||||
assetScrollRect.onDragBegin.AddListener(OnAssetSelected);
|
||||
assetScrollRect.onDragAndDrop.AddListener(OnAssetDropped);
|
||||
@@ -177,8 +172,8 @@ namespace Studio.AssetTool
|
||||
}
|
||||
selectRenderObject.Deselect();
|
||||
selectedAssetData = null;
|
||||
Debug.Log($"On Asset Dropped {item.name}");
|
||||
onAssetDropped?.Invoke();
|
||||
Debug.Log($"On Asset Dropped {item.name}");
|
||||
}
|
||||
|
||||
public void OnParentChanged(HierarchyItem parentItem, HierarchyItem childItem)
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using TriLibCore.SFB;
|
||||
using Studio.AssetTool;
|
||||
using Studio.HierarchyTree;
|
||||
using Studio.Manage;
|
||||
using Studio.Util;
|
||||
|
||||
namespace Studio.Command
|
||||
{
|
||||
public class LoadProjectCommand : IIrreversibleCommand
|
||||
{
|
||||
private CustomAssetConnector connector;
|
||||
private Dictionary<int, HierarchyItem> itemDict = new Dictionary<int, HierarchyItem>();
|
||||
|
||||
public LoadProjectCommand()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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>();
|
||||
projectManager.LoadSceneSettingData();
|
||||
|
||||
//connector = ManagerHub.instance.Get<CustomAssetConnector>();
|
||||
//var projectManager = ManagerHub.instance.Get<ProjectManager>();
|
||||
|
||||
//List<AssetData> assets = projectManager.curProjectData.assetDatas;
|
||||
|
||||
//string path = GetOpenFilePath();
|
||||
|
||||
//if (string.IsNullOrEmpty(path))
|
||||
// return;
|
||||
|
||||
//ProjectData projectData = GetFileData(path);
|
||||
|
||||
//if (projectData == null)
|
||||
// return;
|
||||
|
||||
//CommandInvoker.instance.Invoke(new RemoveAllObjectCommand());
|
||||
|
||||
//foreach (AssetData asset in assets)
|
||||
//{
|
||||
// LoadAsset(asset);
|
||||
//}
|
||||
|
||||
//foreach (AssetData asset in assets)
|
||||
//{
|
||||
// RestoreHierarchy(asset);
|
||||
//}
|
||||
|
||||
//projectManager.curProjectPath = path;
|
||||
//projectManager.curProjectData = projectData;
|
||||
}
|
||||
|
||||
private string GetOpenFilePath()
|
||||
{
|
||||
var data = StandaloneFileBrowser.OpenFilePanel("OpenProject", "", "json", false);
|
||||
return data.Count >= 1 ? data[0].Name : "";
|
||||
}
|
||||
|
||||
private ProjectData GetFileData(string path)
|
||||
{
|
||||
string json = File.ReadAllText(path);
|
||||
return JsonConvert.DeserializeObject<ProjectData>(json);
|
||||
}
|
||||
|
||||
private void LoadAsset(AssetData asset)
|
||||
{
|
||||
connector.OnLoadAsset(asset);
|
||||
itemDict.Add(asset.id, connector.connectedAssets.Last().hierarchyItem);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58dff3fed88a2eb4fab1bc8116f0c170
|
||||
Reference in New Issue
Block a user