정합성/ui

This commit is contained in:
2025-07-15 17:35:53 +09:00
parent 4c33c97ad1
commit ddacb54484
32 changed files with 5234 additions and 2783 deletions

View File

@@ -6,4 +6,9 @@ public class SimulationModelProduct : SimulationModel
{
throw new System.NotImplementedException();
}
public override void SetBubble(object data)
{
Debug.Log(data.ToString());
}
}

View File

@@ -20,6 +20,7 @@ public class ResourceStatus
public int claimers;
public int available;
public int capacity;
public int original_capacity;
public float utilization;
public float occupancy;
public int broken_units;
@@ -45,6 +46,7 @@ public class SimulationModelResource : SimulationModel
private void Message_Status_Updted(ResourceStatus data)
{
this.currentStatus = data;
SetBubble($"{data.claimers}/{data.original_capacity}");
}
public override void GetData(string data)
@@ -66,8 +68,21 @@ public class SimulationModelResource : SimulationModel
default:
return;
}
}
public override void SetBubble(object data)
{
string msg = data.ToString();
if (currentBubble == null)
{
// 생성
currentBubble = Instantiate(bubbleUIPrefab, FindAnyObjectByType<Canvas_Bubble>().transform);
currentBubble.target = DataBubbleSocket;
currentBubble.worldOffset = new Vector3(0, 2.0f, 0); // 필요에 따라 조절
}
// 텍스트 갱신
currentBubble.SetMessage(msg);
}
}