浏览代码

copy yamato util from main

/tag-com.unity.ml-agents_1.0.8
Chris Elion 3 年前
当前提交
d46b735d
共有 1 个文件被更改,包括 8 次插入10 次删除
  1. 18
      ml-agents/tests/yamato/yamato_utils.py

18
ml-agents/tests/yamato/yamato_utils.py


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():

正在加载...
取消
保存