Skip to content

Commit

Permalink
updated Unity and added compass
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbourgeois committed Aug 29, 2023
1 parent fdaad5c commit e022872
Show file tree
Hide file tree
Showing 40 changed files with 1,553 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Assets/Resources.meta

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

1 change: 1 addition & 0 deletions Assets/Resources/BillingMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"androidStore":"GooglePlay"}
7 changes: 7 additions & 0 deletions Assets/Resources/BillingMode.json.meta

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

18 changes: 16 additions & 2 deletions Assets/Scripts/SensorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Net;
using UnityEngine;
using UnityEngine.Networking.NetworkSystem;
using UnityEngine.UI;
using UnityOSC;

Expand Down Expand Up @@ -40,20 +39,26 @@ public int TargetPort

public bool sendAccelerometer;
public bool sendGyroscope;
public bool sendCompass;
public bool sendTouch;

public string accelerometerValue;
public string gyroscopeValue;
public string compassValue;
public int touchCount;

public string accelerometerOSCAddress = "/device/accelerometer";
public string gyroscopeOSCAddress = "/device/gyroscope";
public string compassOSCAddress = "/device/compass";
public string touchOSCAddress = "/device/touch/";

private string OSCClientName = "CaptainSensor";

void Start ()
{
Input.compass.enabled = true;
Input.gyro.enabled = true;

Connect();
}

Expand Down Expand Up @@ -97,7 +102,6 @@ void Update ()

if (sendGyroscope)
{
Input.gyro.enabled = true;
var message = new OSCMessage(gyroscopeOSCAddress);
message.Append(Input.gyro.attitude.x);
message.Append(Input.gyro.attitude.y);
Expand All @@ -108,6 +112,16 @@ void Update ()
gyroscopeValue = Input.gyro.attitude.ToString();
}

if (sendCompass)
{
var message = new OSCMessage(compassOSCAddress);
message.Append(Input.compass.trueHeading);
message.Append(Input.compass.magneticHeading);
OSCMaster.SendMessageUsingClient(OSCClientName, message);

compassValue = Input.compass.trueHeading + " " + Input.compass.magneticHeading;
}

if (sendTouch)
{
if (!touchOSCAddress.EndsWith("/"))
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/SensorManagerControllable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public class SensorManagerControllable : Controllable
[OSCProperty]
public string gyroscopeOSCAddress;

[Header("Compass")]
[OSCProperty]
public bool sendCompass;
[OSCProperty(isInteractible = false)]
public string compassValue;
[OSCProperty]
public string compassOSCAddress;

[Header("Touch")]
[OSCProperty]
public bool sendTouch;
Expand Down
Binary file modified Assets/main.unity
Binary file not shown.
Empty file added Logs/AssetImportWorker0.log
Empty file.
Empty file added Logs/AssetImportWorker1.log
Empty file.
25 changes: 25 additions & 0 deletions Logs/Packages-Update.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

=== Tue Aug 29 15:42:52 2023

Packages were changed.
Update Mode: updateDependencies

The following packages were added:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
The following packages were updated:
com.unity.ads from version 2.3.1 to 4.4.2
com.unity.analytics from version 3.2.2 to 3.6.12
com.unity.collab-proxy from version 1.2.15 to 2.0.5
com.unity.purchasing from version 2.0.3 to 4.9.3
com.unity.textmeshpro from version 1.3.0 to 3.0.6
The following packages were removed:
[email protected]
3 changes: 3 additions & 0 deletions Logs/shadercompiler-AssetImportWorker0.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Base path: 'C:/Program Files/Unity/Hub/Editor/2021.3.29f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2021.3.29f1/Editor/Data/PlaybackEngines'
Cmd: initializeCompiler

96 changes: 96 additions & 0 deletions Logs/shadercompiler-UnityShaderCompiler.exe0.log

Large diffs are not rendered by default.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
21 changes: 15 additions & 6 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"dependencies": {
"com.unity.ads": "2.3.1",
"com.unity.analytics": "3.2.2",
"com.unity.collab-proxy": "1.2.15",
"com.unity.package-manager-ui": "2.0.3",
"com.unity.purchasing": "2.0.3",
"com.unity.textmeshpro": "1.3.0",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "4.4.2",
"com.unity.analytics": "3.6.12",
"com.unity.collab-proxy": "2.0.5",
"com.unity.ide.rider": "3.0.24",
"com.unity.ide.visualstudio": "2.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.purchasing": "4.9.3",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.5",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.10",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
Expand Down
Loading

0 comments on commit e022872

Please sign in to comment.