4 version "2023.2.20f1,0e25a174756c"
5 sha256 arm: "432b014d7bf50f82cb2a0978571df5f1f515c59a2f6826761cb20c32d196763f",
6 intel: "c7e203a316b308acab23a81bba16c17be94c65fa210a4c0e5f083d83f2c10b3f"
8 url "https://download.unity3d.com/download_unity/#{version.csv.second}/MacEditorInstaller#{arch}/Unity-#{version.csv.first}.pkg",
9 verified: "download.unity3d.com/download_unity/"
11 desc "Platform for 3D content"
12 homepage "https://unity.com/"
15 url "https://public-cdn.cloud.unity3d.com/hub/prod/releases-darwin.json"
16 regex(%r{/(\h+)/MacEditorInstaller/Unity[._-]v?(\d+(?:\.\d+)+(?:f\d+)?)\.pkg}i)
17 strategy :json do |json, regex|
18 json["official"]&.map do |release|
19 # Only use 202X.X.XfX versions until Unity 6 (6000) is a full release
20 next unless release["version"]&.start_with?("202")
22 match = release["downloadUrl"]&.match(regex)
25 "#{match[2]},#{match[1]}"
30 depends_on cask: "unity-hub"
32 pkg "Unity-#{version.csv.first}.pkg"
34 uninstall quit: "com.unity3d.UnityEditor5.x",
35 pkgutil: "com.unity3d.UnityEditor5.x",
36 delete: "/Applications/Unity"
39 "/Library/Application Support/Unity",
40 "~/Library/Application Support/Unity*",
41 "~/Library/Caches/com.unity3d.UnityEditor",
42 "~/Library/Logs/Unity",
43 "~/Library/Preferences/com.unity.BugReporterV2.plist",
44 "~/Library/Preferences/com.unity3d.UnityEditor5.x.plist",
45 "~/Library/Preferences/com.unity3d.unityhub.plist",
46 "~/Library/Preferences/unity.DefaultCompany.*",
47 "~/Library/Saved Application State/com.unity3d.unityhub.savedState",