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

Release 0.1.4 Prep #20

Merged
merged 9 commits into from Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,15 @@

## Unreleased

### Added

- Added support for connecting mobile clients to cloud deployments.

### Changed

- Upgraded the project to be compatible with `2018.3.2f1`.


jamiebrynes7 marked this conversation as resolved.
Show resolved Hide resolved
## `0.1.3` - 2018-11-26

### Added
Expand Down
2 changes: 1 addition & 1 deletion gdk.pinned
@@ -1 +1 @@
0.1.3
dcb31fa5ccb38a5f4dc15e8f0b3559a2ec351cbf
18 changes: 18 additions & 0 deletions workers/unity/Assets/Config/BuildConfiguration.asset
Expand Up @@ -30,4 +30,22 @@ MonoBehaviour:
CloudBuildConfig:
BuildPlatforms: 8
BuildOptions: 16384
- WorkerType: AndroidClient
ScenesForWorker:
- {fileID: 102900000, guid: 17bd667c9bc89cf4b8c402299c7aa813, type: 3}
LocalBuildConfig:
BuildPlatforms: 32
BuildOptions: 1
CloudBuildConfig:
BuildPlatforms: 32
BuildOptions: 0
- WorkerType: iOSClient
ScenesForWorker:
- {fileID: 102900000, guid: 41a2e6f1d4e756248b31ad0e94d13def, type: 3}
LocalBuildConfig:
BuildPlatforms: 64
BuildOptions: 1
CloudBuildConfig:
BuildPlatforms: 64
BuildOptions: 0
isInitialised: 1
25 changes: 11 additions & 14 deletions workers/unity/Assets/Editor/SnapshotGenerator/SnapshotGenerator.cs
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using Improbable;
using Improbable.Gdk.Core;
using Improbable.PlayerLifecycle;
using UnityEngine;
Expand All @@ -12,9 +12,6 @@ public struct Arguments
{
public string OutputPath;
}

private static readonly List<string> UnityWorkers =
new List<string> { UnityClientConnector.WorkerType, UnityGameLogicConnector.WorkerType };

public static void Generate(Arguments arguments)
{
Expand All @@ -35,18 +32,18 @@ private static Snapshot CreateSnapshot()

private static void AddPlayerSpawner(Snapshot snapshot)
{
var playerCreator = PlayerCreator.Component.CreateSchemaComponentData();
var serverAttribute = UnityGameLogicConnector.WorkerType;

var spawner = EntityBuilder.Begin()
.AddPosition(0, 0, 0, serverAttribute)
.AddMetadata("PlayerCreator", serverAttribute)
.SetPersistence(true)
.SetReadAcl(UnityWorkers)
.AddComponent(playerCreator, serverAttribute)
.Build();

snapshot.AddEntity(spawner);
var template = new EntityTemplate();
template.AddComponent(new Position.Snapshot(), serverAttribute);
template.AddComponent(new Metadata.Snapshot { EntityType = "PlayerCreator" }, serverAttribute);
template.AddComponent(new Persistence.Snapshot(), serverAttribute);
template.AddComponent(new PlayerCreator.Snapshot(), serverAttribute);

template.SetReadAccess(UnityClientConnector.WorkerType, UnityGameLogicConnector.WorkerType, AndroidClientWorkerConnector.WorkerType, iOSClientWorkerConnector.WorkerType);
template.SetComponentWriteAccess(EntityAcl.ComponentId, serverAttribute);

snapshot.AddEntity(template);
}
}
}
2 changes: 1 addition & 1 deletion workers/unity/Assets/Plugins.meta

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

3 changes: 2 additions & 1 deletion workers/unity/Assets/Scenes/AndroidClientScene.unity
Expand Up @@ -276,8 +276,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaxConnectionAttempts: 3
UseExternalIp: 1
DevelopmentAuthToken:
ipAddress:
shouldConnectLocally: 0
--- !u!4 &2018455278
Transform:
m_ObjectHideFlags: 0
Expand Down
3 changes: 2 additions & 1 deletion workers/unity/Assets/Scenes/iOSClientScene.unity
Expand Up @@ -207,8 +207,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaxConnectionAttempts: 3
UseExternalIp: 1
DevelopmentAuthToken:
ipAddress:
shouldConnectLocally: 0
--- !u!4 &956923360
Transform:
m_ObjectHideFlags: 0
Expand Down
Expand Up @@ -15,12 +15,18 @@ public class AndroidClientWorkerConnector : MobileWorkerConnector
public const string WorkerType = "AndroidClient";

[SerializeField] private string ipAddress;
[SerializeField] private bool shouldConnectLocally;

private async void Start()
{
await Connect(WorkerType, new ForwardingDispatcher()).ConfigureAwait(false);
}

protected override ConnectionService GetConnectionService()
{
return shouldConnectLocally ? ConnectionService.Receptionist : ConnectionService.AlphaLocator;
}

