Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit ff32a4f

Browse files
author
Paul Balaji
committed
GDK for Unity Blank Project - Initial commit
0 parents  commit ff32a4f

File tree

64 files changed

+3482
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3482
-0
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto
2+
*.meta text eol=lf
3+
*.prefab text eol=lf
4+
*.asset text eol=lf
5+
*.asmdef text eol=lf
6+
*.sh text eol=lf

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/build
2+
/workers/unity/build/
3+
/logs/
4+
.spatialos/
5+
.idea/
6+
.vs/
7+
.DS_Store
8+
9+
#Unity Engine Gitignore (https://github.com/github/gitignore/blob/master/Unity.gitignore)
10+
workers/unity/[Ll]ibrary/
11+
workers/unity/[Tt]emp/
12+
workers/unity/Logs/
13+
[Oo]bj/
14+
[Bb]in/
15+
workers/unity/ProjectSettings/UnityConnectSettings.asset
16+
17+
# Autogenerated VS/MD/Consulo solution and project files
18+
workers/unity/*.csproj
19+
workers/unity/*.sln
20+
*.unityproj
21+
*.suo
22+
*.tmp
23+
*.user
24+
*.userprefs
25+
*.svd
26+
*.DotSettings.user
27+
_ReSharper.Caches
28+
29+
# Unity3D Generated File On Crash Reports
30+
sysinfo.txt
31+
32+
# Builds
33+
*.apk
34+
*.unitypackage
35+
36+
# Generated code
37+
# We need to include some of the generated code below, which means we can't use a `directory/` ignore.
38+
# Once a directory is ignored by git, nothing underneath it can ever be un-ignored.
39+
workers/unity/Assets/Generated/Source.meta
40+
workers/unity/Assets/Generated/Source/**/*.*
41+
42+
workers/unity/Assets/Plugins/Editor/
43+
workers/unity/Assets/Plugins/Editor.meta
44+
45+
workers/unity/Assets/Plugins/Improbable/
46+
workers/unity/Assets/Plugins/Improbable.meta
47+
48+
# Schema from Unity Package Manager Packages (Copied via tools/CopySchema)
49+
schema/from_gdk_packages
50+
_ReSharper.Caches

LICENSE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Unity
2+
Your access to and use of the Unity Engine is governed by the Unity Engine End User License Agreement. Please ensure that you have agreed to those terms before you access or use the Unity Engine.
3+
4+
# SpatialOS GDK for Unity License
5+
6+
Copyright 2018 Improbable Worlds Limited (“Improbable”)
7+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
10+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11+
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
2. The Software and any derivative or modified versions may only be used in conjunction with Improbable’s SpatialOS platform and
13+
may not be used with any other platform or service providing equivalent or similar functionality.
14+
3. Improbable shall in all cases be identified as the original author of the Software, but individual users are free to impose
15+
such additional attribution requirements as they wish in relation to their own contributions.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
18+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21+
DEALINGS IN THE SOFTWARE.
22+
23+
This licence is governed by the laws of England and Wales and the jurisdiction of the English courts.
24+
25+
## Why yet another license?
26+
27+
We believe that SpatialOS is unique in the capabilities that it gives you access to and our developers have put a
28+
significant amount of effort in shaping the code that helps you benefit from these capabilities. While we want to
29+
offer you the results of these efforts freely, we also feel that existing open source licenses do not provide
30+
the necessary protection against the misuse of our software by competing platforms. The result is this license
31+
which is as close to the open source spirit as possible while still providing us with the protection that we want.
32+
33+
34+
## Where does this license come from?
35+
36+
This license draws for the largest part from open source licenses with their entrenched rights to copy, modify,
37+
share and commercialise derived projects. Additionally there are two clauses that make it clear that:
38+
39+
* Our source code and anything derived from it is only intended for use on SpatialOS, thereby excluding any competing platforms.
40+
* Improbable should always be identified as author within any derived projects but that, as an author of a derived project, you should feel free to add your own name to the author listing.
41+
42+
43+
## How does this license affect my work and contributions?
44+
45+
In most, if not all, cases this license should not affect your work and contributions in any significant way.
46+
You are more than welcome to use the published source code in your own projects, to modify it, improve it and
47+
redistribute it. You are even free to use it to build and sell your own product. The only thing we ask is that
48+
any projects derived from our source code are not used on a competing platform (but you are free to use them
49+
in a single player game if that’s what you fancy ;) ).

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The SpatialOS GDK for Unity Blank Project readme (alpha)
2+
3+
This is a blank project that you can use to build your own game with the [SpatialOS GDK for Unity](https://github.com/spatialos/gdk-for-unity).
4+
5+
© 2018 Improbable

cloud_launch.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"template": "small",
3+
"world": {
4+
"chunkEdgeLengthMeters": 50,
5+
"snapshots": {
6+
"snapshotWritePeriodSeconds": 0
7+
},
8+
"dimensions": {
9+
"xMeters": 5000,
10+
"zMeters": 5000
11+
}
12+
},
13+
"workers": [
14+
{
15+
"worker_type": "UnityGameLogic",
16+
"permissions": [
17+
{
18+
"all": {}
19+
}
20+
],
21+
"load_balancing": {
22+
"auto_hex_grid": {
23+
"num_workers": 2
24+
}
25+
}
26+
},
27+
{
28+
"worker_type": "UnityClient",
29+
"permissions": [
30+
{
31+
"all": {}
32+
}
33+
],
34+
"load_balancing": {
35+
"singleton_worker": {}
36+
}
37+
}
38+
]
39+
}

