Upload from upload_mods.ps1
This commit is contained in:
24
KFAttached/KFUtilAttached/WeaponLabelController.cs
Normal file
24
KFAttached/KFUtilAttached/WeaponLabelController.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("KFAttachments/Weapon Display Controllers/Weapon Label Controller TextMesh")]
|
||||
public class WeaponLabelController : WeaponLabelControllerBase
|
||||
{
|
||||
[SerializeField]
|
||||
private TextMesh[] labels;
|
||||
|
||||
public override bool setLabelText(int index, string data)
|
||||
{
|
||||
if (labels == null || labels.Length <= index || !labels[index] || !labels[index].gameObject.activeSelf)
|
||||
return false;
|
||||
labels[index].text = data;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool setLabelColor(int index, Color color)
|
||||
{
|
||||
if (labels == null || labels.Length <= index || !labels[index] || !labels[index].gameObject.activeSelf)
|
||||
return false;
|
||||
labels[index].color = color;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user