Method SayTo
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
SayTo(string, Transform)
Makes the hero say something to a specific target. Essential for targeted spells and commands.
public static float SayTo(string text, Transform target)
Parameters
text
stringWhat to say or which spell to cast
target
TransformTarget of the speech or spell
Returns
- float
Duration of the speech or spell cast time
Remarks
Advanced version of Say(string) that allows targeting specific characters. Particularly useful for:
- Casting targeted spells
- Speaking to specific characters
foreach (var hero in Party.Heroes)
{
if (hero.Health < hero.MaxHealth * 0.5f) // Below 50% health
{
Hero.SayTo("Yn Mana", hero.transform); // Cast heal on the injured hero
break;
}
}
var enemy = Hero.FindNearestEnemy(10);
if (enemy != null)
{
Hero.SayTo($"Distance: {Vector3.Distance(Hero.transform.position, enemy.transform.position):F1}", enemy.transform);
}