Compare commits
No commits in common. "803e87688ae9a3540f5395a34bf486d49b08f7b5" and "a8568685abe557156f5a905411c023fec338dc41" have entirely different histories.
803e87688a
...
a8568685ab
@ -1,34 +1,24 @@
|
|||||||
using _PROJECT.NewHandPresence;
|
|
||||||
using FishNet;
|
using FishNet;
|
||||||
using FishNet.Discovery;
|
using FishNet.Discovery;
|
||||||
using FishNet.Managing.Scened;
|
|
||||||
using FishNet.Object;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using Unity.XR.CoreUtils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class NetworkMenuUI : MonoBehaviour
|
public class NetworkMenuUI : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("UI References")]
|
[Header("UI References")]
|
||||||
public Toggle VRToggle;
|
|
||||||
|
|
||||||
public Button startPlayingButton;
|
public Button startPlayingButton;
|
||||||
public Button reloadButton;
|
|
||||||
public Button joinMultiplayerButton;
|
public Button joinMultiplayerButton;
|
||||||
public Transform serverListContainer;
|
public Transform serverListContainer;
|
||||||
public GameObject serverListItemPrefab;
|
public GameObject serverListItemPrefab;
|
||||||
public TMP_Text statusText;
|
public TMP_Text statusText;
|
||||||
public Button quitButton;
|
|
||||||
|
|
||||||
[Header("Networking")]
|
[Header("Networking")]
|
||||||
public NetworkDiscovery networkDiscovery;
|
public NetworkDiscovery networkDiscovery;
|
||||||
public Camera uiCamera;
|
public Camera uiCamera; // Optional, disable if connecting
|
||||||
public AudioListener placeholderAudioListener;
|
|
||||||
private bool _useVR;
|
|
||||||
//public Image coverImage;
|
//public Image coverImage;
|
||||||
|
|
||||||
private readonly List<IPEndPoint> foundServers = new();
|
private readonly List<IPEndPoint> foundServers = new();
|
||||||
@ -38,22 +28,8 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
if (networkDiscovery == null)
|
if (networkDiscovery == null)
|
||||||
networkDiscovery = FindObjectOfType<NetworkDiscovery>();
|
networkDiscovery = FindObjectOfType<NetworkDiscovery>();
|
||||||
|
|
||||||
_useVR = PlayerPrefs.GetInt("UseVR", 0) == 1;
|
|
||||||
VRToggle.isOn = _useVR;
|
|
||||||
|
|
||||||
// React to UI toggle changes
|
|
||||||
VRToggle.onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
_useVR = isOn;
|
|
||||||
PlayerPrefs.SetInt("UseVR", _useVR ? 1 : 0);
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
Debug.Log($"UseVR set to {_useVR}");
|
|
||||||
});
|
|
||||||
|
|
||||||
startPlayingButton.onClick.AddListener(OnStartPlaying);
|
startPlayingButton.onClick.AddListener(OnStartPlaying);
|
||||||
reloadButton.onClick.AddListener(OnReload);
|
|
||||||
joinMultiplayerButton.onClick.AddListener(OnJoinMultiplayer);
|
joinMultiplayerButton.onClick.AddListener(OnJoinMultiplayer);
|
||||||
quitButton.onClick.AddListener(OnQuit);
|
|
||||||
|
|
||||||
networkDiscovery.ServerFoundCallback += OnServerFound;
|
networkDiscovery.ServerFoundCallback += OnServerFound;
|
||||||
}
|
}
|
||||||
@ -65,38 +41,6 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnReload()
|
|
||||||
{
|
|
||||||
/*if (!InstanceFinder.IsClient)
|
|
||||||
{
|
|
||||||
Debug.LogWarning("Reload can only be called from a client!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use the ClientManager.Objects dictionary
|
|
||||||
foreach (NetworkObject obj in InstanceFinder.ClientManager.Objects.)
|
|
||||||
{
|
|
||||||
if (obj.IsOwner) // This ensures it's YOUR local player
|
|
||||||
{
|
|
||||||
var xr = obj.GetComponentInChildren<XROrigin>();
|
|
||||||
if (xr != null)
|
|
||||||
{
|
|
||||||
Debug.Log("Found my XR Origin player.");
|
|
||||||
|
|
||||||
TutorialController tutorial = xr.GetComponent<TutorialController>();
|
|
||||||
if (tutorial != null)
|
|
||||||
{
|
|
||||||
tutorial._state = TutorialController.TutorialState.Initializing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Log("My local player is not an XR Origin.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnJoinMultiplayer()
|
private void OnJoinMultiplayer()
|
||||||
{
|
{
|
||||||
statusText.text = "Searching for servers...";
|
statusText.text = "Searching for servers...";
|
||||||
@ -105,12 +49,6 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
networkDiscovery.StartSearchingForServers();
|
networkDiscovery.StartSearchingForServers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnQuit()
|
|
||||||
{
|
|
||||||
Debug.Log("Quitting application");
|
|
||||||
Application.Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnServerFound(IPEndPoint endPoint)
|
private void OnServerFound(IPEndPoint endPoint)
|
||||||
{
|
{
|
||||||
if (foundServers.Contains(endPoint)) return;
|
if (foundServers.Contains(endPoint)) return;
|
||||||
@ -123,11 +61,9 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
networkDiscovery.StopSearchingForServers();
|
networkDiscovery.StopSearchingForServers();
|
||||||
|
|
||||||
uiCamera.enabled = false;
|
uiCamera.enabled = false;
|
||||||
Debug.Log("Disabled placeholder audio source");
|
|
||||||
placeholderAudioListener.enabled = false;
|
|
||||||
//coverImage.gameObject.SetActive(false);
|
//coverImage.gameObject.SetActive(false);
|
||||||
|
|
||||||
InstanceFinder.ClientManager.StartConnection(endPoint.Address.ToString());
|
InstanceFinder.ClientManager.StartConnection("192.168.42.212");
|
||||||
statusText.text = $"Joined server: {endPoint.Address}";
|
statusText.text = $"Joined server: {endPoint.Address}";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -142,10 +78,6 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
{
|
{
|
||||||
networkDiscovery.StopSearchingForServers();
|
networkDiscovery.StopSearchingForServers();
|
||||||
if (uiCamera != null) uiCamera.enabled = false;
|
if (uiCamera != null) uiCamera.enabled = false;
|
||||||
if (placeholderAudioListener != null) {
|
|
||||||
Debug.Log("Disabled placeholder audio source");
|
|
||||||
placeholderAudioListener.enabled = false;
|
|
||||||
}
|
|
||||||
//coverImage.gameObject.SetActive(false);
|
//coverImage.gameObject.SetActive(false);
|
||||||
InstanceFinder.ClientManager.StartConnection(endPoint.Address.ToString());
|
InstanceFinder.ClientManager.StartConnection(endPoint.Address.ToString());
|
||||||
statusText.text = $"Joined server: {endPoint.Address}";
|
statusText.text = $"Joined server: {endPoint.Address}";
|
||||||
@ -189,12 +121,6 @@ public class NetworkMenuUI : MonoBehaviour
|
|||||||
{
|
{
|
||||||
var firstServer = foundServers[0];
|
var firstServer = foundServers[0];
|
||||||
//networkDiscovery.StopAdvertisingServer();
|
//networkDiscovery.StopAdvertisingServer();
|
||||||
if (uiCamera != null) uiCamera.enabled = false;
|
|
||||||
if (placeholderAudioListener != null)
|
|
||||||
{
|
|
||||||
Debug.Log("Disabled placeholder audio source");
|
|
||||||
placeholderAudioListener.enabled = false;
|
|
||||||
}
|
|
||||||
networkDiscovery.StopSearchingForServers();
|
networkDiscovery.StopSearchingForServers();
|
||||||
InstanceFinder.ClientManager.StartConnection(firstServer.Address.ToString());
|
InstanceFinder.ClientManager.StartConnection(firstServer.Address.ToString());
|
||||||
statusText.text = $"Joined server: {firstServer.Address}";
|
statusText.text = $"Joined server: {firstServer.Address}";
|
||||||
|
@ -8,7 +8,7 @@ namespace _PROJECT.NewHandPresence
|
|||||||
{
|
{
|
||||||
public class TutorialController : MonoBehaviour
|
public class TutorialController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public enum TutorialState
|
private enum State
|
||||||
{
|
{
|
||||||
Initializing,
|
Initializing,
|
||||||
Turn,
|
Turn,
|
||||||
@ -34,7 +34,7 @@ namespace _PROJECT.NewHandPresence
|
|||||||
private SmartHandPresence _leftSmartHandPresence;
|
private SmartHandPresence _leftSmartHandPresence;
|
||||||
private SmartHandPresence _rightSmartHandPresence;
|
private SmartHandPresence _rightSmartHandPresence;
|
||||||
|
|
||||||
public TutorialState _state = TutorialState.Initializing;
|
private State _state = State.Initializing;
|
||||||
|
|
||||||
private Camera _camera;
|
private Camera _camera;
|
||||||
|
|
||||||
@ -45,12 +45,12 @@ namespace _PROJECT.NewHandPresence
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (_state == TutorialState.Initializing)
|
if (_state == State.Initializing)
|
||||||
{
|
{
|
||||||
TryInitialize();
|
TryInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_state == TutorialState.WaitForGrip)
|
if (_state == State.WaitForGrip)
|
||||||
{
|
{
|
||||||
TryFindXRGrabInteractable();
|
TryFindXRGrabInteractable();
|
||||||
}
|
}
|
||||||
@ -76,12 +76,12 @@ namespace _PROJECT.NewHandPresence
|
|||||||
UpdateState(_state.Next());
|
UpdateState(_state.Next());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateState(TutorialState newState)
|
private void UpdateState(State newState)
|
||||||
{
|
{
|
||||||
_state = newState;
|
_state = newState;
|
||||||
Debug.Log($"Tutorial state: {_state}");
|
Debug.Log($"Tutorial state: {_state}");
|
||||||
|
|
||||||
if (_state == TutorialState.Initializing) return;
|
if (_state == State.Initializing) return;
|
||||||
SetHandsVisibility(true);
|
SetHandsVisibility(true);
|
||||||
|
|
||||||
_rightHintController.HideHint();
|
_rightHintController.HideHint();
|
||||||
@ -89,26 +89,26 @@ namespace _PROJECT.NewHandPresence
|
|||||||
|
|
||||||
switch (_state)
|
switch (_state)
|
||||||
{
|
{
|
||||||
case TutorialState.Initializing:
|
case State.Initializing:
|
||||||
break;
|
break;
|
||||||
case TutorialState.Turn:
|
case State.Turn:
|
||||||
ShowTurnHint();
|
ShowTurnHint();
|
||||||
break;
|
break;
|
||||||
case TutorialState.Move:
|
case State.Move:
|
||||||
ShowLocomotionHint();
|
ShowLocomotionHint();
|
||||||
break;
|
break;
|
||||||
case TutorialState.Teleport:
|
case State.Teleport:
|
||||||
ShowTeleportHint();
|
ShowTeleportHint();
|
||||||
break;
|
break;
|
||||||
case TutorialState.WaitForGrip:
|
case State.WaitForGrip:
|
||||||
SetHandsVisibility(true);
|
SetHandsVisibility(true);
|
||||||
break;
|
break;
|
||||||
case TutorialState.Grip:
|
case State.Grip:
|
||||||
SetHandsVisibility(false);
|
SetHandsVisibility(false);
|
||||||
CreateBillboard(_grabInteractable.gameObject, "Grab me!");
|
CreateBillboard(_grabInteractable.gameObject, "Grab me!");
|
||||||
ShowGripHint();
|
ShowGripHint();
|
||||||
break;
|
break;
|
||||||
case TutorialState.Done:
|
case State.Done:
|
||||||
SetHandsVisibility(true);
|
SetHandsVisibility(true);
|
||||||
DestroyBillboard();
|
DestroyBillboard();
|
||||||
break;
|
break;
|
||||||
@ -215,28 +215,28 @@ namespace _PROJECT.NewHandPresence
|
|||||||
|
|
||||||
private void OnGripPerformed(SelectEnterEventArgs arg0)
|
private void OnGripPerformed(SelectEnterEventArgs arg0)
|
||||||
{
|
{
|
||||||
if (_state != TutorialState.Grip) return;
|
if (_state != State.Grip) return;
|
||||||
Debug.Log("Grip performed");
|
Debug.Log("Grip performed");
|
||||||
UpdateState(_state.Next());
|
UpdateState(_state.Next());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTeleportPerformed(LocomotionSystem obj)
|
private void OnTeleportPerformed(LocomotionSystem obj)
|
||||||
{
|
{
|
||||||
if (_state != TutorialState.Teleport) return;
|
if (_state != State.Teleport) return;
|
||||||
Debug.Log("Teleport performed");
|
Debug.Log("Teleport performed");
|
||||||
UpdateState(_state.Next());
|
UpdateState(_state.Next());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMovePerformed(InputAction.CallbackContext obj)
|
private void OnMovePerformed(InputAction.CallbackContext obj)
|
||||||
{
|
{
|
||||||
if (_state != TutorialState.Move) return;
|
if (_state != State.Move) return;
|
||||||
Debug.Log("Move performed");
|
Debug.Log("Move performed");
|
||||||
UpdateState(_state.Next());
|
UpdateState(_state.Next());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTurnPerformed(InputAction.CallbackContext obj)
|
private void OnTurnPerformed(InputAction.CallbackContext obj)
|
||||||
{
|
{
|
||||||
if (_state != TutorialState.Turn) return;
|
if (_state != State.Turn) return;
|
||||||
Debug.Log("Turn performed");
|
Debug.Log("Turn performed");
|
||||||
UpdateState(_state.Next());
|
UpdateState(_state.Next());
|
||||||
}
|
}
|
||||||
|
BIN
Assets/_PROJECT/Components/Overlay UI/UI refresh icon.png
(Stored with Git LFS)
BIN
Assets/_PROJECT/Components/Overlay UI/UI refresh icon.png
(Stored with Git LFS)
Binary file not shown.
@ -1,160 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7d929b603389e5b41a32bc6ea11e38ee
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 12
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 0
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
flipGreenChannel: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
vTOnly: 0
|
|
||||||
ignoreMipmapLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: 1
|
|
||||||
aniso: 1
|
|
||||||
mipBias: 0
|
|
||||||
wrapU: 1
|
|
||||||
wrapV: 1
|
|
||||||
wrapW: 0
|
|
||||||
nPOTScale: 0
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 1
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 1
|
|
||||||
spriteTessellationDetail: -1
|
|
||||||
textureType: 8
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
flipbookRows: 1
|
|
||||||
flipbookColumns: 1
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
ignorePngGamma: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
swizzle: 50462976
|
|
||||||
cookieLightType: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Server
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Windows Store Apps
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites: []
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID: 5e97eb03825dee720800000000000000
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
nameFileIdTable: {}
|
|
||||||
mipmapLimitGroupName:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
Binary file not shown.
BIN
ProjectSettings/ProjectSettings.asset
(Stored with Git LFS)
BIN
ProjectSettings/ProjectSettings.asset
(Stored with Git LFS)
Binary file not shown.
@ -8,10 +8,6 @@
|
|||||||
"name": "Dabest",
|
"name": "Dabest",
|
||||||
"score": 407.0
|
"score": 407.0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "henri",
|
|
||||||
"score": 333.0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "destro",
|
"name": "destro",
|
||||||
"score": 332.0
|
"score": 332.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user