Exemplo n.º 1
0
        void ShowDamageText(object healthable, HealthChangeEventArgs args)
        {
            if (worldUiCanvas.worldUiObjects.damageTextFeed == null)
            {
                return;
            }

            Actor owner = args.modifier.GetOwner();

            // TODO hadcoded tag
            // Only player damage showing
            if (owner == null || !owner.CompareTag("Player"))
            {
                return;
            }

            GameObject damageText = worldUiCanvas.SpawnUi(worldUiCanvas.worldUiObjects.damageTextFeed, WorldUiType.DamageFeed);

            FloatingHealthChange healthChange = damageText.GetComponent <FloatingHealthChange>();

            if (healthChange == null)
            {
                return;
            }

            healthChange.Init(transform, args.modifier.GetValue().ToString(), args.modifier.IsCrit());
        }
Exemplo n.º 2
0
 private void Remove(FloatingHealthChange item)
 {
     feedStack.Remove(item);
     Destroy(item.gameObject);
 }