private static IEnumerator _Trigger(EntityAlive entity) { if (entity == null) { yield break; } Vector3 pos = entity.GetPosition(); string item = StringMap.Get(entity, cvarKey); // Printer.Print("MinEventActionExplodeEntity", entity, pos, item); if (item == "") { Printer.Print("StringMap no cvar"); } else { Vector3 offset = 0.3f * Vectors.Float.UnitY; Vector3 motion = -Vectors.Float.UnitY; motion = motion.normalized * 3; yield return(SdtdUtils.EffectsItem.spawnItemGhost(item, pos + offset + Vectors.Float.UnitY, motion)); yield return(dt); } if (entity == null) { yield break; } entity.SetDead(); }