diff --git a/.yamato/build.yml b/.yamato/build.yml new file mode 100644 index 000000000..80ac61f5d --- /dev/null +++ b/.yamato/build.yml @@ -0,0 +1,55 @@ +{% metadata_file .yamato/project.metafile %} +--- + +{% for project in projects -%} +{% for editor in test_editors -%} +{% for platform in test_platforms -%} + +build_{{ project.name }}_{{ editor }}_{{ platform.name }}: + name: Build Project {{ project.name }} - Package {{ package.name }} - {{ editor }} on {{ platform.name }} + variables: + UTR_VERSION: current + agent: + type: {{ platform.type }} + image: {{ platform.image }} + flavor: {{ platform.flavor}} + commands: + - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade + - unity-downloader-cli -u {{ editor }} -c editor --wait --published --fast + +{% if platform.name == "win" -%} #windows + - .Editor\Unity.exe -projectpath {{ project.path }} -batchmode -quit -logfile build.log -buildWindowsPlayer build\players\test.exe +{% else -%} + - .Editor/Unity.app/Contents/MacOS/Unity -projectpath {{ project.path }} -batchmode -quit -logfile build.log -buildOSXUniversalPlayer ./build/players/test +{% endif -%} + + artifacts: + players: + paths: + - "build/players/**" + logs: + paths: + - "build/logs/**" + +{% endfor -%} +{% endfor -%} +{% endfor -%} + +# Run all relevant tasks when a pull request targeting the develop / main +develop_pull_request_trigger: + name: Develop Branch Triggers + dependencies: +{% for project in projects -%} +{% for editor in test_editors -%} +{% for platform in test_platforms -%} + - .yamato/build.yml#build_{{ project.name }}_{{ editor }}_{{ platform.name }} +{% endfor -%} +{% endfor -%} +{% endfor -%} + triggers: + cancel_old_ci: true + pull_requests: + - targets: + only: + - "main" + - "develop" \ No newline at end of file diff --git a/.yamato/project.metafile b/.yamato/project.metafile new file mode 100644 index 000000000..96cd05177 --- /dev/null +++ b/.yamato/project.metafile @@ -0,0 +1,29 @@ +# Editors where tests will happen. The first entry of this array is also used +# for validation. +# +# Therefore, **do not** put an older V1-lifecycle ver. +# like 2020.x or 2019.x on top of 'test_editors' +test_editors: + - 2020.3 + +# Platforms that will be tested. The first entry in this array will also +# be used for validation +test_platforms: + - name: win + type: Unity::VM + image: package-ci/win10:stable + platform: StandaloneWindows64 + flavor: b1.large + - name: mac + type: Unity::VM::osx + image: package-ci/mac:stable + platform: StandaloneOSX + flavor: m1.mac + +# Projects within the repository that will be tested. Name will be used +# for job ids, so it should not contain spaces/non-supported characters +projects: + - name: 2dspaceshooter + path: Basic/2DSpaceShooter + - name: invaders + path: Basic/Invaders \ No newline at end of file diff --git a/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs b/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs index 8b29df925..6cabb78dd 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs @@ -15,7 +15,7 @@ public void Config(ShipControl owner, int damage, bool bounce, float lifetime) m_Owner = owner; m_Damage = damage; m_Bounce = bounce; - + if (IsServer) { // This is bad code don't use invoke.