add popup ui prefab
This commit is contained in:
60
Assets/Popup_Status.cs
Normal file
60
Assets/Popup_Status.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class Popup_Status : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
|
||||
[SerializeField]
|
||||
List<TMP_Text> keys = new List<TMP_Text>();
|
||||
|
||||
[SerializeField]
|
||||
List<TMP_Text> valuses = new List<TMP_Text>();
|
||||
|
||||
[SerializeField]
|
||||
TMP_Text title;
|
||||
|
||||
void Start()
|
||||
{
|
||||
title.text = "";
|
||||
|
||||
foreach(var key in keys)
|
||||
{
|
||||
key.text = "";
|
||||
}
|
||||
|
||||
foreach(var val in valuses)
|
||||
{
|
||||
val.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetTitle(string title)
|
||||
{
|
||||
this.title.text = title;
|
||||
}
|
||||
public void SetKeyName(List<string> keyNames)
|
||||
{
|
||||
for ( int i = 0; i < keyNames.Count; i++ )
|
||||
{
|
||||
keys[i].text = keyNames[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void UpdateValue(List<string> values)
|
||||
{
|
||||
for (int i = 0; i < values.Count; i++)
|
||||
{
|
||||
valuses[i].text = values[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user