네임스페이스 정리
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Collections;
|
||||
using Studio.AssetLibraryTree;
|
||||
using Studio;
|
||||
using Studio.Core;
|
||||
|
||||
namespace Studio.AssetTool
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ using Ookii.Dialogs;
|
||||
using Studio.Command;
|
||||
using Studio.Manage;
|
||||
using Studio.AssetLibraryTree;
|
||||
using Studio.Core;
|
||||
|
||||
namespace Studio.AssetTool
|
||||
{
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
using Studio;
|
||||
using Studio.AssetTool;
|
||||
using Studio.Command;
|
||||
using Studio.HierarchyTree;
|
||||
using Studio.Manage;
|
||||
using Studio.Services;
|
||||
using Studio.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
namespace Studio.Manage
|
||||
{
|
||||
public class AssetManager : Manager
|
||||
{
|
||||
@@ -25,7 +23,7 @@ namespace Studio
|
||||
var canvas_Popup = CanvasManager.instance.GetCanvas<Canvas_Popup>();
|
||||
var fbxFileManager = ManagerHub.instance.Get<FBXFileManager>();
|
||||
var connector = ManagerHub.instance.Get<CustomAssetConnector>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingService>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingManager>();
|
||||
var projectManager = ManagerHub.instance.Get<ProjectManager>();
|
||||
|
||||
fbxFileManager.onLoadComplete += OnLoadCustomAsset;
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
namespace Studio.Manage
|
||||
{
|
||||
public class ConnectDataManager : MonoBehaviour
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections;
|
||||
using UnityEngine;
|
||||
using Studio.Core;
|
||||
|
||||
namespace Studio
|
||||
namespace Studio.Core
|
||||
{
|
||||
public class CoroutineRunner : UnitySingleton<SystemMain>
|
||||
{
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Studio.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Studio.Test
|
||||
{
|
||||
public class LinkDataUIManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
UI_LinkData prf_LinkDataUI;
|
||||
public Transform body;
|
||||
|
||||
Dictionary<string, UI_LinkData> linkDataDict = new Dictionary<string, UI_LinkData>();
|
||||
|
||||
Dictionary<string, AMR_Class> amrDict = new Dictionary<string, AMR_Class>();
|
||||
Dictionary<string, ASRS_Lifter_Breaked_Class> lifterDict = new Dictionary<string, ASRS_Lifter_Breaked_Class>();
|
||||
Dictionary<string, ASRS_StackerCrane_Class> stackerDict = new Dictionary<string, ASRS_StackerCrane_Class>();
|
||||
Dictionary<string, ASRS_Class> asrsDict = new Dictionary<string, ASRS_Class>();
|
||||
Dictionary<string, Supplier_Breaked_Class> supplierDict = new Dictionary<string, Supplier_Breaked_Class>();
|
||||
Dictionary<string, COBOT_Class> cobotDict = new Dictionary<string, COBOT_Class>();
|
||||
|
||||
public event Action<List<(string, string)>,string> onUISelected;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
var datadistributer = FindAnyObjectByType<DataDistributer>(FindObjectsInactive.Include);
|
||||
datadistributer.onAMRDataReceived += LinkDataUI_AMR;
|
||||
datadistributer.onLifterDataReceived += LinkDataUI_Lifter;
|
||||
datadistributer.onStackerDataReceived += LinkDataUI_StackerCrane;
|
||||
datadistributer.onASRSDataReceived += LinkDataUI_Asrs;
|
||||
datadistributer.onSupplierDataReceived += LinkDataUI_Supplier;
|
||||
datadistributer.onCobotDataReceived += LinkDataUI_Cobot;
|
||||
prf_LinkDataUI = Resources.Load<UI_LinkData>($"Prefabs/UI/{nameof(prf_LinkDataUI)}");
|
||||
}
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void LinkDataUI_AMR(string topic, AMR_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
amrDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
amrDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Lifter(string topic, ASRS_Lifter_Class data)
|
||||
{
|
||||
ASRS_Lifter_Breaked_Class asrs_04_01 = new ASRS_Lifter_Breaked_Class();
|
||||
asrs_04_01.SKID_ON = data.ASRS_04_01_P2A_D_SKID_ON;
|
||||
asrs_04_01.UP_DOWN = data.ASRS_04_01_P2A_UP_DOWN;
|
||||
asrs_04_01.LIFT_STATE = data.ASRS_04_01_P2A_LIFT_STATE;
|
||||
asrs_04_01.SKID_ID = data.ASRS_04_01_P2A_SKID_ID;
|
||||
asrs_04_01.AMR_IN_COMPLETE = data.ASRS_04_01_A2P_AMR_IN_COMPLETE;
|
||||
asrs_04_01.AMR_OUT_COMPLETE = data.ASRS_04_01_A2P_AMR_OUT_COMPLETE;
|
||||
|
||||
ASRS_Lifter_Breaked_Class asrs_14_01 = new ASRS_Lifter_Breaked_Class();
|
||||
asrs_14_01.SKID_ON = data.ASRS_14_01_P2A_D_SKID_ON;
|
||||
asrs_14_01.UP_DOWN = data.ASRS_14_01_P2A_UP_DOWN;
|
||||
asrs_14_01.LIFT_STATE = data.ASRS_14_01_P2A_LIFT_STATE;
|
||||
asrs_14_01.SKID_ID = data.ASRS_14_01_P2A_SKID_ID;
|
||||
asrs_14_01.AMR_IN_COMPLETE = data.ASRS_14_01_A2P_AMR_IN_COMPLETE;
|
||||
asrs_14_01.AMR_OUT_COMPLETE = data.ASRS_14_01_A2P_AMR_OUT_COMPLETE;
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(asrs_04_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(asrs_04_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(asrs_04_01), ui);
|
||||
lifterDict.Add(nameof(asrs_04_01), asrs_04_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
lifterDict[nameof(asrs_04_01)]= asrs_04_01;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(asrs_14_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(asrs_14_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(asrs_14_01), ui);
|
||||
lifterDict.Add(nameof(asrs_14_01), asrs_14_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
lifterDict[nameof(asrs_14_01)] = asrs_14_01;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_StackerCrane(string topic, ASRS_StackerCrane_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
stackerDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
stackerDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Asrs(string topic, ASRS_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
asrsDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
asrsDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Supplier(string topic, Supplier_Class data)
|
||||
{
|
||||
Supplier_Breaked_Class Supplier_06_01 = new Supplier_Breaked_Class();
|
||||
Supplier_06_01.AMR_IN_COMPLETE = data.SUPPLY_06_01_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_01.SKID_ON = data.SUPPLY_06_01_P2A_D_SKID_ON;
|
||||
Supplier_06_01.SKID_ID = data.SUPPLY_06_01_P2A_SKID_ID;
|
||||
|
||||
Supplier_Breaked_Class Supplier_06_02 = new Supplier_Breaked_Class();
|
||||
Supplier_06_02.AMR_IN_COMPLETE = data.SUPPLY_06_02_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_02.SKID_ON = data.SUPPLY_06_02_P2A_D_SKID_ON;
|
||||
Supplier_06_02.SKID_ID = data.SUPPLY_06_02_P2A_SKID_ID;
|
||||
|
||||
Supplier_Breaked_Class Supplier_06_03 = new Supplier_Breaked_Class();
|
||||
Supplier_06_03.AMR_IN_COMPLETE = data.SUPPLY_06_03_A2P_AMR_IN_COMPLETE;
|
||||
Supplier_06_03.SKID_ON = data.SUPPLY_06_03_P2A_D_SKID_ON;
|
||||
Supplier_06_03.SKID_ID = data.SUPPLY_06_03_P2A_SKID_ID;
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_01)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_01));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_01), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_01), Supplier_06_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_01)] = Supplier_06_01;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_02)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_02));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_02), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_02), Supplier_06_02);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_02)] = Supplier_06_02;
|
||||
}
|
||||
|
||||
if (!linkDataDict.ContainsKey(nameof(Supplier_06_03)))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(nameof(Supplier_06_03));
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(nameof(Supplier_06_03), ui);
|
||||
supplierDict.Add(nameof(Supplier_06_03), Supplier_06_03);
|
||||
}
|
||||
else
|
||||
{
|
||||
supplierDict[nameof(Supplier_06_03)] = Supplier_06_03;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkDataUI_Cobot(string topic, COBOT_Class data)
|
||||
{
|
||||
if (!linkDataDict.ContainsKey(topic))
|
||||
{
|
||||
var ui = Instantiate(prf_LinkDataUI, body);
|
||||
ui.SetUI(topic);
|
||||
ui.onUIClicked += findDictionaryByUI;
|
||||
linkDataDict.Add(topic, ui);
|
||||
cobotDict.Add(topic, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
cobotDict[topic] = data;
|
||||
}
|
||||
}
|
||||
|
||||
void findDictionaryByUI(UI_LinkData UI)
|
||||
{
|
||||
var myKey = linkDataDict.FirstOrDefault(x => x.Value == UI).Key;
|
||||
if (amrDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(amrDict[myKey]),myKey);
|
||||
}
|
||||
else if (lifterDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(lifterDict[myKey]), myKey);
|
||||
}
|
||||
else if (stackerDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(stackerDict[myKey]), myKey);
|
||||
}
|
||||
else if (asrsDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(asrsDict[myKey]), myKey);
|
||||
}
|
||||
else if (supplierDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(supplierDict[myKey]), myKey);
|
||||
}
|
||||
else if (cobotDict.ContainsKey(myKey))
|
||||
{
|
||||
onUISelected?.Invoke(PrintAllVariables(cobotDict[myKey]), myKey);
|
||||
}
|
||||
}
|
||||
|
||||
public List<(string,string)> PrintAllVariables(object target)
|
||||
{
|
||||
List<(string, string)> variableList = new List<(string, string)>();
|
||||
|
||||
Type type = target.GetType();
|
||||
|
||||
FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
var value = field.GetValue(target).ToString();
|
||||
var tuple = (field.Name, value);
|
||||
variableList.Add(tuple);
|
||||
}
|
||||
|
||||
return variableList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: beaea798e37c61142a62ba5cecd426f2
|
||||
@@ -4,6 +4,7 @@ using Studio.AssetTool;
|
||||
using Studio.Core;
|
||||
using Studio.Util;
|
||||
using Studio;
|
||||
using Studio.Services;
|
||||
|
||||
namespace Studio.Manage
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace Studio.Manage
|
||||
Join(new AGVNodeLinkManager());
|
||||
Join(new AGVManager());
|
||||
Join(new AssetManager());
|
||||
Join(new SceneStartSettingService());
|
||||
Join(new SceneStartSettingManager());
|
||||
|
||||
foreach(var m in managers)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Linq;
|
||||
using Studio.HierarchyTree;
|
||||
using Studio.Command;
|
||||
using Studio.AssetLibraryTree;
|
||||
using Studio.Services;
|
||||
|
||||
namespace Studio.Manage
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace Studio.Manage
|
||||
var connector = ManagerHub.instance.Get<CustomAssetConnector>();
|
||||
var fbxFileManager = ManagerHub.instance.Get<FBXFileManager>();
|
||||
var assetManager = ManagerHub.instance.Get<AssetManager>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingService>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingManager>();
|
||||
|
||||
var sceneStartSetting = new SceneStartSetting();
|
||||
sceneSettingService.SetSceneStartSetting(sceneStartSetting);
|
||||
@@ -56,7 +57,7 @@ namespace Studio.Manage
|
||||
{
|
||||
var canvas_Popup = CanvasManager.instance.GetCanvas<Canvas_Popup>();
|
||||
var assetManager = ManagerHub.instance.Get<AssetManager>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingService>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingManager>();
|
||||
|
||||
ResetProjectSettingData();
|
||||
|
||||
@@ -83,7 +84,7 @@ namespace Studio.Manage
|
||||
public void OpenProjectSettingsDataAfterDataLoad()
|
||||
{
|
||||
var canvas_Popup = CanvasManager.instance.GetCanvas<Canvas_Popup>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingService>();
|
||||
var sceneSettingService = ManagerHub.instance.Get<SceneStartSettingManager>();
|
||||
|
||||
if (curProjectData != null)
|
||||
{
|
||||
@@ -138,7 +139,7 @@ namespace Studio.Manage
|
||||
}
|
||||
private SceneStartSetting CreateSceneStartSettingData()
|
||||
{
|
||||
var sceneStartSettingService = ManagerHub.instance.Get<SceneStartSettingService>();
|
||||
var sceneStartSettingService = ManagerHub.instance.Get<SceneStartSettingManager>();
|
||||
var sceneStartSetting = sceneStartSettingService.GetSceneStartSettingData();
|
||||
|
||||
return sceneStartSetting;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
namespace Studio.Manage
|
||||
{
|
||||
|
||||
public class QuitManager : MonoBehaviour
|
||||
|
||||
@@ -3,9 +3,9 @@ using Studio.Util;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
namespace Studio.Services
|
||||
{
|
||||
public class SceneStartSettingService : Manager
|
||||
public class SceneStartSettingManager : Manager
|
||||
{
|
||||
public SceneStartSetting sceneStartSetting;
|
||||
|
||||
Reference in New Issue
Block a user