Skip to content

Commit

Permalink
Merge develop (#18)
Browse files Browse the repository at this point in the history
* upgrade to package v0.9.3

* bump project version to 1.4
  • Loading branch information
aranlunzer authored Apr 19, 2024
1 parent 06bad68 commit bc72ee3
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 117 deletions.
6 changes: 3 additions & 3 deletions unity/Assets/CroquetJS/guardians/Actors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// The flat world is placed on a Perlin noise generated surface in the view, but all interactions including
// driving and collisions are computed in 2D.

import { Constants, Actor, mix, AM_Spatial, AM_Behavioral, v3_add, v3_sub, UserManager, User, AM_Avatar, q_axisAngle, v3_normalize, v3_rotate, AM_Grid, AM_OnGrid } from "@croquet/worldcore-kernel";
import { Constants, Actor, mix, AM_Spatial, AM_Behavioral, AM_Drivable, v3_add, v3_sub, UserManager, User, q_axisAngle, v3_normalize, v3_rotate, AM_Grid, AM_OnGrid } from "@croquet/worldcore-kernel";
import { GameModelRoot } from "@croquet/game-models";

Constants.versionBump = 0; // change this to force model to be rebuilt
Expand Down Expand Up @@ -243,10 +243,10 @@ MissileActor.register('MissileActor');

//------------------------------------------------------------------------------------------
//-- AvatarActor ---------------------------------------------------------------------------
// This is you. Most of the control code for the avatar is in the pawn in Avatar.js.
// This is you. Most of the control code for the avatar is on the C# side.
//------------------------------------------------------------------------------------------

class AvatarActor extends mix(Actor).with(AM_Spatial, AM_Avatar, AM_OnGrid) {
class AvatarActor extends mix(Actor).with(AM_Spatial, AM_Drivable, AM_OnGrid) {
get pawn() { return "AvatarPawn" }
get gamePawnType() { return "tank" }

Expand Down
8 changes: 0 additions & 8 deletions unity/Assets/Plugins.meta

This file was deleted.

21 changes: 0 additions & 21 deletions unity/Assets/Plugins/websocket-sharp-LICENSE.txt

This file was deleted.

7 changes: 0 additions & 7 deletions unity/Assets/Plugins/websocket-sharp-LICENSE.txt.meta

This file was deleted.

Binary file removed unity/Assets/Plugins/websocket-sharp.dll
Binary file not shown.
33 changes: 0 additions & 33 deletions unity/Assets/Plugins/websocket-sharp.dll.meta

This file was deleted.

2 changes: 1 addition & 1 deletion unity/Assets/Prefabs/Tank/Tank.prefab

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

20 changes: 10 additions & 10 deletions unity/Assets/Scenes/Guardians.unity

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

20 changes: 10 additions & 10 deletions unity/Assets/Scenes/SessionChooser.unity

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

16 changes: 14 additions & 2 deletions unity/Assets/Scripts/AssignFollowCamTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ public class AssignFollowCamTarget : MonoBehaviour

void Awake()
{
Croquet.Subscribe("croquet", "sceneRunning", CroquetSceneRunning);
// in case the scene is reloaded, make sure the original camera lives on
// and that no duplicate camera - with duplicate subscriptions - is started up.
GameObject[] objs = GameObject.FindGameObjectsWithTag("MainCamera");
if (objs.Length > 1)
{
Destroy(gameObject);
}
else
{
DontDestroyOnLoad(gameObject);

Croquet.Subscribe("croquet", "sceneRunning", CroquetSceneRunning);
}
}

void Update()
{
CroquetAvatarComponent a = CroquetAvatarSystem.Instance.GetActiveAvatarComponent();
CroquetDrivableComponent a = CroquetDrivableSystem.Instance.GetActiveDrivableComponent();

if ( a != null)
{
Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Scripts/RaiseAlignToTerrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void Align()
if (objectIsStatic)
{
int croquetHandle = gameObject.GetComponent<CroquetEntityComponent>().croquetHandle;
CroquetSpatialSystem.Instance.SnapObjectTo(croquetHandle, transform.position, transform.rotation);
CroquetSpatialSystem.Instance.DrivePawn(croquetHandle, transform.position, transform.rotation);
}
}
}
12 changes: 6 additions & 6 deletions unity/Assets/Scripts/moveAround.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class moveAround : MonoBehaviour, ICroquetDriven
// private float computedSpeed;

private int croquetHandle;
private CroquetAvatarComponent avatarComponent;
private CroquetDrivableComponent drivableComponent;
private GameState gameState;

private float lastShootTime = 0;
Expand All @@ -34,12 +34,12 @@ void Start()

public void PawnInitializationComplete() {
croquetHandle = gameObject.GetComponent<CroquetEntityComponent>().croquetHandle;
avatarComponent = gameObject.GetComponent<CroquetAvatarComponent>();
drivableComponent = gameObject.GetComponent<CroquetDrivableComponent>();
}

void Update()
{
if (avatarComponent == null) return;
if (drivableComponent == null) return;

if (gameState == null)
{
Expand All @@ -52,7 +52,7 @@ void Update()
if (gameState == null) return;
}

if (CroquetAvatarSystem.Instance.GetActiveAvatarComponent() == avatarComponent && !gameState.gameEnded)
if (CroquetDrivableSystem.Instance.GetActiveDrivableComponent() == drivableComponent && !gameState.gameEnded)
{
// it's the active avatar, and we're live in a game - so perhaps moving, perhaps shooting
float horizontal = Input.GetAxis("Horizontal");
Expand All @@ -73,8 +73,8 @@ void Update()

AlignWithTerrain();

CroquetSpatialSystem.Instance.SnapObjectTo(croquetHandle, transform.position, transform.rotation);
CroquetSpatialSystem.Instance.SnapObjectInCroquet(croquetHandle, transform.position, transform.rotation);
CroquetSpatialSystem.Instance.DrivePawn(croquetHandle, transform.position, transform.rotation);
CroquetSpatialSystem.Instance.DriveActor(croquetHandle, false, transform.position, transform.rotation);

positionHasBeenInitialized = true;
}
Expand Down
5 changes: 2 additions & 3 deletions unity/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"com.unity.addressables": "1.19.19",
"com.unity.collab-proxy": "2.0.0",
"com.unity.ide.rider": "3.0.18",
"com.unity.ide.visualstudio": "2.0.17",
"com.unity.ide.vscode": "1.2.5",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.inputsystem": "1.5.0",
"com.unity.postprocessing": "3.2.2",
"com.unity.render-pipelines.universal": "12.1.10",
Expand All @@ -15,7 +14,7 @@
"com.unity.toolchain.macos-arm64-linux-x86_64": "1.0.1",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.8.0",
"io.croquet.multiplayer": "https://github.com/croquet/croquet-for-unity-package.git#v0.9.0",
"io.croquet.multiplayer": "https://github.com/croquet/croquet-for-unity-package.git#v0.9.3",
"net.gree.unity-webview": "https://github.com/gree/unity-webview.git?path=/dist/package-nofragment",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
15 changes: 4 additions & 11 deletions unity/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,14 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.17",
"version": "2.0.22",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.5.0",
"depth": 0,
Expand Down Expand Up @@ -215,21 +208,21 @@
"url": "https://packages.unity.com"
},
"io.croquet.multiplayer": {
"version": "https://github.com/croquet/croquet-for-unity-package.git#v0.9.0",
"version": "https://github.com/croquet/croquet-for-unity-package.git#v0.9.3",
"depth": 0,
"source": "git",
"dependencies": {
"com.unity.addressables": "1.19.19",
"com.unity.inputsystem": "1.5.0"
},
"hash": "9bddf70f2e43a0ef777ac04e8fcf6a15bfcc322e"
"hash": "bbee80e755e85fbc0ec84fe4d02682df676d650f"
},
"net.gree.unity-webview": {
"version": "https://github.com/gree/unity-webview.git?path=/dist/package-nofragment",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "3647674386e3c844aa416fc744905b8286c56616"
"hash": "ac07c49acc27e72b2939c4be70bd5d05b1308855"
},
"com.unity.modules.ai": {
"version": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion unity/ProjectSettings/ProjectSettings.asset

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

0 comments on commit bc72ee3

Please sign in to comment.