default_launch.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"template": "small",
3+
"world": {
4+
"chunkEdgeLengthMeters": 50,
5+
"snapshots": {
6+
"snapshotWritePeriodSeconds": 0
7+
},
8+
"dimensions": {
9+
"xMeters": 5000,
10+
"zMeters": 5000
11+
}
12+
},
13+
"workers": [
14+
{
15+
"worker_type": "UnityGameLogic",
16+
"permissions": [
17+
{
18+
"all": {}
19+
}
20+
],
21+
"load_balancing": {
22+
"singleton_worker": {}
23+
}
24+
},
25+
{
26+
"worker_type": "UnityClient",
27+
"permissions": [
28+
{
29+
"all": {}
30+
}
31+
],
32+
"load_balancing": {
33+
"singleton_worker": {}
34+
}
35+
}
36+
]
37+
}

gdk.pinned

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.1

scripts/powershell/setup.ps1

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
function Select-Clone-Method
4+
{
5+
$HTTPS_URI = "https://github.com/spatialos/gdk-for-unity.git"
6+
$SSH_URI = "[email protected]:spatialos/gdk-for-unity.git"
7+
8+
Write-Host @"
9+
Select a cloning method.
10+
11+
Press 1 for HTTPS ($($HTTPS_URI))
12+
Press 2 for SSH ($($SSH_URI))
13+
Press 3 to Quit
14+
"@
15+
16+
do
17+
{
18+
$Selection = Read-Host "Please make a selection "
19+
switch ($Selection)
20+
{
21+
'1' {
22+
return $HTTPS_URI
23+
}
24+
'2' {
25+
return $SSH_URI
26+
}
27+
}
28+
}
29+
until ($selection -eq '3')
30+
31+
return -1
32+
}
33+
34+
Write-Host @"
35+
36+
Welcome to the SpatialOS GDK for Unity Blank Project setup script.
37+
"@
38+
39+
$TargetDirectory = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($PSScriptRoot + "/../../../gdk-for-unity")
40+
41+
Write-Warning @"
42+
43+
This script will create the following directory to set up the SpatialOS GDK for Unity: $($TargetDirectory)
44+
*** If such a directory already exists it will be deleted. ***
45+
Are you ready to proceed? (y/n)
46+
"@
47+
$Confirmation = Read-Host
48+
49+
if ($Confirmation -ne 'y')
50+
{
51+
Write-Host "Stopping the setup process."
52+
exit 0
53+
}
54+
55+
$CloneUri = Select-Clone-Method
56+
57+
if ($CloneUri -eq -1)
58+
{
59+
Write-Host "Stopping the setup process."
60+
exit 0
61+
}
62+
63+
if (Test-Path -Path $TargetDirectory)
64+
{
65+
Write-Host "Deleting existing directory at $($TargetDirectory)..." -ForegroundColor Yellow
66+
Remove-Item $TargetDirectory -Force -Recurse
67+
}
68+
69+
Write-Host "Cloning SpatialOS GDK for Unity" -ForegroundColor Yellow
70+
& git clone $CloneUri $TargetDirectory
71+
72+
if ($LastExitCode -ne 0)
73+
{
74+
exit 1
75+
}
76+
77+
$PinnedVersion = Get-Content ($PSScriptRoot + "/../../gdk.pinned")
78+
79+
Write-Host "Checking out pinned version: $($PinnedVersion)" -ForegroundColor Yellow
80+
81+
Push-Location -Path "$TargetDirectory"
82+
& git checkout "$PinnedVersion"
83+
84+
if ($LastExitCode -ne 0)
85+
{
86+
Pop-Location
87+
exit 1
88+
}
89+
Pop-Location
90+
91+
Write-Host "Finished!" -ForegroundColor Green

