Example #1
0
    public void ReplaceUnityHealthBox(HealthBoxBehaviour newValue)
    {
        var index     = GameComponentsLookup.UnityHealthBox;
        var component = CreateComponent <UnityHealthBox>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Example #2
0
        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);
        }
Example #3
0
 public ShowHealthBox(Contexts contexts) : base(contexts.game)
 {
     _OSD    = GameObject.FindGameObjectWithTag("OnScreenDisplay").GetComponent <RectTransform>();
     _prefab = Resources.Load <HealthBoxBehaviour>("Prefabs/HealthBox");
 }