cask "unity" do arch arm: "Arm64" version "2022.1.23f1,9636b062134a" sha256 arm: "5f4e8d5b8b2df25c3a84e5a875502e62df63759c20925e3b1e8a9d1bcfac9343", intel: "be6f32f4e5e8388471f7ed0be8e050762f6b12e492f2b1b91d310f5b6144b590" 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/products" livecheck do url "https://public-cdn.cloud.unity3d.com/hub/prod/releases-darwin.json" strategy :page_match do |page| page.scan(%r{/download_unity/(\h+)/MacEditorInstaller/Unity-(\d+(?:\.\d+)+[a-z]*\d*)\.pkg}i).map do |match| "#{match[1]},#{match[0]}" end 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" end