Files
Ultimate-Fishing-Simulator-…/Assets/Plugins/Assembly-CSharp-firstpass/UltimateChatBoxExample/KillFeedExampleTest.cs
2026-03-04 09:37:33 +08:00

34 lines
948 B
C#

using System.Collections.Generic;
using TMPro;
using TankAndHealerStudioAssets;
using UnityEngine;
namespace UltimateChatBoxExample
{
public class KillFeedExampleTest : MonoBehaviour
{
public UltimateChatBox chatBox;
public TMP_SpriteAsset spriteAsset;
public List<string> names = new List<string> { "<color=#FF0011>Player00</color>", "<color=#007BFF>Player01</color>", "<color=#FF0011>Player02</color>", "<color=#FF0011>Player03</color>", "<color=#FF0011>Player04</color>" };
public void SendKillFeed(string weaponName)
{
string text = names[Random.Range(0, names.Count)];
string text2 = names[Random.Range(0, names.Count)];
while (text2 == text)
{
text2 = names[Random.Range(0, names.Count)];
}
string text3 = text + " <sprite name=" + weaponName + ">";
if (Random.Range(0, 10) > 8)
{
text3 += "<sprite name=Headshot>";
}
text3 = text3 + " " + text2;
chatBox.RegisterChat(text3);
}
}
}