我正在尝试为魔兽世界创建一个插件。我创建了一个函数来检查当前玩家是否添加了一个 buff。
Button:RegisterEvent("UNIT_AURA");
local function auraGained(self, event, ...)
if (UnitAura("player", "Heating Up")) then
if (heatingUpIsActive ~= 1) then
heatingUpIsActive = heatingUpIsActive + 1
print (heatingUpIsActive)
end
end
Button:SetScript("OnEvent", auraGained);
这很好用,但我如何检查UnitAura是否不是 "Heating Up"?
另外,我更喜欢 ifheatingUpIsActive是 a boolean,但是当我这样做时似乎不喜欢。boolean在 Lua中创建的正确方法是什么?