public void ReplaceUnityHealthBox(HealthBoxBehaviour newValue) { var index = GameComponentsLookup.UnityHealthBox; var component = CreateComponent <UnityHealthBox>(index); component.value = newValue; ReplaceComponent(index, component); }
private void CreateHealthBox(GameEntity e) { HealthBoxBehaviour hb = GameObject.Instantiate(_prefab); hb.SetTarget(e.gameObject.value); hb.GetComponent <RectTransform>().SetParent(_OSD); hb.MaxHealth = e.health.value; e.AddUnityHealthBox(hb); }
public ShowHealthBox(Contexts contexts) : base(contexts.game) { _OSD = GameObject.FindGameObjectWithTag("OnScreenDisplay").GetComponent <RectTransform>(); _prefab = Resources.Load <HealthBoxBehaviour>("Prefabs/HealthBox"); }