정합성/ui
This commit is contained in:
@@ -6,4 +6,9 @@ public class SimulationModelProduct : SimulationModel
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void SetBubble(object data)
|
||||
{
|
||||
Debug.Log(data.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user