Compare commits
2 Commits
dev/jym/25
...
pgd/202505
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d629af7ee | ||
|
|
7006c70270 |
311
Assets/Resources/Prefabs/UI/PRF_EntityItem.prefab
Normal file
311
Assets/Resources/Prefabs/UI/PRF_EntityItem.prefab
Normal file
@@ -0,0 +1,311 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1410781885430910492
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2490111260065955132}
|
||||
- component: {fileID: 4619594656901260396}
|
||||
- component: {fileID: 3858053886766842753}
|
||||
m_Layer: 5
|
||||
m_Name: PRF_EntityItem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2490111260065955132
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1410781885430910492}
|
||||
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: 6625112702371143276}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 67, y: -25}
|
||||
m_SizeDelta: {x: 134, y: 25}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4619594656901260396
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1410781885430910492}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3858053886766842753
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1410781885430910492}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 13
|
||||
m_fontSizeBase: 13
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &1546915061005647563
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3883938803033704821}
|
||||
- component: {fileID: 4902551005294585158}
|
||||
- component: {fileID: 1916338139708908773}
|
||||
m_Layer: 5
|
||||
m_Name: PRF_EntityItem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3883938803033704821
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1546915061005647563}
|
||||
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: 6625112702371143276}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 211, y: -25}
|
||||
m_SizeDelta: {x: 154, y: 25}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4902551005294585158
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1546915061005647563}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1916338139708908773
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1546915061005647563}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 11
|
||||
m_fontSizeBase: 11
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &7595299807217255251
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6625112702371143276}
|
||||
m_Layer: 5
|
||||
m_Name: PRF_EntityItem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6625112702371143276
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7595299807217255251}
|
||||
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: 2490111260065955132}
|
||||
- {fileID: 3883938803033704821}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 288, y: 25}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
7
Assets/Resources/Prefabs/UI/PRF_EntityItem.prefab.meta
Normal file
7
Assets/Resources/Prefabs/UI/PRF_EntityItem.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5e40c47ed9e07c4ea197197c5778d4f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Collections;
|
||||
using Studio.AssetLibraryTree;
|
||||
using Studio;
|
||||
using System.Drawing.Printing;
|
||||
|
||||
namespace Studio.AssetTool
|
||||
{
|
||||
@@ -119,6 +120,17 @@ namespace Studio.AssetTool
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject CreateAsset(string name)
|
||||
{
|
||||
AssetLibraryItem item = assetScrollView.FindItem("Palletrobot", AssetLibraryItemType.file);
|
||||
|
||||
OnAssetSelected(item);
|
||||
GameObject obj = selectRenderObject.gameObject;
|
||||
OnAssetDropped(item);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
public void OnAssetSelected(AssetLibraryItem item)
|
||||
{
|
||||
if (item == null || item.linkedObject == null)
|
||||
@@ -126,6 +138,7 @@ namespace Studio.AssetTool
|
||||
selectedAssetData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
selectedAssetData = item.linkedObject.GetComponent<CustomAssetData>();
|
||||
if (selectedAssetData == null || selectedAssetData.isLoadComplete == false)
|
||||
{
|
||||
@@ -208,6 +221,7 @@ namespace Studio.AssetTool
|
||||
{
|
||||
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
|
||||
canvas_Popup.panel_objectinfo.gameObject.SetActive(false);
|
||||
canvas_Popup.panel_agv.gameObject.SetActive(false);
|
||||
componentScrollView.DeselectAll();
|
||||
}
|
||||
|
||||
@@ -240,6 +254,8 @@ namespace Studio.AssetTool
|
||||
{
|
||||
var canvas_Popup = EventConnector.instance.GetCanvas<Canvas_Popup>();
|
||||
canvas_Popup.panel_objectinfo.SetObjectInfo(name, selectedObjects);
|
||||
canvas_Popup.panel_objectinfo.SetActive(true);
|
||||
canvas_Popup.panel_agv.SetTarget(selectedObjects);
|
||||
canvas_Popup.panel_objectdistance.SelectObjectFromClick(name, selectedObjects);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Studio.Dynamic.TwinObject
|
||||
Quaternion startRot;
|
||||
Quaternion endRot;
|
||||
|
||||
private Dictionary<string, string> CurrentEntity;
|
||||
public Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private bool isPlay = false;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Studio.Dynamic.TwinObject
|
||||
s += $"{t.Key}: {t.Value},";
|
||||
}
|
||||
s += "}";
|
||||
Debug.Log(s);
|
||||
//Debug.Log(s);
|
||||
SetPos();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using Studio.Dynamic.TwinObject;
|
||||
using Studio.Core;
|
||||
using Studio.Manage;
|
||||
using Studio.AssetTool;
|
||||
|
||||
namespace Studio.Dynamic.M
|
||||
{
|
||||
@@ -14,7 +16,14 @@ namespace Studio.Dynamic.M
|
||||
public float AGVMoveSpeed;
|
||||
public float AGVRotateSpeed;
|
||||
public Queue<Dictionary<string, Dictionary<string, string>>> createAgvs = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MQTT
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public void Init()
|
||||
{
|
||||
prf_AGV = Resources.Load<AGV>("TestAGV");
|
||||
@@ -45,7 +54,8 @@ namespace Studio.Dynamic.M
|
||||
|
||||
private AGV CreateAGV(string type, string id ,Dictionary<string,string> entity)
|
||||
{
|
||||
var agv = Instantiate<AGV>(prf_AGV,transform);
|
||||
var agv = ManagerHub.instance.Get<CustomAssetConnector>().CreateAsset("AGV").AddComponent<AGV>();
|
||||
//var agv = Instantiate<AGV>(prf_AGV,transform);
|
||||
agv.transform.position = Vector3.zero;
|
||||
agv.name = id;
|
||||
agv.SetMoveSpeed(AGVMoveSpeed);
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace Studio
|
||||
public Panel_LoggingModal panel_loggingmodal;
|
||||
public Panel_ExitChecker panel_exitchecker;
|
||||
public Panel_DataRepository panel_datarepository;
|
||||
public Panel_AGV panel_agv;
|
||||
|
||||
public Panel_DataConnectModal panel_dataconnectmodal;
|
||||
public Panel_AlarmConnectModal panel_alarmconnectmodal;
|
||||
|
||||
92
Assets/Scripts/Studio/UI/Panel/Panel_AGV.cs
Normal file
92
Assets/Scripts/Studio/UI/Panel/Panel_AGV.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using Studio.Dynamic.TwinObject;
|
||||
using Studio.Dynamic.M;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using XRLib.UI;
|
||||
using System.Linq;
|
||||
|
||||
namespace Studio.UI
|
||||
{
|
||||
public class Panel_AGV : PanelBase
|
||||
{
|
||||
public GameObject itemPrefab;
|
||||
public RectTransform Content;
|
||||
|
||||
private Dictionary<string, TMP_Text> keyToValueTextMap = new();
|
||||
private bool isInitialized = false;
|
||||
|
||||
private bool itemInit;
|
||||
public Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private string targetId = string.Empty;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
itemPrefab = Resources.Load<GameObject>("Prefabs/UI/PRF_EntityItem");
|
||||
}
|
||||
|
||||
internal void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
if (!itemInit)
|
||||
{
|
||||
InstantiateUI(e.Entity);
|
||||
itemInit = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateUI(e.Entity);
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetTarget(List<GameObject> selectedObjects)
|
||||
{
|
||||
if (selectedObjects.Count == 0)
|
||||
return;
|
||||
|
||||
GameObject selectedObject = selectedObjects[0];
|
||||
|
||||
if (selectedObject.TryGetComponent<AGV>(out AGV agv))
|
||||
{
|
||||
StudioService.instance.RemoveTypeIdListener("AGV", targetId);
|
||||
targetId = agv.name;
|
||||
StudioService.instance.AddTypeIdListener("AGV", targetId, OnUpdateData);
|
||||
SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
void InstantiateUI(Dictionary<string, string> entity)
|
||||
{
|
||||
foreach (var kvp in entity)
|
||||
{
|
||||
GameObject item = Instantiate(itemPrefab, Content);
|
||||
|
||||
var texts = item.GetComponentsInChildren<TMP_Text>();
|
||||
if (texts.Length < 2) continue;
|
||||
|
||||
TMP_Text keyText = texts[0];
|
||||
TMP_Text valueText = texts[1];
|
||||
|
||||
keyText.text = kvp.Key;
|
||||
valueText.text = kvp.Value;
|
||||
|
||||
keyToValueTextMap[kvp.Key] = valueText;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateUI(Dictionary<string, string> entity)
|
||||
{
|
||||
foreach (var kvp in entity)
|
||||
{
|
||||
if (keyToValueTextMap.TryGetValue(kvp.Key, out var valueText))
|
||||
{
|
||||
valueText.text = kvp.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Studio/UI/Panel/Panel_AGV.cs.meta
Normal file
2
Assets/Scripts/Studio/UI/Panel/Panel_AGV.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50cc14a8fa6b2cb44ad7d2426e7e46eb
|
||||
@@ -1,8 +1,11 @@
|
||||
using Studio;
|
||||
using NUnit.Framework;
|
||||
using Studio;
|
||||
using Studio.Auth;
|
||||
using Studio.Conifg;
|
||||
using Studio.Dynamic.M;
|
||||
using Studio.Staic.STKC;
|
||||
using Studio.UI;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -29,7 +32,7 @@ namespace Studio
|
||||
{
|
||||
StudioService.instance.ConnectMQTT(mqtt.domain,mqtt.port,mqtt.topics);
|
||||
}
|
||||
testcrane.Init("STOCKER_CRANE");
|
||||
//testcrane.Init("STOCKER_CRANE");
|
||||
AGVManager.instance.Init();
|
||||
|
||||
}
|
||||
@@ -48,18 +51,14 @@ namespace Studio
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.I))
|
||||
{
|
||||
// StudioService.instance.SubscribeMQTT("STOCKER_CRANE");
|
||||
|
||||
//종료
|
||||
}
|
||||
if(Input.GetKeyDown(KeyCode.U))
|
||||
{
|
||||
//시작
|
||||
TestConeect();
|
||||
// StudioService.instance.SubscribeMQTT("AGV");
|
||||
}
|
||||
if(Input.GetKeyDown(KeyCode.T))
|
||||
{
|
||||
|
||||
TestTask();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task TestTask()
|
||||
|
||||
Reference in New Issue
Block a user