_xiaofang/xiaofang/Assets/Script/UI/ZZZZZZ/ZZUIManager.cs

1358 lines
35 KiB
C#
Raw Normal View History

2024-12-11 14:37:42 +08:00
using DG.Tweening;
using JetBrains.Annotations;
2024-12-11 14:37:42 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
2024-12-28 23:53:11 +08:00
using System.Xml.Linq;
using Unity.VisualScripting;
2024-12-11 14:37:42 +08:00
using UnityEngine;
using UnityEngine.UI;
public class ZZUIManager : MonoBehaviour
{
[Header("<22><><EFBFBD><EFBFBD>")]
2024-12-28 18:03:41 +08:00
///// <summary>
///// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD>ұ߿<D2B1>
///// </summary>
//public GameObject Right_Box;
2024-12-28 23:53:11 +08:00
public GameObject Commend1;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><>ָ<EFBFBD>ӿ<EFBFBD>
/// </summary>
public GameObject Warn_Tip;
/// <summary>
/// ѧ<><D1A7><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>
/// </summary>
public GameObject Right_Situation;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
/// </summary>
public GameObject DiaLogBox;
/// <summary>
/// <20><>¥<EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>ѡ<EFBFBD><D1A1>
/// </summary>
public GameObject DiaLogBox2;
/// <summary>
/// <20>Ѿ<EFBFBD><D1BE><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public GameObject Right_Message;
/// <summary>
/// Ϊ<>ܰ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>
/// </summary>
public GameObject Right_Message2;
2024-12-28 16:38:41 +08:00
///// <summary>
///// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///// </summary>
//public Dropdown dropdwn;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ѡ<EFBFBD><D1A1>
/// </summary>
public ToggleGroup Tip123;
/// <summary>
/// <20><>ͼ<EFBFBD>ϵ<EFBFBD><CFB5>ĸ<EFBFBD><C4B8><EFBFBD>
/// </summary>
public GameObject MapTapPanel;
/// <summary>
/// <20><>ɢ<EFBFBD><C9A2>ʾ
/// </summary>
public GameObject Command02;
//<2F>ұ߿<D2B1><DFBF>򴴽<EFBFBD><F2B4B4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>
public GameObject content;
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
public GameObject TextPrefab;
//<2F><>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public GameObject content2;
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
public GameObject TextPrefab2;
/// <summary>
/// <20><>ʾ<EFBFBD><CABE>ɢʱ<C9A2><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public GameObject TipPanel;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
/// </summary>
public GameObject TipTilte;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD>¥<EFBFBD><C2A5>
/// </summary>
[Header("<22><>ť")]
public Button Icn_Stairway_1;
public Button Icn_Stairway_2;
public Button Icn_Stairway_3;
2024-12-28 23:53:11 +08:00
public Button Icn_Stairway_4;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><>ɢ˳<C9A2><CBB3>
/// </summary>
public Button Warn;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>
/// </summary>
public Button Flee;
/// <summary>
/// <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>һ<EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>
/// </summary>
public Button Die;
/// <summary>
/// <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>Ķ<EFBFBD><C4B6>ŵ<EFBFBD><C5B5><EFBFBD>
/// </summary>
public Button Phone;
/// <summary>
/// <20><>ͼF4
/// </summary>
public Button TP_1;
public Button TP_2;
public Button TP_3;
public Button TP_4;
2024-12-28 18:03:41 +08:00
///// <summary>
///// <20>Խ<EFBFBD><D4BD><EFBFBD>
///// </summary>
//public Button Intercom;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ȷ<EFBFBD><C8B7>
/// </summary>
public Button DialogboxSure;
/// <summary>
/// <20>ݶӶ<DDB6><D3B6><EFBFBD>ѡ<EFBFBD><D1A1>AB
/// </summary>
public Button Dialogbox2A;
public Button Dialogbox2B;
/// <summary>
/// <20>ݶ<EFBFBD>ѡ<EFBFBD><D1A1>ȷ<EFBFBD><C8B7>
/// </summary>
public Button Dialogbox2Sure;
/// <summary>
/// <20>Ӽ<EFBFBD><D3BC><EFBFBD>
/// </summary>
public Button Minus;
public Button Plus;
/// <summary>
/// <20>ϱ<EFBFBD><CFB1><EFBFBD>ť
/// </summary>
public Button Sumbit;
public Button Sumbit2;
/// <summary>
/// ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㰴ť
/// </summary>
public Button FireButton;
/// <summary>
/// <20>ұߵĿ<DFB5>
/// </summary>
2024-12-28 18:03:41 +08:00
//public Button Right_BoxButton;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-11 14:37:42 +08:00
public Button Close1;
public Button Close2;
public GameObject Close1Panel;
public GameObject FreePanel;
2024-12-11 14:37:42 +08:00
/// <summary>
/// ¥<>ݿ<EFBFBD>
/// </summary>
2024-12-11 14:37:42 +08:00
[Header("<22>ı<EFBFBD>")]
public Text icn_stairway_text_1;
public Text icn_stairway_text_2;
public Text icn_stairway_text_3;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20>ұ߿<D2B1><DFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public Text Tip_1;
public Text Tip_2;
2024-12-11 14:37:42 +08:00
public Text Tip_3;
public Text Tip_4;
/// <summary>
/// <20>ֳ<EFBFBD><D6B3><EFBFBD>ָ<EFBFBD><D6B8>
/// </summary>
public Text Head_Text;
/// <summary>
/// <20><>ָ<EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD>
/// </summary>
public Text WarnTip_Text;
/// <summary>
/// <20><>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
/// </summary>
public Text Situation_Tip_1;
public Text Situation_Tip_2;
public Text Situation_Tip_3;
public Text Situation_Tip_4;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ABC
/// </summary>
public Text LeftText1;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public Text RightText1;
/// <summary>
/// ¥<><C2A5><EFBFBD>ݶӽ<DDB6><D3BD><EFBFBD>
/// </summary>
public Text LeftLT_Text1;
public Text RightLT_Text1;
/// <summary>
/// <20>ݶӽ<DDB6><D3BD><EFBFBD>
/// </summary>
public Text LeftLT_Text2;
public Text RightLT_Text;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public Text Right_MessageText;
/// <summary>
/// ѧ<><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public InputField Student_Number;
/// <summary>
/// δ<><CEB4><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public Text NO_Left_MessageText;
public Text NO_Right_MessageText;
/// <summary>
/// δ<><CEB4><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public Text NO_Student;
/// <summary>
/// ʱ<><CAB1><EFBFBD>ı<EFBFBD>
/// </summary>
public Text TimeText;
2024-12-28 18:03:41 +08:00
///// <summary>
///// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-><3E><>
///// </summary>
//public Text PropText1;
//public Text PropText2;
//public Text PropText3;
//public Text PropText4;
//public Text PropText5;
//public Text PropText6;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>
/// </summary>
2024-12-28 18:03:41 +08:00
//public Text WLYC;
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
/// </summary>
public Text TileText;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>㰴ť<E3B0B4>ı<EFBFBD>
/// </summary>
2024-12-11 14:37:42 +08:00
public Text FireText;
/// <summary>
/// <20><>ʾ<EFBFBD><CABE>ɢʱ<C9A2><CAB1><EFBFBD>ı<EFBFBD>
/// </summary>
public Text TipText;
/// <summary>
/// Σ<><CEA3><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ť<EFBFBD>ı<EFBFBD>
/// </summary>
public Text WartipText;
/// <summary>
/// <20><>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ı<EFBFBD>
/// </summary>
public Text MessageText;
public Text MessageText2;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
/// </summary>
public Text Area;
public Text NPCName;
2024-12-17 14:08:52 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>Ϣ
/// </summary>
public Text DiaLogBoxTitle;
2024-12-11 14:37:42 +08:00
public Sprite Image1;
public Sprite Image2;
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>
2024-12-11 14:37:42 +08:00
//<2F><>ʱ<EFBFBD><CAB1>
private float timeElapsed = 0f;
public float fadeInDuration = 1f; // <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
public float fadeOutDuration = 1f; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
public float displayDuration = 2f; // 2<><32><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD>
private bool isFadingIn = true;
private bool isFadingOut = false;
// ָʾ<D6B8>ı<EFBFBD><C4B1><EFBFBD>ǰ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD>򵭳<EFBFBD>
private bool isFading = false;
// <20><><EFBFBD><EFBFBD><EFBFBD>еĵ<D0B5><C4B5><EFBFBD><EBB5AD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
private Coroutine fadeCoroutine;
//<2F><><EFBFBD><EFBFBD><EBB5AD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
private float elapsedTime = 0f;
#endregion
#region ͼ<EFBFBD>Ч
////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//private float ContinueTime = 100000000000f;
////<2F><>¼
//private float tempTime = 0f;
//<2F><>̾<EFBFBD><CCBE>
[Header("ͼƬ")]
//<2F><>ʾ<EFBFBD><CABE>ɢʱ<C9A2><CAB1><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ͼ
public Image TipBg;
public Image HeadImage;
public Image Bg;
//<2F>ұ<EFBFBD>
public Image Bg1;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
private bool isEnd;
public JSONReader jsonReader;
#endregion
#region ʵ<EFBFBD>ֳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public GameObject content3; // Scroll View <20><> Content <20><><EFBFBD><EFBFBD>
public GridLayoutGroup gridLayoutGroup2; // Grid Layout Group <20><><EFBFBD><EFBFBD>
public GameObject itemPrefab; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>Ƽ<EFBFBD>
public ToggleGroup toggleGroup;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Text itemPrefabTextLeft;//<2F><><EFBFBD><EFBFBD>
public Text itemPrefabTextRight;//<2F><><EFBFBD><EFBFBD>
2024-12-18 23:13:30 +08:00
public int itemCount = 2; // Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
List<GameObject> createdItems = new List<GameObject>();//<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>б<EFBFBD>
int ToggleCount = 0;
#endregion
2024-12-11 14:37:42 +08:00
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public RectTransform panelA;
public float panelAMoveDistance;
2024-12-11 14:37:42 +08:00
public float moveDuration = 0.5f; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
2024-12-28 18:03:41 +08:00
//public RectTransform buttonRect; // <20><><EFBFBD>İ<EFBFBD>ť RectTransform
public bool isHidden = true;
2024-12-11 14:37:42 +08:00
public float showPositionX;
public float hidePositionX;
#endregion
//<2F><>¼
int num = 0;
2024-12-28 23:53:11 +08:00
// public Image bg;
2024-12-28 23:53:11 +08:00
public bool isFrist = false;
public Button luxianSure;
public Text luxianSureText;
2024-12-28 16:38:41 +08:00
#region <EFBFBD><EFBFBD>ɢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public GridLayoutGroup gridLayoutGroup;
private List<Text> textFields = new List<Text>();
#endregion
2024-12-11 14:37:42 +08:00
2024-12-18 23:13:30 +08:00
public static ZZUIManager instert;
2024-12-28 23:53:11 +08:00
public bool isluxian = false;
public static int louhao;//<2F>жϼǺ<CFBC>¥
public string TempNPC;
2024-12-29 16:31:33 +08:00
public List<Vector3> NPCdian;
2024-12-28 23:53:11 +08:00
public int ID = 0;
2024-12-11 14:37:42 +08:00
public void Awake()
{
isHidden = true;
instert = this;
2024-12-27 23:12:22 +08:00
//TimeText.text = "00.00";
2024-12-11 14:37:42 +08:00
num = 0;
}
private void Start()
{
//<2F><><EFBFBD><EFBFBD>
2024-12-28 23:53:11 +08:00
//Frist();
//FixWarn(1,jsonReader.SetUIText(50102));
//string str = jsonReader.SetUIText(50102);
//Debug.Log(jsonReader.SetUIText(50102));
//Debug.Log(str);
2024-12-28 23:53:11 +08:00
// GcreationSelect(1000);
2024-12-18 23:13:30 +08:00
InitializeFlee(10813);
//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-11 14:37:42 +08:00
hidePositionX = 337f;
showPositionX = 1.159973f;
panelAMoveDistance = 382f;
2024-12-29 10:43:52 +08:00
if(ReadRoom.instance.iszongzhihui)
{
Commend1.SetActive(true);
}
#region 11
2024-12-28 23:53:11 +08:00
Icn_Stairway_1.onClick.AddListener(() =>
{
louhao = 2;
luxianSureText.color = new Color(255, 255, 255);
});
Icn_Stairway_2.onClick.AddListener(() =>
{
louhao = 3;
luxianSureText.color = new Color(255, 255, 255);
});
Icn_Stairway_3.onClick.AddListener(() =>
{
louhao = 4;
luxianSureText.color = new Color(255, 255, 255);
});
Icn_Stairway_4.onClick.AddListener(() =>
{
louhao = 5;
luxianSureText.color = new Color(255, 255, 255);
});
#endregion
2024-12-28 23:53:11 +08:00
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Intercom.onClick.AddListener(() =>
//{
//});
2024-12-11 14:37:42 +08:00
//<2F>ұ߿<D2B1><DFBF>򵯳<EFBFBD><F2B5AFB3><EFBFBD>
2024-12-28 18:03:41 +08:00
//Right_BoxButton.onClick.AddListener(() =>
//{
// OnClickHideButton();
//});
2024-12-11 14:37:42 +08:00
#region <EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>(<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD>)
TP_1.onClick.AddListener(() =>
{
MapTP(1);
});
TP_2.onClick.AddListener(() =>
{
MapTP(2);
});
TP_3.onClick.AddListener(() =>
{
MapTP(3);
});
TP_4.onClick.AddListener(() =>
{
MapTP(4);
});
#endregion
//<2F>ر<EFBFBD><D8B1><EFBFBD>ָ<EFBFBD>ӿ<EFBFBD>
if (Warn_Tip.activeSelf && (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2)))
2024-12-11 14:37:42 +08:00
{
Warn_Tip.SetActive(false);
2024-12-28 23:53:11 +08:00
////
//foreach (var npcDict in NPCController.instance.npcsList)
//{
// foreach (var kvp in npcDict)
// {
// RecuseNpc npc = kvp.Key; // <20><>ȡ NPC <20>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Vector3 position = kvp.Value; // <20><>ȡ NPC <20><>λ<EFBFBD>ã<EFBFBD>ֵ<EFBFBD><D6B5>
// //if (npcData.UserId == npc.npcId)
// //{
// // npc.SetNpcDes(v);
// // Debug.Log($"NPCID{npcData.UserId}NPCPOSITION{v}");
// //}
// }
//}
2024-12-11 14:37:42 +08:00
}
2024-12-18 23:13:30 +08:00
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļӼ<C4BC>
2024-12-11 14:37:42 +08:00
Minus.onClick.AddListener(() =>
{
int currentValue = int.Parse(Student_Number.text);
// <20><><EFBFBD><EFBFBD>1
currentValue--;
// <20><><EFBFBD><EFBFBD> InputField <20><><EFBFBD>ı<EFBFBD>
Student_Number.text = currentValue.ToString();
});
Plus.onClick.AddListener(() =>
{
int currentValue = int.Parse(Student_Number.text);
// <20><><EFBFBD><EFBFBD>1
currentValue++;
// <20><><EFBFBD><EFBFBD> InputField <20><><EFBFBD>ı<EFBFBD>
Student_Number.text = currentValue.ToString();
});
//<2F>򿪶<EFBFBD><F2BFAAB6><EFBFBD>
Flee.onClick.AddListener(() =>
{
2024-12-28 16:38:41 +08:00
if (!isFrist)
{
DiaLogBox2.SetActive(true);
Close1Panel.SetActive(true);
}
else
{
Frist();
}
2024-12-11 14:37:42 +08:00
});
Close1.onClick.AddListener(() => { Close(); });
Close2.onClick.AddListener(() => { Close(); });
//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>(<28><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>)
2024-12-28 16:38:41 +08:00
//dropdwn.onValueChanged.AddListener(delegate
//{
// DropdownValueChanged(dropdwn);
//});
////Ĭ<>Ͽ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD>Ĭ<EFBFBD>ϵ<EFBFBD>һ<EFBFBD><D2BB>ѡ<EFBFBD><D1A1>һ<EFBFBD><D2BB>
//DropdownValueChanged(dropdwn);
2024-12-11 14:37:42 +08:00
//<2F>ұ߿<D2B1><DFBF><EFBFBD> <20>ϱ<EFBFBD><CFB1><EFBFBD>ָ (<28>Ѿ<EFBFBD><D1BE><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
Sumbit.onClick.AddListener(() =>
{
SumbitButton();
});
//<2F>ұ߿<D2B1><DFBF><EFBFBD> <20>ϱ<EFBFBD><CFB1><EFBFBD>ָ (δ<><CEB4>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
Sumbit2.onClick.AddListener(() =>
{
Sumbit2Button();
});
//<2F><><EFBFBD><EFBFBD><EBB7BD>ȷ<EFBFBD><C8B7>
DialogboxSure.onClick.AddListener(() =>
{
2024-12-28 23:53:11 +08:00
SplitData(TempNPC);
for(int i=0;i<NPCdian.Count;i++)
{
Debug.LogError(NPCdian[i]);
}
2024-12-11 14:37:42 +08:00
DiaLogBox.SetActive(false);
});
//<2F>ݶ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Dialogbox2A.onClick.AddListener(() =>
{
num = 1;
});
Dialogbox2B.onClick.AddListener(() =>
{
num = 2;
});
//<2F>ݶӶ<DDB6><D3B6><EFBFBD>ȷ<EFBFBD><C8B7>
Dialogbox2Sure.onClick.AddListener(() =>
{
if (num == 1)
2024-12-11 14:37:42 +08:00
{
num = 0;
DiaLogBox2.SetActive(false);
}
if (num == 2)
2024-12-11 14:37:42 +08:00
{
num = 0;
DiaLogBox2.SetActive(false);
}
});
FireButton.onClick.AddListener(() =>
{
FireText.color = new Color(0.75f, 0.75f, 0.75f);
});
//<2F><>ɢ˳<C9A2><CBB3><EFBFBD><EFBFBD>ť
Warn.onClick.AddListener(() =>
{
WarnPanel();
});
2024-12-28 23:53:11 +08:00
luxianSure.onClick.AddListener(() =>
{
isluxian = true;
Commend1.SetActive(false);
});
2024-12-11 14:37:42 +08:00
#region <EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>Ч
Number(NO_Student);
#endregion
2024-12-11 14:37:42 +08:00
}
private void Update()
{
2024-12-28 23:53:11 +08:00
if (isluxian)
{
isluxian = false;
StartCoroutine(WaitOneSecondCoroutine());
}
}
2024-12-28 23:53:11 +08:00
/// <summary>
/// һ<><D2BB><EFBFBD>򵥵<EFBFBD>Э<EFBFBD>̣<EFBFBD><CCA3>ȴ<EFBFBD>xxxxxxxxx<78><78><EFBFBD><EFBFBD>ִ<EFBFBD>д<EFBFBD><D0B4><EFBFBD>
/// </summary>
private IEnumerator WaitOneSecondCoroutine()
{
yield return new WaitForSeconds(1.4f);
WarnPanel();
}
2024-12-18 23:13:30 +08:00
/// <summary>
/// <20><><EFBFBD>嶯Чʵ<D0A7><CAB5>
/// </summary>
/// <param name="num"><3E><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD></param>
public void Number(Text num)
{
StartCoroutine(Num(num));
}
2024-12-18 23:13:30 +08:00
/// <summary>
/// <20><><EFBFBD>嶯Ч<E5B6AF><D0A7>Я<EFBFBD><D0AF>
/// </summary>
/// <param name="num"><3E>ı<EFBFBD><C4B1><EFBFBD>Ϣ</param>
/// <returns></returns>
IEnumerator Num(Text num)
{
while (true)
{
num.fontSize = 42;
yield return new WaitForSeconds(0.5f);
num.fontSize = 35;
yield return new WaitForSeconds(0.1f);
num.fontSize = 30;
yield return new WaitForSeconds(0.3f);
}
}
/// <summary>
/// <20><>һ<EFBFBD>ε<EFBFBD><CEB5><EFBFBD>¥<EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>
/// </summary>
public void Frist()
{
2024-12-28 23:53:11 +08:00
isFrist = true;
DiaLogBox2?.SetActive(true);
Close1Panel.SetActive(false);
FreePanel.SetActive(true);
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
/// <param name="str"><3E>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD></param>
public void CreateSituation(string str)
{
GameObject newText = Instantiate(TextPrefab2);
newText.transform.SetParent(content2.transform, false);
Text text = newText.GetComponentInChildren<Text>();
text.text = str;
// <20><><EFBFBD>հ<D5B0><E0BCB6><EFBFBD><EFBFBD>
initialized();
}
#region <EFBFBD><EFBFBD>ɢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>
//<2F><><EFBFBD>ݳ<EFBFBD>ʼ<EFBFBD><CABC>
public void initialized()
{
foreach (Transform child in gridLayoutGroup.transform)
{
// <20><>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
textFields.Clear();
Text textComponent = child.GetComponent<Text>();
if (textComponent != null)
{
textFields.Add(textComponent);
}
// <20><><EFBFBD>հ<D5B0><E0BCB6><EFBFBD><EFBFBD>
SortByClass();
}
2024-12-11 14:37:42 +08:00
}
// <20><><EFBFBD>հ<D5B0><E0BCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public void SortByClass()
{
// <20><><EFBFBD><EFBFBD>֮ǰ<D6AE>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><E0BCB6><EFBFBD><EFBFBD>
textFields = textFields.OrderBy(t => ParseClassNumber(t.text)).ToList();
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD>GridLayoutGroup <20><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i = 0; i < textFields.Count; i++)
{
textFields[i].transform.SetSiblingIndex(i); // <20><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
}
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD> "4-1<><31>" <20><>Ϊ 4-1
int ParseClassNumber(string classText)
{
// ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> "4-1" <20>İ༶<C4B0><E0BCB6>
Match match = Regex.Match(classText, @"(\d+)-(\d+)");
if (match.Success)
{
int part1 = int.Parse(match.Groups[1].Value); // <20><>ȡ<EFBFBD><C8A1>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int part2 = int.Parse(match.Groups[2].Value); // <20><>ȡ<EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return part1 * 100 + part2; // <20><><EFBFBD>غϳ<D8BA><CFB3><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
Debug.LogError($"<22>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0BCB6>: {classText}");
return 0; // Ĭ<>Ϸ<EFBFBD><CFB7><EFBFBD> 0<><30><EFBFBD><EFBFBD>ʾ<EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>
}
#endregion
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-28 18:03:41 +08:00
//public void OnClickHideButton()
//{
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD><D8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
// if (isHidden)
// {
// // <20>ָ<EFBFBD><D6B8><EFBFBD>ť<EFBFBD><C5A5>ԭλ<D4AD><CEBB>
// buttonRect.DOAnchorPosX(showPositionX, moveDuration).SetEase(Ease.InOutCubic);
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE>ã<EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
// panelA.DOAnchorPosX(-panelAMoveDistance, moveDuration).SetEase(Ease.InOutCubic); // <20><><EFBFBD><EFBFBD>Aͬʱ<CDAC>ƶ<EFBFBD>
// bg.transform.Rotate(0, 0, 180f);
// isHidden = false; // <20><><EFBFBD><EFBFBD>״̬Ϊδ<CEAA><CEB4><EFBFBD><EFBFBD>
// }
// else
// {
// // <20><><EFBFBD>ذ<EFBFBD>ť
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD>A<EFBFBD>ָ<EFBFBD>ԭλ
// buttonRect.DOAnchorPosX(hidePositionX, moveDuration).SetEase(Ease.InOutCubic);
// panelA.DOAnchorPosX(-45f, moveDuration).SetEase(Ease.InOutCubic); // <20><><EFBFBD><EFBFBD>A<EFBFBD>ָ<EFBFBD>ԭλ
// bg.transform.Rotate(0, 0, 180f);
// isHidden = true; // <20><><EFBFBD><EFBFBD>״̬Ϊ<CCAC><CEAA><EFBFBD><EFBFBD>
// }
//}
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫִ<D2AA>е<EFBFBD>
/// </summary>
/// <param name="a"><3E><><EFBFBD><EFBFBD>-><3E><></param>
2024-12-28 23:53:11 +08:00
//public void Prop(int a)
//{
// switch (a)
// {
// case 1:
// break;
// case 2:
// break;
// case 3:
// break;
// case 4:
// break;
// case 5:
// break;
// case 6:
// break;
2024-12-11 14:37:42 +08:00
2024-12-28 23:53:11 +08:00
// }
//}
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><>ͼ<EFBFBD>ص<EFBFBD>
/// </summary>
/// <param name="a">1-<2D>ٳ<EFBFBD> 2-<2D><><EFBFBD><EFBFBD> 3-<2D><><EFBFBD><EFBFBD> 4-¥<><C2A5></param>
public void MapTP(int a)
{
switch (a)
2024-12-11 14:37:42 +08:00
{
case 1:
FireText.color = new Color(1f, 1f, 1f);
2024-12-11 14:37:42 +08:00
TileText.text = "<22><>ѡ<EFBFBD><D1A1><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2>¥<EFBFBD><C2A5>";
break;
case 2:
FireText.color = new Color(1f, 1f, 1f);
2024-12-11 14:37:42 +08:00
TileText.text = "<22><>ѡ<EFBFBD><D1A1><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2>¥<EFBFBD><C2A5>";
break;
case 3:
FireText.color = new Color(1f, 1f, 1f);
2024-12-11 14:37:42 +08:00
TileText.text = "<22><>ѡ<EFBFBD><D1A1><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2>¥<EFBFBD><C2A5>";
break;
case 4:
FireText.color = new Color(1f, 1f, 1f);
2024-12-11 14:37:42 +08:00
TileText.text = "<22><>ѡ<EFBFBD><D1A1><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2>¥<EFBFBD><C2A5>";
break;
}
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5>¼<EFBFBD>
/// </summary>
/// <param name="change"></param>
2024-12-28 23:53:11 +08:00
//void DropdownValueChanged(Dropdown change)
//{
// int index = change.value;
// switch (index)
// {
// case 0:
// // ִ<><D6B4> Option 1 <20><><EFBFBD>ص<EFBFBD><D8B5>¼<EFBFBD>
// Debug.Log("Option 1 selected");
// break;
// case 1:
// // ִ<><D6B4> Option 2 <20><><EFBFBD>ص<EFBFBD><D8B5>¼<EFBFBD>
// Debug.Log("Option 2 selected");
// break;
// case 2:
// // ִ<><D6B4> Option 3 <20><><EFBFBD>ص<EFBFBD><D8B5>¼<EFBFBD>
// Debug.Log("Option 3 selected");
// break;
// case 3:
// break;
// case 4:
// break;
// case 5:
// break;
// }
//}
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-11 14:37:42 +08:00
/// </summary>
public void OpenFirePanel()
2024-12-11 14:37:42 +08:00
{
TipTilte.SetActive(true);
MapTapPanel.SetActive(true);
2024-12-11 14:37:42 +08:00
}
/// <summary>
/// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-11 14:37:42 +08:00
/// </summary>
public void CloseFirePanel()
2024-12-11 14:37:42 +08:00
{
TipTilte.SetActive(false);
MapTapPanel.SetActive(false);
2024-12-11 14:37:42 +08:00
}
/// <summary>
2024-12-18 23:13:30 +08:00
/// <20><><EFBFBD><EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ʼ<EFBFBD><CABC>
/// </summary>
2024-12-18 23:13:30 +08:00
/// <param name="ID"></param>
public void InitializeFlee(int ID)
2024-12-11 14:37:42 +08:00
{
// <20><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5B2A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i = 0; i < itemCount; i++)
2024-12-11 14:37:42 +08:00
{
GameObject newItem = Instantiate(itemPrefab, content3.transform);
Text left = newItem.transform.Find("Choose_Bg/Choose_BgLeft/Left").GetComponent<Text>();
Text Right = newItem.transform.Find("Choose_Bg/Choose_BgLeft/Right").GetComponent<Text>();
2024-12-24 23:00:40 +08:00
left.text = jsonReader.SetUIText("20000");
2024-12-28 23:53:11 +08:00
Right.text = jsonReader.SetUIText((ID + i).ToString());
2024-12-18 23:13:30 +08:00
Toggle toggle = newItem.gameObject.GetComponent<Toggle>();
Choose1 chooseScript = newItem.GetComponent<Choose1>();
toggle.group = toggleGroup;
// <20>󶨵<EFBFBD><F3B6A8B5><EFBFBD><EFBFBD>¼<EFBFBD>
int index = i; // <20><>֤ÿ<D6A4><C3BF> Toggle <20>в<EFBFBD>ͬ<EFBFBD><CDAC> index
toggle.onValueChanged.AddListener((bool isOn) => OnToggleClicked(isOn, index, chooseScript));
// left.text=js
createdItems.Add(newItem); // <20><><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>б<EFBFBD><D0B1><EFBFBD>
ToggleCount++;
}
2024-12-18 23:13:30 +08:00
RandomPos();
}
/// <summary>
/// <20><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ѡ<EFBFBD><D1A1>˳<EFBFBD><CBB3>
/// </summary>
public void RandomPos()
{
// <20><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> Fisher-Yates <20><EFBFBD><E3B7A8>
System.Random rand = new System.Random();
int n = createdItems.Count;
for (int i = n - 1; i > 0; i--)
{
int j = rand.Next(i + 1);
GameObject temp = createdItems[i];
createdItems[i] = createdItems[j];
createdItems[j] = temp;
2024-12-11 14:37:42 +08:00
}
// <20><><EFBFBD>մ<EFBFBD><D5B4>Һ<EFBFBD><D2BA><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
foreach (GameObject item in createdItems)
{
item.transform.SetSiblingIndex(createdItems.IndexOf(item)); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD>
}
// ǿ<><C7BF>ˢ<EFBFBD>²<EFBFBD><C2B2><EFBFBD>
LayoutRebuilder.ForceRebuildLayoutImmediate(content3.GetComponent<RectTransform>());
2024-12-11 14:37:42 +08:00
}
2024-12-28 23:53:11 +08:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB7BD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
/// </summary>
/// <param name="ID"></param>
2024-12-18 23:13:30 +08:00
public void GcreationSelect(int ID)
{
GameObject newItem = Instantiate(itemPrefab, content3.transform);
Text left = newItem.transform.Find("Choose_Bg/Choose_BgLeft/Left").GetComponent<Text>();
Text Right = newItem.transform.Find("Choose_Bg/Choose_BgLeft/Right").GetComponent<Text>();
2024-12-24 23:00:40 +08:00
left.text = jsonReader.SetUIText("20000");
Right.text = jsonReader.SetUIText(ID.ToString());
2024-12-18 23:13:30 +08:00
Toggle toggle = newItem.gameObject.GetComponent<Toggle>();
Choose1 chooseScript = newItem.GetComponent<Choose1>();
toggle.group = toggleGroup;
// <20>󶨵<EFBFBD><F3B6A8B5><EFBFBD><EFBFBD>¼<EFBFBD>
int index = ++ToggleCount; // <20><>֤ÿ<D6A4><C3BF> Toggle <20>в<EFBFBD>ͬ<EFBFBD><CDAC> index
2024-12-28 23:53:11 +08:00
toggle.onValueChanged.AddListener((bool isOn) => OnToggleClicked(isOn, index, chooseScript));
2024-12-18 23:13:30 +08:00
createdItems.Add(newItem); // <20><><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>б<EFBFBD><D0B1><EFBFBD>
RandomPos();
}
2024-12-11 14:37:42 +08:00
/// <summary>
/// <20>Ѿ<EFBFBD><D1BE><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>İ༶ <20>ϱ<EFBFBD><CFB1><EFBFBD>ָ <20><>ť<EFBFBD>¼<EFBFBD>
/// </summary>
public void SumbitButton()
{
}
/// <summary>
/// δ<><CEB4>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>İ༶ <20>ϱ<EFBFBD><CFB1><EFBFBD>ָ <20><>ť<EFBFBD>¼<EFBFBD>
/// </summary>
public void Sumbit2Button()
{
}
/// <summary>
/// <20>򿪹رյ<D8B1><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
public void FirePanel()
{
FireText.color = new Color(0.75f, 0.75f, 0.75f);
if (MapTapPanel.activeSelf)
{
MapTapPanel.SetActive(false);
}
else
{
MapTapPanel.SetActive(true);
}
}
/// <summary>
/// <20><>ɢ<EFBFBD><C9A2>ʾ
/// </summary>
public void WarnPanel()
{
if (Command02.activeSelf)
{
Command02.SetActive(false);
isEnd = false;
StopCoroutine(Flicker());
2024-12-28 23:53:11 +08:00
DiaLogBox.gameObject.SetActive(true);
}
else
{
Command02.SetActive(true);
isEnd = true;
StartCoroutine(Flicker());
}
}
/// <summary>
/// <20><>Ч<EFBFBD><D0A7>Я<EFBFBD><D0AF>
/// </summary>
/// <returns></returns>
IEnumerator Flicker()
{
while (isEnd)
{
//Bg1.color= new Color(1f, 1f, 1f);
Bg1.sprite = Image1;
//Bg.color = new Color(1f, 0f, 0f);
yield return new WaitForSeconds(0.6f);
//Bg.color = new Color(1f, 1f, 1f);
//Bg1.color = new Color(1f, 0f, 0f);
Bg1.sprite = Image2;
yield return new WaitForSeconds(0.6f);
}
}
public void FixWarnPanelText(string str)
{
WartipText.text = str;
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EBB7BD>ѡ<EFBFBD><D1A1>
/// </summary>
public void DialogboxPanel()
{
if (DiaLogBox.activeSelf)
{
DiaLogBox.SetActive(false);
}
else
{
DiaLogBox.SetActive(true);
}
}
/// <summary>
/// <20><>¥<EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>ѡ<EFBFBD><D1A1>
/// </summary>
public void DialogBoxPanel2Panel()
{
if (DiaLogBox2.activeSelf)
{
DiaLogBox2.SetActive(false);
}
else
{
DiaLogBox2.SetActive(true);
}
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
/// </summary>
/// <param name="str"><3E>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD></param>
public void CreateWarn(string str)
{
GameObject newText = Instantiate(TextPrefab);
newText.transform.SetParent(content.transform, false);
Text text = newText.GetComponentInChildren<Text>();
text.text = str;
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>
/// </summary>
public void PopTip()
{
TipPanel.SetActive(true);
TipText.text = "<22><>ʱ" + TimeText.text + <><D1A7><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>";
//<2F><>͸<EFBFBD><CDB8><EFBFBD><EFBFBD>ʼ
TipText.color = new Color(TipText.color.r, TipText.color.g, TipText.color.b, 0f);
TipBg.color = new Color(TipText.color.r, TipText.color.g, TipText.color.b, 0f);
StartCoroutine(FadeInOutRoutine());
}
/// <summary>
/// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EBB5AD><EFBFBD><EFBFBD>Я<EFBFBD><D0AF>
/// </summary>
/// <returns></returns>
IEnumerator FadeInOutRoutine()
{
isFading = true; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EBB5AD><EFBFBD><EFBFBD>־
// <20><><EFBFBD><EFBFBD>
float elapsedTime = 0f;
while (elapsedTime < fadeInDuration)
{
elapsedTime += Time.deltaTime;
Color textColor = TipText.color;
textColor.a = elapsedTime / fadeInDuration; // <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>alphaֵ
TipText.color = textColor;
TipBg.color = textColor;
yield return null; // <20>ȴ<EFBFBD><C8B4><EFBFBD>һ֡
}
// <20><>ʾ<EFBFBD>ı<EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1>
yield return new WaitForSeconds(displayDuration);
// <20><><EFBFBD><EFBFBD>
elapsedTime = 0f;
while (elapsedTime < fadeOutDuration)
{
elapsedTime += Time.deltaTime;
Color textColor = TipText.color;
textColor.a = 1f - (elapsedTime / fadeOutDuration); // <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>alphaֵ
TipText.color = textColor;
TipBg.color = textColor;
yield return null; // <20>ȴ<EFBFBD><C8B4><EFBFBD>һ֡
}
isFading = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EBB5AD><EFBFBD><EFBFBD>־
fadeCoroutine = null; // <20><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
TipPanel.SetActive(false);
}
#region <EFBFBD>޸<EFBFBD><EFBFBD>ı<EFBFBD>
/// <summary>
/// <20>޸<EFBFBD>¥<EFBFBD>ݿڵ<DDBF><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>Ϣ
/// </summary>
/// <param name="a">1-<2D><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>2<EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="str">¥<>ݿ<EFBFBD><DDBF><EFBFBD>Ϣ</param>
public void FixStairway(int a, string str)
{
switch (a)
{
case 1:
icn_stairway_text_1.text = str;
break;
case 2:
icn_stairway_text_2.text = str;
break;
case 3:
icn_stairway_text_3.text = str;
break;
}
}
/// <summary>
/// <20>޸<EFBFBD><DEB8><EFBFBD>ָ<EFBFBD><D6B8>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
/// <param name="headImage">ͷ<><CDB7>ͼƬ</param>
/// <param name="name"><3E><><EFBFBD><EFBFBD></param>
/// <param name="Message"><3E><><EFBFBD><EFBFBD></param>
public void FixWarn_Tip(Image headImage, string name, string Message)
{
HeadImage = headImage;
Head_Text.text = name;
WarnTip_Text.text = Message;
}
/// <summary>
2024-12-28 16:38:41 +08:00
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>geigei<65><69><EFBFBD>ģ<EFBFBD>͵<EFBFBD><CDB5><EFBFBD>ģ<EFBFBD><C4A3>Ҵ<EFBFBD><D2B4><EFBFBD>HYLgeigei<65><69>
/// </summary>
/// <param name="ID"></param>
public void CSZS(string ID)
{
switch (ID)
{
case "8000":
Head_Text.text = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
break;
case "8001":
Head_Text.text = "<22><>ָ<EFBFBD><D6B8>";
break;
case "8002":
Head_Text.text = "<22><><EFBFBD>վ<EFBFBD>Ԯ<EFBFBD><D4AE>";
break;
case "8003":
Head_Text.text = "<22><><EFBFBD><EFBFBD><E9B3A4><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD>Ԯ<EFBFBD><D4AE>";
break;
case "8004":
Head_Text.text = "ҽ<>ƾȻ<C6BE><C8BB><EFBFBD>";
break;
case "8005":
Head_Text.text = "<22><><EFBFBD><EFBFBD><E9B3A4>ҽ<EFBFBD>ƾ<EFBFBD>Ԯ<EFBFBD><D4AE>";
break;
case "8006":
Head_Text.text = "<22><>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1";
break;
case "8007":
Head_Text.text = "<22><>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2";
break;
case "8008":
Head_Text.text = "<22><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD>";
break;
case "8009":
Head_Text.text = "<22><><EFBFBD><EFBFBD><E9B3A4><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD>";
break;
case "8010":
Head_Text.text = "<22><>Ѱ<EFBFBD><D1B0>";
break;
case "8011":
Head_Text.text = <><D1A7><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD>";
break;
}
}
/// <summary>
/// <20>޸<EFBFBD><DEB8><EFBFBD>ָ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD> <20><>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
/// <param name="name"><3E><><EFBFBD><EFBFBD></param>
/// <param name="Message"><3E><><EFBFBD><EFBFBD></param>
public void FixWarn_Tip(string name, string Message)
{
Head_Text.text = name;
WarnTip_Text.text = Message;
}
/// <summary>
/// <20>޸ĵ<DEB8>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><E7BBB0>
/// </summary>
/// <param name="a">1-<2D><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>2-<2D>绰</param>
/// <param name="Message"><3E>޸ĵ<DEB8><C4B5>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD></param>
public void FixMessage(int a, string Message)
{
switch (a)
{
case 1:
MessageText.text = Message;
break;
case 2:
MessageText2.text = Message;
break;
}
}
/// <summary>
/// <20>޸<EFBFBD><DEB8>ұ߿<D2B1><DFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
/// <param name="str"><3E><><EFBFBD><EFBFBD></param>
/// <param name="a"><3E><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD></param>
public void FixWarn(int a, string str)
{
switch (a)
{
case 1:
Tip_1.text = str;
break;
case 2:
Tip_2.text = str;
break;
case 3:
Tip_3.text = str;
break;
case 4:
Tip_4.text = str;
break;
}
}
2024-12-28 18:03:41 +08:00
///// <summary>
///// <20>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>
///// </summary>
///// <param name="str"><3E><><EFBFBD><EFBFBD><EFBFBD>ӳٵ<D3B3><D9B5><EFBFBD><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD></param>
//public void FixDelay(string str)
//{
// WLYC.text = "<22><><EFBFBD><EFBFBD><EFBFBD>ӳ٣<D3B3>" + str;
//}
/// <summary>
/// <20>޸<EFBFBD><DEB8><EFBFBD>ɢ<EFBFBD><EFBFBD><E0BCB6><EFBFBD><EFBFBD>
/// </summary>
/// <param name="str"><3E><EFBFBD><E0BCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="a"><3E><><EFBFBD>µڼ<C2B5><DABC><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
public void FixSituation(int a, string str)
{
switch (a)
{
case 1:
Situation_Tip_1.text = str;
break;
case 2:
Situation_Tip_2.text = str;
break;
case 3:
Situation_Tip_3.text = str;
break;
case 4:
Situation_Tip_4.text = str;
break;
}
}
/// <summary>
/// <20>޸ijɹ<C4B3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0BCB6><EFBFBD><EFBFBD>Ϣ
/// </summary>
/// <param name="str"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0BCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="a"><3E><><EFBFBD><EFBFBD></param>
public void FixFledOk(int a, string str)
{
Right_MessageText.text = str;
int currentValue = int.Parse(Student_Number.text);
currentValue = a;
// <20><><EFBFBD><EFBFBD> InputField <20><><EFBFBD>ı<EFBFBD>
Student_Number.text = currentValue.ToString();
}
/// <summary>
/// <20>޸<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>
/// </summary>
/// <param name="a"><3E><><EFBFBD><EFBFBD></param>
/// <param name="str"><3E>༶</param>
/// <param name="str2"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7></param>
public void FixNo(int a, string str, string str2)
{
NO_Left_MessageText.text = str;
NO_Right_MessageText.text = str2;
NO_Student.text = a.ToString();
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ <20>޸Ĺ<DEB8><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
/// <param name="str"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
public void FixArea(string str)
{
Area.text = str;
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ <20>޸<EFBFBD>NPC<50><43>
/// </summary>
/// <param name="str">NPC<50><43></param>
public void FixNPCName(string str)
{
NPCName.text = str;
}
2024-12-17 14:08:52 +08:00
public void FixTitle(string str)
{
2024-12-28 23:53:11 +08:00
str = DiaLogBoxTitle.text;
2024-12-17 14:08:52 +08:00
}
#endregion
/// <summary>
2024-12-17 14:08:52 +08:00
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵķ<D2B5><C4B7><EFBFBD>ѡ<EFBFBD><D1A1>
/// </summary>
/// <param name="isOn"></param>
/// <param name="index"></param>
2024-12-18 23:13:30 +08:00
private void OnToggleClicked(bool isOn, int index, Choose1 chooseScript)
{
2024-12-28 23:53:11 +08:00
switch (index)
{
2024-12-18 23:13:30 +08:00
case 0:
2024-12-28 23:53:11 +08:00
NPCdian1(index);
2024-12-18 23:13:30 +08:00
chooseScript.isShow = isOn;
break;
case 1:
2024-12-28 23:53:11 +08:00
NPCdian1(index);
2024-12-18 23:13:30 +08:00
chooseScript.isShow = isOn;
break;
2024-12-28 23:53:11 +08:00
case 2:
NPCdian1(index);
2024-12-18 23:13:30 +08:00
chooseScript.isShow = isOn;
break;
}
}
2024-12-17 14:08:52 +08:00
2024-12-28 23:53:11 +08:00
#region <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
public void NPCdian1(int a)
{
switch (louhao)
{
case 2:
ID = 10144;
break;
case 3:
ID = 10150;
break;
case 4:
ID = 10156;
break;
case 5:
ID = 10162;
break;
}
switch (a)
{
case 0:
TempNPC=jsonReader.GetNPCdian((ID + a).ToString());
break;
case 1:
TempNPC=jsonReader.GetNPCdian((ID + a).ToString());
break;
case 2:
TempNPC=jsonReader.GetNPCdian((ID + a).ToString());
break;
}
}
/// <summary>
2024-12-29 16:31:33 +08:00
/// <20><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Vector3 <20><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>б<EFBFBD>
2024-12-28 23:53:11 +08:00
/// </summary>
2024-12-29 16:31:33 +08:00
/// <param name="input"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD></param>
2024-12-28 23:53:11 +08:00
private void SplitData(string input)
{
2024-12-29 16:31:33 +08:00
// ȡ `#` ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-12-29 10:43:52 +08:00
if (input.Contains("#"))
2024-12-28 23:53:11 +08:00
{
2024-12-29 10:43:52 +08:00
input = input.Split('#')[0];
}
2024-12-29 16:31:33 +08:00
// <20><> `|` <20>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>
string[] segments = input.Split('|');
2024-12-28 23:53:11 +08:00
2024-12-29 16:31:33 +08:00
foreach (string segment in segments)
{
// <20><> `,` <20>ָ<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
string[] components = segment.Split(',');
if (components.Length == 3 &&
float.TryParse(components[0], out float x) &&
float.TryParse(components[1], out float y) &&
float.TryParse(components[2], out float z))
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Vector3 <20><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>б<EFBFBD>
NPCdian.Add(new Vector3(x, y, z));
}
else
2024-12-28 23:53:11 +08:00
{
2024-12-29 16:31:33 +08:00
Debug.LogWarning($"<22>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>Ϊ Vector3 <20><><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>{segment}");
2024-12-28 23:53:11 +08:00
}
2024-12-29 16:31:33 +08:00
}
2024-12-28 23:53:11 +08:00
}
#endregion
2024-12-11 14:37:42 +08:00
private void Close()
{
DiaLogBox2?.SetActive(false);
DiaLogBox?.SetActive(false);
}
}