Files
2024-03-08 09:52:34 +00:00

42 lines
1.5 KiB
Ruby

cask "unity" do
arch arm: "Arm64"
version "2023.2.13f1,70197a359f36"
sha256 arm: "fa7a9e4128a76d9241ac1d8ba8214455bccc704d4a49f3bdb7a9c521d115b7e1",
intel: "99280d247a0d770dddf29ba2b9dc4201237c0e14f16b17c0ae4e0337f88a0e1e"
url "https://download.unity3d.com/download_unity/#{version.csv.second}/MacEditorInstaller#{arch}/Unity-#{version.csv.first}.pkg",
verified: "download.unity3d.com/download_unity/"
name "Unity Editor"
desc "Platform for 3D content"
homepage "https://unity.com/"
livecheck do
url "https://public-cdn.cloud.unity3d.com/hub/prod/releases-darwin.json"
regex(%r{/download_unity/(\h+)/MacEditorInstaller/Unity-(\d+(?:\.\d+)+[a-z]*\d*)\.pkg}i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[1]},#{match[0]}" }
end
end
depends_on cask: "unity-hub"
pkg "Unity-#{version.csv.first}.pkg"
uninstall quit: "com.unity3d.UnityEditor5.x",
pkgutil: "com.unity3d.UnityEditor5.x",
delete: "/Applications/Unity"
zap delete: "/Library/Application Support/Unity",
trash: [
"/Library/Application Support/Unity",
"~/Library/Application Support/Unity",
"~/Library/Application Support/UnityHub",
"~/Library/Caches/com.unity3d.UnityEditor",
"~/Library/Logs/Unity",
"~/Library/Preferences/com.unity3d.unityhub.plist",
"~/Library/Saved Application State/com.unity3d.unityhub.savedState",
"~/Library/Unity",
]
end