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

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