diff --git a/Assets/WorkSpace/LH/LogicData/BubbleUI.cs b/Assets/WorkSpace/LH/LogicData/BubbleUI.cs index 0873d5ca..00c8013b 100644 --- a/Assets/WorkSpace/LH/LogicData/BubbleUI.cs +++ b/Assets/WorkSpace/LH/LogicData/BubbleUI.cs @@ -91,8 +91,8 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } datas = new List { - sourcedata.total_output.ToString(), - sourcedata.total_defects.ToString() + IsFourDecimalPlaces(sourcedata.total_output), + IsFourDecimalPlaces(sourcedata.total_defects) }; detailObject.Set(title,datas); detailObject.GetComponent().position = rt.position + new Vector3(150f, 75f); @@ -131,8 +131,8 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } datas = new List { - processordata.total_input.ToString(), - processordata.total_processed.ToString() + IsFourDecimalPlaces(processordata.total_input), + IsFourDecimalPlaces(processordata.total_processed) }; detailObject.Set(title, datas); detailObject.GetComponent().position = rt.position + new Vector3(150f, 75f); @@ -146,8 +146,8 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } datas = new List { - queuedata.current_length.ToString(), - queuedata.capacity.ToString() + IsFourDecimalPlaces(queuedata.current_length), + IsFourDecimalPlaces(queuedata.capacity) }; detailObject.Set(title, datas); detailObject.GetComponent().position = rt.position + new Vector3(150f, 75f); @@ -161,8 +161,8 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } datas = new List { - storedata.current_length.ToString(), - storedata.capacity.ToString() + IsFourDecimalPlaces(storedata.current_length), + IsFourDecimalPlaces(storedata.capacity) }; detailObject.Set(title, datas); detailObject.GetComponent().position = rt.position + new Vector3(150f, 75f); @@ -176,11 +176,11 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } datas = new List { - resourcedata.requesters.ToString(), - resourcedata.claimers.ToString(), - resourcedata.available.ToString(), - resourcedata.original_capacity.ToString(), - resourcedata.utilization.ToString() + IsFourDecimalPlaces(resourcedata.requesters), + IsFourDecimalPlaces(resourcedata.claimers), + IsFourDecimalPlaces(resourcedata.available), + IsFourDecimalPlaces(resourcedata.original_capacity), + IsFourDecimalPlaces(resourcedata.utilization), }; detailObject.Set(title, datas); detailObject.GetComponent().position = rt.position + new Vector3(150f, 100f); @@ -202,6 +202,18 @@ public class BubbleUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler } } + private string IsFourDecimalPlaces(float value) + { + string numberString = value.ToString(); + int decimalIndex = numberString.IndexOf('.'); + + if (decimalIndex == -1) + { + return numberString; // 소수점이 없는 경우 + } + + return numberString.Length - decimalIndex - 1 >= 4 ? string.Format("{0:N4}", value) : numberString ; + } public void OnPointerEnter(PointerEventData eventData) { if (detailObject) diff --git a/Assets/WorkSpace/LH/Web/WebReceiver.cs b/Assets/WorkSpace/LH/Web/WebReceiver.cs index 71afe980..deb38e4a 100644 --- a/Assets/WorkSpace/LH/Web/WebReceiver.cs +++ b/Assets/WorkSpace/LH/Web/WebReceiver.cs @@ -21,9 +21,9 @@ namespace Octopus.Simulator.Networks onParameterRecived += FindAnyObjectByType().RequestInfo; onParameterRecived += FindAnyObjectByType().RequestInfo; #if UNITY_EDITOR - config.projectId = "40"; + config.projectId = "37"; //config.simulationId = "15"; - config.logicId = "45"; + config.logicId = "42"; WebParameters.config = config; onParameterRecived?.Invoke(); #else