---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Administrator.
--- DateTime: 2018/6/15 16:59
---
local fgui = require("FGUI.FairyGUI")
local YK = require("Core.YK")

---@class WindowBase : YKSupportLua.LuaWindow @窗口基类
local this = YK.wind_class()

---@param ins YKSupportLua.LuaWindow
function this:ctor(ins)
    self.isNeedHideAnimation = false
    self.isNeedShowAnimation = false
    self.packName = "";
    self.resName = "";
    --local get = tolua.initget(self)
    --local set = tolua.initset(self)
    --print(self.resName)
    --get.PackName =
    --function ()
    --    print(self.resName)
    --    return self.packName
    --end
    --
    --get.ResName =
    --function ()
    --    return self.resName
    --end
    --
    --get.IsNeedShowAnimation =
    --function ()
    --    return self.isNeedShowAnimation
    --end
    --
    --get.IsNeedHideAnimation =
    --function ()
    --    return self.isNeedHideAnimation
    --end
end

function this:OnInit()
end

function this:DoShowAnimation()
    self.scale = Vector2(0.3, 0.3);
    YK.DOTweenFloat(self.scale.x, 1, 0.3, function(scal)
        if self ~= nil then
            self.scale = Vector2(scal, scal);
        end
    end, 0, DG.Tweening.Ease.OutCirc, function()
        if self ~= nil and self.contentPane ~= nil then
            self:OnShown(self:GetData());
        end
    end)
end

function this:DoHideAnimation()
    YK.DOTweenFloat(self.scale.x, 0, 0.3, function(scal)
        if self ~= nil then
            self.scale = Vector2(scal, scal);
        end
    end, 0, nil, function()
        if self ~= nil and self.contentPane ~= nil then
            self:HideImmediately();
        end
    end)

end

function this:OnDestroy()

end

function this:OnShown(param)
end

function this:OnHide()
end

function this:OnUpdate()
end

function this:OnColseBtn()
    self:Hide()
end

---@param ev EventData
function this:OnHandler(ev)

end

---@param btn FairyGUI.EventContext
function this:OnBtnClick(btn)

end

return this