protected override void HandleWorkerConnectionEstablished()
{
PlayerLifecycleHelper.AddClientSystems(Worker.World);
Expand Down
23 changes: 10 additions & 13 deletions workers/unity/Assets/Scripts/Workers/UnityGameLogicConnector.cs
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using Improbable;
using Improbable.Gdk.Core;
using Improbable.Gdk.PlayerLifecycle;
using Improbable.Gdk.TransformSynchronization;
Expand All @@ -9,9 +9,6 @@ public class UnityGameLogicConnector : DefaultWorkerConnector
{
public const string WorkerType = "UnityGameLogic";

private static readonly List<string> AllWorkerAttributes =
new List<string> { UnityClientConnector.WorkerType, WorkerType };

private async void Start()
{
PlayerLifecycleConfig.CreatePlayerEntityTemplate = CreatePlayerEntityTemplate;
Expand All @@ -29,16 +26,16 @@ private static EntityTemplate CreatePlayerEntityTemplate(string workerId, Improb
var clientAttribute = $"workerId:{workerId}";
var serverAttribute = WorkerType;

var entityBuilder = EntityBuilder.Begin()
.AddPosition(0, 0, 0, serverAttribute)
.AddMetadata("Player", serverAttribute)
.SetPersistence(false)
.SetReadAcl(AllWorkerAttributes)
.SetEntityAclComponentWriteAccess(serverAttribute)
.AddPlayerLifecycleComponents(workerId, clientAttribute, serverAttribute)
.AddTransformSynchronizationComponents(clientAttribute);
var template = new EntityTemplate();
template.AddComponent(new Position.Snapshot(), clientAttribute);
template.AddComponent(new Metadata.Snapshot { EntityType = "Player" }, serverAttribute);
TransformSynchronizationHelper.AddTransformSynchronizationComponents(template, clientAttribute);
PlayerLifecycleHelper.AddPlayerLifecycleComponents(template, workerId, clientAttribute, serverAttribute);

template.SetReadAccess(UnityClientConnector.WorkerType, AndroidClientWorkerConnector.WorkerType, iOSClientWorkerConnector.WorkerType, serverAttribute);
template.SetComponentWriteAccess(EntityAcl.ComponentId, serverAttribute);

return entityBuilder.Build();
return template;
}
}
}
Expand Up @@ -14,12 +14,18 @@ public class iOSClientWorkerConnector : MobileWorkerConnector
public const string WorkerType = "iOSClient";

[SerializeField] private string ipAddress;
[SerializeField] private bool shouldConnectLocally;

private async void Start()
{
await Connect(WorkerType, new ForwardingDispatcher()).ConfigureAwait(false);
}

protected override ConnectionService GetConnectionService()
{
return shouldConnectLocally ? ConnectionService.Receptionist : ConnectionService.AlphaLocator;
}

protected override void HandleWorkerConnectionEstablished()
{
PlayerLifecycleHelper.AddClientSystems(Worker.World);
Expand Down
6 changes: 3 additions & 3 deletions workers/unity/Packages/manifest.json
Expand Up @@ -9,10 +9,10 @@
"com.improbable.gdk.tools": "file:../../../../gdk-for-unity/workers/unity/Packages/com.improbable.gdk.tools",
"com.improbable.gdk.transformsynchronization": "file:../../../../gdk-for-unity/workers/unity/Packages/com.improbable.gdk.transformsynchronization",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "2.0.16",
"com.unity.package-manager-ui": "1.9.11",
"com.unity.analytics": "3.2.2",
"com.unity.package-manager-ui": "2.0.3",
"com.unity.purchasing": "2.0.3",
"com.unity.textmeshpro": "1.2.4",
"com.unity.textmeshpro": "1.3.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
Expand Down
102 changes: 99 additions & 3 deletions workers/unity/ProjectSettings/ProjectSettings.asset
Expand Up @@ -125,6 +125,7 @@ PlayerSettings:
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 0
xboxOneEnable7thCore: 0
isWsaHolographicRemotingEnabled: 0
vrSettings:
cardboard:
depthFormat: 0
Expand Down Expand Up @@ -163,7 +164,7 @@ PlayerSettings:
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceInternetPermission: 1
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
Expand Down Expand Up @@ -259,7 +260,99 @@ PlayerSettings:
androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: []
m_BuildTargetPlatformIcons:
- m_BuildTarget: Android
m_Icons:
- m_Textures: []
m_Width: 432
m_Height: 432
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 324
m_Height: 324
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 216
m_Height: 216
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 162
m_Height: 162
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 108
m_Height: 108
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 81
m_Height: 81
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 1
m_SubKind:
m_BuildTargetBatching:
- m_BuildTarget: Standalone
m_StaticBatching: 1
Expand Down Expand Up @@ -426,6 +519,7 @@ PlayerSettings:
switchAllowsVideoCapturing: 1
switchAllowsRuntimeAddOnContentInstall: 0
switchDataLossConfirmation: 0
switchUserAccountLockEnabled: 0
switchSupportedNpadStyles: 3
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
Expand Down Expand Up @@ -574,7 +668,9 @@ PlayerSettings:
scriptingDefineSymbols:
1:
platformArchitecture: {}
scriptingBackend: {}
scriptingBackend:
Android: 0
Standalone: 0
il2cppCompilerConfiguration: {}
incrementalIl2cppBuild: {}
allowUnsafeCode: 0
Expand Down
2 changes: 1 addition & 1 deletion workers/unity/ProjectSettings/ProjectVersion.txt
@@ -1 +1 @@
m_EditorVersion: 2018.2.14f1
m_EditorVersion: 2018.3.2f1
11 changes: 11 additions & 0 deletions workers/unity/ProjectSettings/VFXManager.asset
@@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!937362698 &1
VFXManager:
m_ObjectHideFlags: 0
m_IndirectShader: {fileID: 0}
m_CopyBufferShader: {fileID: 0}
m_SortShader: {fileID: 0}
m_RenderPipeSettingsPath:
m_FixedTimeStep: 0.016666668
m_MaxDeltaTime: 0.05