|
|
|
|
|
|
import subprocess |
|
|
|
import yaml |
|
|
|
from typing import List, Optional |
|
|
|
from sys import platform |
|
|
|
UNITY_VERSION = os.environ["UNITY_VERSION"] |
|
|
|
BOKKEN_UNITY = f"/Users/bokken/{UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" |
|
|
|
HUB_UNITY = ( |
|
|
|
f"/Applications/Unity/Hub/Editor/{UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" |
|
|
|
) |
|
|
|
if os.path.exists(BOKKEN_UNITY): |
|
|
|
return BOKKEN_UNITY |
|
|
|
if os.path.exists(HUB_UNITY): |
|
|
|
return HUB_UNITY |
|
|
|
raise FileNotFoundError("Can't find bokken or hub executables") |
|
|
|
if platform == "darwin": |
|
|
|
downloader_install_path = "./.Editor/Unity.app/Contents/MacOS/Unity" |
|
|
|
else: # if platform == "linux": |
|
|
|
downloader_install_path = "./.Editor/Unity" |
|
|
|
if os.path.exists(downloader_install_path): |
|
|
|
return downloader_install_path |
|
|
|
raise FileNotFoundError("Can't find executable from unity-downloader-cli") |
|
|
|
|
|
|
|
|
|
|
|
def get_base_path(): |
|
|
|