Files
o3de/Gems/LyShineExamples/Assets/UI/Scripts/LyShineExamples/HideThisElementButton.lua
T
2021-06-23 10:55:22 -07:00

34 lines
943 B
Lua

----------------------------------------------------------------------------------------------------
--
-- Copyright (c) Contributors to the Open 3D Engine Project
--
-- SPDX-License-Identifier: Apache-2.0 OR MIT
--
--
--
----------------------------------------------------------------------------------------------------
local HideThisElementButton =
{
Properties =
{
},
}
function HideThisElementButton:OnActivate()
self.buttonHandler = UiButtonNotificationBus.Connect(self, self.entityId)
UiElementBus.Event.SetIsEnabled(self.entityId, false)
UiInteractableBus.Event.SetIsHandlingEvents(self.entityId, false)
end
function HideThisElementButton:OnDeactivate()
self.buttonHandler:Disconnect()
end
function HideThisElementButton:OnButtonClick()
UiElementBus.Event.SetIsEnabled(self.entityId, false)
UiInteractableBus.Event.SetIsHandlingEvents(self.entityId, false)
end
return HideThisElementButton