GetUnitName
- Parameters
whichUnit unitTarget unit.
- comment
Returns unit's name. By default, it's the localized name for unit.
Example (Lua):
u = CreateUnit(Player(0), FourCC("hfoo"), -30, 0, 90) print(GetUnitName(u)) --> "Footman"- async
- This function is asynchronous. The values it returns are not guaranteed to be the same for each player. If you attempt to use it in an synchronous manner it may cause a desync.
- note
See:
BlzSetUnitName,GetHeroProperName,GetDestructableName,GetItemName,GetObjectName.- patch
1.00
- Source
- common.j (raise an issue to discuss on Github or submit a PR)
- return type
string- Source code
constant native GetUnitName takes unit whichUnit returns string