Files
JJBB/Assets/Project/Script/GUI/Guild/GuildWarTips.cs

153 lines
5.1 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using GCGame;
using System.Collections.Generic;
using Module.Log;
using Games.LogicObj;
using Games.GlobeDefine;
using GCGame.Table;
using Games.UserCommonData;
using Games.Events;
using Games.Mission;
public class GuildWarTips : MonoBehaviour
{
Dictionary<int, string> KillTips = new Dictionary<int, string>()
{
{3,"#{7400}" },
{4,"#{7401}" },
{5,"#{7402}" },
{6,"#{7403}" },
{7,"#{7404}" },
{8,"#{7405}" },
{9,"#{7406}" },
{10,"#{7407}" },
};
Dictionary<int, string> OverKillTips = new Dictionary<int, string>()
{
{3,"#{7408}" },
{4,"#{7409}" },
{5,"#{7410}" },
{6,"#{7411}" },
{7,"#{7412}" },
{8,"#{7413}" },
{9,"#{7414}" },
{10,"#{7415}" },
};
private string Red = "<color=#ff5555ff>{0}</color>";
private string Blue = "<color=#64dff9ff>{0}</color>";
public Text Tip;
private List<string> ShowListC = new List<string>(); //连杀数
private List<string> ShowListT = new List<string>(); //终结连杀数
public GameObject OverKillWnd;
public GameObject OtherKillWnd;
public GameObject SelfKillWnd;
public Text continueSkill;
public UIImgText continueSelf;
float lastOverShowTime = 0;
float lastOtherShowTime = 0;
float lastSelfShowTime = 0;
private void Update()
{
lastSelfShowTime -= Time.deltaTime;
lastOtherShowTime -= Time.deltaTime;
int CanClose = 0;
if (lastSelfShowTime <= 0 && lastSelfShowTime != -100)
{
SelfKillWnd.SetActive(false);
lastSelfShowTime = -100;
}
if (Time.realtimeSinceStartup - lastOverShowTime > 2f && ShowListT.Count > 0)
{
Tip.text = ShowListT[0];
ShowListT.RemoveAt(0);
lastOverShowTime = Time.realtimeSinceStartup;
}
if (lastOtherShowTime <= 0 && lastOtherShowTime != -100)
{
OtherKillWnd.SetActive(false);
lastOtherShowTime = -100;
}
if (lastSelfShowTime <= 0)
{
CanClose++;
}
if (lastOtherShowTime <= 0)
{
CanClose++;
}
if (ShowListT.Count <= 0 && Time.realtimeSinceStartup - lastOverShowTime > 2f)
{
OverKillWnd.SetActive(false);
CanClose++;
}
}
public void ShowKillTips(SynContinuousKill binary)
{
if(GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.RoleName == binary.killerName)
{
SelfKillWnd.SetActive(true);
continueSelf.text = binary.killerCount >= 100 ? StrDictionary.GetClientDictionaryString("#{9917}") : binary.killerCount.ToString();
lastSelfShowTime = 2;
}
OtherKillWnd.SetActive(true);
string tip = "";
if (binary.killerCamp == binary.selfCamp)
tip = StrDictionary.GetClientDictionaryString("#{35117}", string.Format("<color=#64dff9>{0}</color> ", binary.killerName), string.Format(" <color=#e3df6d>{0}</color>", binary.killerCount));
//ShowListC.Add(StrDictionary.GetClientDictionaryString("#{35117}", string.Format("<color=#64dff9>{0}</color> ", binary.killerName), string.Format(" <color=#e3df6d>{0}</color>", binary.killerCount)));
else
tip = StrDictionary.GetClientDictionaryString("#{35117}", string.Format("<color=#ff4545>{0}</color> ", binary.killerName), string.Format(" <color=#e3df6d>{0}</color>", binary.killerCount));
//ShowListC.Add(StrDictionary.GetClientDictionaryString("#{35117}", string.Format("<color=#ff4545>{0}</color> ", binary.killerName), string.Format(" <color=#e3df6d>{0}</color>", binary.killerCount)));
lastOtherShowTime = 2;
continueSkill.text = tip;
if (binary.killerCount < 3)
return;
int index = binary.killerCount;
if (index > 10)
index = 10;
string ID = null;
if (KillTips.TryGetValue(index, out ID))
{
OverKillWnd.SetActive(true);
if (binary.killerCamp == binary.selfCamp)
ShowListT.Add(StrDictionary.GetClientDictionaryString(ID, string.Format(Blue, binary.killerName)));
else
ShowListT.Add(StrDictionary.GetClientDictionaryString(ID, string.Format(Red, binary.killerName)));
}
}
public void ShowOverKillTip(SynTerminator binary)
{
if (binary.killerCount < 3)
return;
int index = binary.killerCount;
if (index > 10)
index = 10;
string ID = null;
if (OverKillTips.TryGetValue(index, out ID))
{
OverKillWnd.SetActive(true);
string killName = (binary.selfCamp == binary.killerCamp) ? string.Format(Blue, binary.killerName) : string.Format(Red, binary.killerName);
string overName = (binary.selfCamp == binary.terminatorCamp) ? string.Format(Blue, binary.terminatorName) : string.Format(Red, binary.terminatorName);
ShowListT.Add(StrDictionary.GetClientDictionaryString(ID, overName, killName));
}
}
}