吃饭去咯

This commit is contained in:
林小智丶 2024-12-25 12:02:42 +08:00
parent 859886d8b9
commit 482f53edc7
5 changed files with 2271 additions and 3579 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -26,16 +26,6 @@ public class FreePanelManager : MonoBehaviour
public GameObject EvacuateSurePanel;
//疏散顺序面板
public GameObject EvacuatePanel;
//次级面板
public GameObject minPanel1;
public GameObject minPanel2;
public GameObject minPanel3;
public GameObject minPanel4;
public GameObject minPanel5;
public GameObject minPanel6;
public GameObject minPanel7;
public GameObject minPanel8;
public GameObject minPanel9;
[Header("图像")]
//特殊情况弹窗背景图
public Image TipBg;
@ -83,6 +73,7 @@ public class FreePanelManager : MonoBehaviour
private int itemCount = 1; // 要创建的物体数量
public GameObject itemPrefab; // 子物体的预制件
public GameObject Order2Prefab;//带有次级面板
//public List<>
public JSONReader JSONReader;
#endregion
@ -94,7 +85,7 @@ public class FreePanelManager : MonoBehaviour
public List<string> TaskId = new List<string>();//保存玩家接取的任务
public GameObject OpcPrefab;//职业预制体
public Image OpcImage;//预制体图片
public Text OpcText;//预制体文本内容
public List<Text> OpcNameList=new List<Text>();
#endregion
private static int a = 0;
private static int bb = 5;
@ -248,10 +239,10 @@ public class FreePanelManager : MonoBehaviour
/// </summary>
/// <param name="ID">职业的ID</param>
/// <param name="a">第几个面板(从1开始)</param>
public void OcpNameChoose(int ID)
public void OcpNameChoose(int ID,GameObject item)
{
string str = JSONReader.GetOcpName(ID);
OpcText.text = str;
item.transform.Find("occuname").GetComponent<Text>().text = str;
}
/// <summary>
@ -605,7 +596,7 @@ public class FreePanelManager : MonoBehaviour
for (int i = 0; i < OpcItems.Count; i++)
{
GameObject newItem = Instantiate(OpcPrefab, Item.transform);
OcpNameChoose(int.Parse(OpcItems[i]));
OcpNameChoose(int.Parse(OpcItems[i]),newItem);
newItem.SetActive(true);
LoadAndSetImage(int.Parse(OpcItems[i]));

View File

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Progress : MonoBehaviour
{
public Image targetImage; // 要控制的图片
public float fillDuration = 1f; // 填充完成所需的时间(秒)
void Start()
{
StartCoroutine(FillImage(targetImage, fillDuration));
}
private IEnumerator FillImage(Image image, float duration)
{
float elapsed = 0f; // 计时器
image.fillAmount = 0f; //强制为0
while (elapsed < duration)
{
elapsed += Time.deltaTime; // 累加帧间隔时间
image.fillAmount = Mathf.Clamp01(elapsed / duration); // 根据时间计算填充量
yield return null; // 等待下一帧
}
image.fillAmount = 1f; // 确保填充值最终为1
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 15e39c366976d6e488de948bc01e4213
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: