function ShowView(showUpKeep, enhancement, showecon, showShield)
    import('/lua/ui/game/unitview.lua').ShowROBox(false, false)
    View.Hiding = false
    
    View.UpkeepGroup:SetHidden(not showUpKeep)
    
    View.BuildCostGroup:SetHidden(not showecon)
    View.UpkeepGroup:SetHidden(not showUpKeep)
    View.TimeStat:SetHidden(not showecon)
    View.HealthStat:SetHidden(not showecon)
        
    View.HealthStat:SetHidden(enhancement)
    
    View.ShieldStat:SetHidden(not showShield)
    
    if View.Description then
        View.Description:SetHidden(ViewState == "limited" or View.Description.Value[1]:GetText() == "")
    end
    
    View:SetAlpha(1, true)
end
   
function Hide()
    View.Time = 0
    View.Hiding = true
    View:SetAlpha(0, true)
end

function SetupUnitViewLayout(parent)
    if View then
        View:Destroy()
        View = nil
    end
    MapView = parent
    SetLayout()
    View:SetAlpha(0, true)
    --View:SetNeedsFrameUpdate(true)
    View.Hiding = true
    View:DisableHitTest(true)
    --[[View.OnFrame = function(self, delta)
        if self.Hiding then
            local newAlpha = self:GetAlpha() - (delta * 3)
            if newAlpha < 0 then
                newAlpha = 0
                self.Hiding = true
            end
            self:SetAlpha(newAlpha, true)
        elseif self:GetAlpha() < 1 then
            local newAlpha = math.min(self:GetAlpha() + (delta * 9), 1)
            self:SetAlpha(newAlpha, true)
        end
    end--]]
end