scripts/shell/setup.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env bash
2+
# -ET: propagate DEBUG/RETURN/ERR traps to functions and subshells
3+
# -e: exit on unhandled error
4+
# pipefail: any failure in a pipe causes the pipe to fail
5+
set -eET -o pipefail
6+
[[ -n "${DEBUG:-}" ]] && set -x
7+
8+
LOG_SUCCESS='\033[0;32m'
9+
LOG_WARNING='\033[1;33m'
10+
LOG_EMPHASIS='\033[0;36m'
11+
NO_COLOR='\033[0m'
12+
13+
echo_with_color()
14+
{
15+
echo -e "${2}${1}${NO_COLOR}"
16+
}
17+
18+
echo ""
19+
echo "Welcome to the SpatialOS GDK for Unity Blank Project setup script."
20+
echo ""
21+
22+
readonly RAW_DIR="$(dirname "${0}")/../../../gdk-for-unity"
23+
24+
# Workaround for lack of realpath by default on MacOS
25+
# 1. Create the directory is it doesn't exist
26+
# 2. pushd there and record the directory through pwd
27+
# 3. This gives you a nice resolved path.
28+
mkdir -p "${RAW_DIR}"
29+
pushd "${RAW_DIR}" > /dev/null
30+
readonly TARGET_DIRECTORY=$(pwd)
31+
popd > /dev/null
32+
33+
echo_with_color "This script will create the following directory: ${TARGET_DIRECTORY}" "${LOG_WARNING}"
34+
echo_with_color "*** If such a directory already exists it will be deleted. ***" "${LOG_EMPHASIS}"
35+
echo_with_color "Are you ready to proceed? (y/n)" "${LOG_WARNING}"
36+
37+
read -r -p "" response
38+
if [[ "${response}" =~ ^([yY][eE][sS]|[yY])+$ ]]
39+
then
40+
echo "" > /dev/null
41+
else
42+
echo "Stopping the setup process."
43+
exit 0
44+
fi
45+
46+
HTTPS_URI="https://github.com/spatialos/gdk-for-unity.git"
47+
SSH_URI="[email protected]:spatialos/gdk-for-unity.git"
48+
49+
PS3="Please make a selection: "
50+
echo "Select a cloning method."
51+
echo ""
52+
HTTPS_OPTION="HTTPS (${HTTPS_URI})"
53+
SSH_OPTION="SSH (${SSH_URI})"
54+
options=("${HTTPS_OPTION}" "${SSH_OPTION}" "Quit")
55+
select opt in "${options[@]}"
56+
do
57+
case ${opt} in
58+
"${HTTPS_OPTION}")
59+
CLONE_URI=${HTTPS_URI}
60+
break
61+
;;
62+
"${SSH_OPTION}")
63+
CLONE_URI=${SSH_URI}
64+
break
65+
;;
66+
"Quit")
67+
echo "Stopping the setup process."
68+
exit 0
69+
;;
70+
*) echo "Invalid option ${REPLY}";;
71+
esac
72+
done
73+
74+
if [[ -d "${TARGET_DIRECTORY}" ]]; then
75+
echo_with_color "Deleting existing directory at ${TARGET_DIRECTORY}..." "${LOG_WARNING}"
76+
rm -rf "${TARGET_DIRECTORY}"
77+
fi
78+
79+
echo "Cloning SpatialOS GDK for Unity"
80+
git clone ${CLONE_URI} "${TARGET_DIRECTORY}"
81+
82+
PINNED_VERSION=$(cat "$(dirname "${0}")/../../gdk.pinned")
83+
84+
pushd "${TARGET_DIRECTORY}"
85+
git checkout "${PINNED_VERSION}"
86+
popd
87+
88+
echo_with_color "Finished!" "${LOG_SUCCESS}"

snapshots/default.snapshot

141 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)