Код: Выделить всё
private void FillCount(string Name, UnturnedPlayer player, byte Amount)
{
EffectManager.sendUIEffectText(113, player.CSteamID, true, Name + "Count", Amount.ToString() + "%");
string fill = "".PadLeft(Amount, ' ');
EffectManager.sendUIEffectText(113, player.CSteamID, true, Name + "FillText", fill);
}
В Unity у меня есть скрипт, наложенный на холст, который изменяет Объем заливки в зависимости от длины текста в объекте, который является дочерним по отношению к изображению.
Код: Выделить всё
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HealthBarUpdate : MonoBehaviour
{
public Image HealthFill;
void Start()
{
}
void Update()
{
if (HealthFill != null)
{
Text HealthFillText = HealthFill.GetComponentInChildren();
if (HealthFillText != null)
{
int charCount = HealthFillText.text.Length;
float fillAmount = Mathf.Clamp01(charCount * 0.01f);
HealthFill.fillAmount = fillAmount;
}
}
}
}




Итак, я залил мод и плагин на сервер, но HealthFill вообще не заполняется, хотя сервер передает значения другому объекту (здоровье)
Я сделал что-то не так? Если да, то расскажите, как это можно реализовать.
Подробнее здесь: https://stackoverflow.com/questions/793 ... radial-bar