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

Commit

Permalink
Entity representation (#111)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zeroZshadow authored and jamiebrynes7 committed Jul 20, 2020
1 parent 882fd59 commit cc01d78
Show file tree
Hide file tree
Showing 21 changed files with 112 additions and 27 deletions.
24 changes: 3 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
/build
/workers/unity/build/
/logs/
.spatialos/
.idea/
.vs/
.gradle/
.DS_Store
DevAuthToken.txt*

#Unity Engine Gitignore (https://github.com/github/gitignore/blob/master/Unity.gitignore)
workers/unity/[Ll]ibrary/
workers/unity/[Tt]emp/
workers/unity/Logs/
[Oo]bj/
[Bb]in/
workers/unity/ProjectSettings/UnityConnectSettings.asset

# Autogenerated VS/MD/Consulo solution and project files
workers/unity/*.csproj
workers/unity/*.sln
*.unityproj
*.suo
*.tmp
Expand All @@ -33,21 +27,9 @@ sysinfo.txt
# Builds
*.apk
*.unitypackage
*.trace

# Generated code
# We need to include some of the generated code below, which means we can't use a `directory/` ignore.
# Once a directory is ignored by git, nothing underneath it can ever be un-ignored.
workers/unity/Assets/Generated/Source.meta
workers/unity/Assets/Generated/Source/**/*.*

workers/unity/Assets/Plugins/Editor/
workers/unity/Assets/Plugins/Editor.meta

workers/unity/Assets/Plugins/Improbable/
workers/unity/Assets/Plugins/Improbable.meta

# Schema from Unity Package Manager Packages (Copied via tools/CopySchema)
schema/from_gdk_packages
_ReSharper.Caches

.shared-ci/
perftest-results/
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@

## Unreleased

### Breaking Changes

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

### Added

- Enabled GameObject Creation by default using the new Entity Representation assets. [#111](https://github.com/spatialos/gdk-for-unity-blank-project/pull/111)
- The prefab mapping assets can be found in `Assets/Config`.
- Prefabs no longer need to be stored in `Resources`.

## `0.3.7` - 2020-06-22

### Changed

- Upgraded to GDK for Unity version `0.3.7`

### Removed

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

- Upgraded to GDK for Unity version `0.3.2`

## `0.3.1` - 2019-11-25

### Changed

- Upgraded to GDK for Unity version `0.3.1`

## `0.3.0` - 2019-11-11

### Changed
Expand Down
2 changes: 1 addition & 1 deletion gdk.pinned
Original file line number Diff line number Diff line change
@@ -1 +1 @@
develop 46be8d892f3d1a1ddd62d202200c0c227a02ca4a
develop da81d115c675dc6e2ad1226a149740974a260ba6
25 changes: 25 additions & 0 deletions workers/unity/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Unity generated files
/UIElementsSchema
/[Ll]ibrary/
/[Tt]emp/
/Logs/
/ProjectSettings/UnityConnectSettings.asset
/*.csproj
/*.sln

# Build artifacts
/build/

# SpatialOS Generated Files
/Assets/Generated/Source.meta
/Assets/Generated/Source/**/*.*
/Assets/Generated/Editor.meta
/Assets/Generated/Editor/**/*.*

# OLD Plugins folder
/Assets/Plugins/Improbable/
/Assets/Plugins/Improbable.meta

# Jetbrains
/Assets/Plugins/Editor/Jetbrains
/Assets/Plugins/Editor/Jetbrains.meta
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Improbable.Gdk.Mobile",
"Improbable.Gdk.PlayerLifecycle",
"Improbable.Gdk.QueryBasedInterestHelper",
"Improbable.Gdk.GameObjectCreation",
"Unity.Entities",
"Unity.Entities.Hybrid",
"Unity.Mathematics"
Expand All @@ -17,5 +18,6 @@
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}
"versionDefines": [],
"noEngineReferences": false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using Improbable.Gdk.Core;
using Improbable.Gdk.Core.Representation;
using Improbable.Gdk.GameObjectCreation;
using Improbable.Gdk.Mobile;
using Improbable.Gdk.PlayerLifecycle;
using UnityEngine;
Expand All @@ -8,6 +10,8 @@ namespace BlankProject
{
public class MobileClientWorkerConnector : WorkerConnector, MobileConnectionFlowInitializer.IMobileSettingsProvider
{
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;

#pragma warning disable 649
[SerializeField] private string ipAddress;
#pragma warning restore 649
Expand Down Expand Up @@ -45,6 +49,7 @@ public async void Start()
protected override void HandleWorkerConnectionEstablished()
{
PlayerLifecycleHelper.AddClientSystems(Worker.World);
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
}

public Option<string> GetReceptionistHostIp()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
using System;
using Improbable.Gdk.Core;
using Improbable.Gdk.Core.Representation;
using Improbable.Gdk.GameObjectCreation;
using Improbable.Gdk.PlayerLifecycle;
using UnityEngine;

namespace BlankProject
{
public class UnityClientConnector : WorkerConnector
{
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;

public const string WorkerType = "UnityClient";

private async void Start()
Expand Down Expand Up @@ -42,6 +46,7 @@ private async void Start()
protected override void HandleWorkerConnectionEstablished()
{
PlayerLifecycleHelper.AddClientSystems(Worker.World);
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using BlankProject.Scripts.Config;
using Improbable.Gdk.Core;
using Improbable.Gdk.Core.Representation;
using Improbable.Gdk.GameObjectCreation;
using Improbable.Gdk.PlayerLifecycle;
using Improbable.Worker.CInterop;
using UnityEngine;
Expand All @@ -8,6 +10,8 @@ namespace BlankProject
{
public class UnityGameLogicConnector : WorkerConnector
{
[SerializeField] private EntityRepresentationMapping entityRepresentationMapping = default;

public const string WorkerType = "UnityGameLogic";

private async void Start()
Expand Down Expand Up @@ -41,6 +45,7 @@ protected override void HandleWorkerConnectionEstablished()
{
Worker.World.GetOrCreateSystem<MetricSendSystem>();
PlayerLifecycleHelper.AddServerSystems(Worker.World);
GameObjectCreationHelper.EnableStandardGameObjectCreation(Worker.World, entityRepresentationMapping);
}
}
}
17 changes: 17 additions & 0 deletions workers/unity/Assets/Config/ClientPrefabMapping.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f0598980a22146e5bb63df7b024cf2b0, type: 3}
m_Name: ClientPrefabMapping
m_EditorClassIdentifier:
EntityRepresentationResolvers: []
references:
version: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions workers/unity/Assets/Config/GamelogicPrefabMapping.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f0598980a22146e5bb63df7b024cf2b0, type: 3}
m_Name: GamelogicPrefabMapping
m_EditorClassIdentifier:
EntityRepresentationResolvers: []
references:
version: 1
8 changes: 8 additions & 0 deletions workers/unity/Assets/Config/GamelogicPrefabMapping.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaxConnectionAttempts: 3
entityRepresentationMapping: {fileID: 11400000, guid: 4e53a77235830e14ebca570b4ea233dc,
type: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaxConnectionAttempts: 3
entityRepresentationMapping: {fileID: 11400000, guid: d7177170b2dc0444f82f6d4d018797e0,
type: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaxConnectionAttempts: 3
entityRepresentationMapping: {fileID: 11400000, guid: 4e53a77235830e14ebca570b4ea233dc,
type: 2}
ipAddress:

0 comments on commit cc01d78

Please sign in to comment.