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

Commit cc01d78

Browse files
zeroZshadowjamiebrynes7
authored andcommitted
Entity representation (#111)
* Update pin * Split and update gitignore * Move assembly definition file into project folder * Add entityRepresentationMapping to Worker connectors * Add EntityRepresentationMapping assets for client and gamelogic * Move Prefabs out of Resources Remove empty Resources folder
1 parent 882fd59 commit cc01d78

21 files changed

+112
-27
lines changed

.gitignore

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
/build
2-
/workers/unity/build/
32
/logs/
43
.spatialos/
54
.idea/
65
.vs/
6+
.gradle/
77
.DS_Store
88
DevAuthToken.txt*
99

1010
#Unity Engine Gitignore (https://github.com/github/gitignore/blob/master/Unity.gitignore)
11-
workers/unity/[Ll]ibrary/
12-
workers/unity/[Tt]emp/
13-
workers/unity/Logs/
1411
[Oo]bj/
1512
[Bb]in/
16-
workers/unity/ProjectSettings/UnityConnectSettings.asset
1713

1814
# Autogenerated VS/MD/Consulo solution and project files
19-
workers/unity/*.csproj
20-
workers/unity/*.sln
2115
*.unityproj
2216
*.suo
2317
*.tmp
@@ -33,21 +27,9 @@ sysinfo.txt
3327
# Builds
3428
*.apk
3529
*.unitypackage
30+
*.trace
3631

37-
# Generated code
38-
# We need to include some of the generated code below, which means we can't use a `directory/` ignore.
39-
# Once a directory is ignored by git, nothing underneath it can ever be un-ignored.
40-
workers/unity/Assets/Generated/Source.meta
41-
workers/unity/Assets/Generated/Source/**/*.*
42-
43-
workers/unity/Assets/Plugins/Editor/
44-
workers/unity/Assets/Plugins/Editor.meta
45-
46-
workers/unity/Assets/Plugins/Improbable/
47-
workers/unity/Assets/Plugins/Improbable.meta
48-
49-
# Schema from Unity Package Manager Packages (Copied via tools/CopySchema)
50-
schema/from_gdk_packages
5132
_ReSharper.Caches
5233

5334
.shared-ci/
35+
perftest-results/

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22

33
## Unreleased
44

5+
### Breaking Changes
6+
7+
- Moved the `BlankProject` assembly definition from `Assets` to `Assets/BlankProject` to avoid common compile issues with Plugins. [#111](https://github.com/spatialos/gdk-for-unity-blank-project/pull/111)
8+
9+
### Added
10+
11+
- Enabled GameObject Creation by default using the new Entity Representation assets. [#111](https://github.com/spatialos/gdk-for-unity-blank-project/pull/111)
12+
- The prefab mapping assets can be found in `Assets/Config`.
13+
- Prefabs no longer need to be stored in `Resources`.
14+
515
## `0.3.7` - 2020-06-22
616

717
### Changed
818

919
- Upgraded to GDK for Unity version `0.3.7`
20+
1021
### Removed
1122

1223
- Removed the `com.unity.xr.legacyinputhelpers` package from the `manifest.json`. [#107](https://github.com/spatialos/gdk-for-unity-blank-project/pull/107)
@@ -51,11 +62,13 @@
5162
### Changed
5263

5364
- Upgraded to GDK for Unity version `0.3.2`
65+
5466
## `0.3.1` - 2019-11-25
5567

5668
### Changed
5769

5870
- Upgraded to GDK for Unity version `0.3.1`
71+
5972
## `0.3.0` - 2019-11-11
6073

6174
### Changed

gdk.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
develop 46be8d892f3d1a1ddd62d202200c0c227a02ca4a
1+
develop da81d115c675dc6e2ad1226a149740974a260ba6

workers/unity/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Unity generated files
2+
/UIElementsSchema
3+
/[Ll]ibrary/
4+
/[Tt]emp/
5+
/Logs/
6+
/ProjectSettings/UnityConnectSettings.asset
7+
/*.csproj
8+
/*.sln
9+
10+
# Build artifacts
11+
/build/
12+
13+
# SpatialOS Generated Files
14+
/Assets/Generated/Source.meta
15+
/Assets/Generated/Source/**/*.*
16+
/Assets/Generated/Editor.meta
17+
/Assets/Generated/Editor/**/*.*
18+
19+
# OLD Plugins folder
20+
/Assets/Plugins/Improbable/
21+
/Assets/Plugins/Improbable.meta
22+
23+
# Jetbrains
24+
/Assets/Plugins/Editor/Jetbrains
25+
/Assets/Plugins/Editor/Jetbrains.meta

workers/unity/Assets/BlankProject.asmdef renamed to workers/unity/Assets/BlankProject/BlankProject.asmdef

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"Improbable.Gdk.Mobile",
77
"Improbable.Gdk.PlayerLifecycle",
88
"Improbable.Gdk.QueryBasedInterestHelper",
9+
"Improbable.Gdk.GameObjectCreation",
910
"Unity.Entities",
1011
"Unity.Entities.Hybrid",
1112
"Unity.Mathematics"
@@ -17,5 +18,6 @@
1718
"precompiledReferences": [],
1819
"autoReferenced": true,
1920
"defineConstraints": [],
20-
"versionDefines": []
21-
}
21+
"versionDefines": [],
22+
"noEngineReferences": false
23+
}
File renamed without changes.

workers/unity/Assets/BlankProject/Scripts/Workers/MobileClientWorkerConnector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using Improbable.Gdk.Core;
3+
using Improbable.Gdk.Core.Representation;
4+
using Improbable.Gdk.GameObjectCreation;
35
using Improbable.Gdk.Mobile;
46
using Improbable.Gdk.PlayerLifecycle;
57
using UnityEngine;
@@ -8,6 +10,8 @@ namespace BlankProject
810
{
911
public class MobileClientWorkerConnector : WorkerConnector, MobileConnectionFlowInitializer.IMobileSettingsProvider
1012
{
13+
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;
14+
1115
#pragma warning disable 649
1216
[SerializeField] private string ipAddress;
1317
#pragma warning restore 649
@@ -45,6 +49,7 @@ public async void Start()
4549
protected override void HandleWorkerConnectionEstablished()
4650
{
4751
PlayerLifecycleHelper.AddClientSystems(Worker.World);
52+
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
4853
}
4954

5055
public Option<string> GetReceptionistHostIp()

workers/unity/Assets/BlankProject/Scripts/Workers/UnityClientConnector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
using System;
22
using Improbable.Gdk.Core;
3+
using Improbable.Gdk.Core.Representation;
4+
using Improbable.Gdk.GameObjectCreation;
35
using Improbable.Gdk.PlayerLifecycle;
46
using UnityEngine;
57

68
namespace BlankProject
79
{
810
public class UnityClientConnector : WorkerConnector
911
{
12+
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;
13+
1014
public const string WorkerType = "UnityClient";
1115

1216
private async void Start()
@@ -42,6 +46,7 @@ private async void Start()
4246
protected override void HandleWorkerConnectionEstablished()
4347
{
4448
PlayerLifecycleHelper.AddClientSystems(Worker.World);
49+
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
4550
}
4651
}
4752
}

workers/unity/Assets/BlankProject/Scripts/Workers/UnityGameLogicConnector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using BlankProject.Scripts.Config;
22
using Improbable.Gdk.Core;
3+
using Improbable.Gdk.Core.Representation;
4+
using Improbable.Gdk.GameObjectCreation;
35
using Improbable.Gdk.PlayerLifecycle;
46
using Improbable.Worker.CInterop;
57
using UnityEngine;
@@ -8,6 +10,8 @@ namespace BlankProject
810
{
911
public class UnityGameLogicConnector : WorkerConnector
1012
{
13+
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;
14+
1115
public const string WorkerType = "UnityGameLogic";
1216

1317
private async void Start()
@@ -41,6 +45,7 @@ protected override void HandleWorkerConnectionEstablished()
4145
{
4246
Worker.World.GetOrCreateSystem<MetricSendSystem>();
4347
PlayerLifecycleHelper.AddServerSystems(Worker.World);
48+
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
4449
}
4550
}
4651
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: f0598980a22146e5bb63df7b024cf2b0, type: 3}
13+
m_Name: ClientPrefabMapping
14+
m_EditorClassIdentifier:
15+
EntityRepresentationResolvers: []
16+
references:
17+
version: 1

0 commit comments

Comments
 (0)