private void OnEnable() { mixedRealityTeleport = (MixedRealityTeleport)target; teleportMakerPrefab = serializedObject.FindProperty("teleportMarker"); useCustomMappingProperty = serializedObject.FindProperty("useCustomMapping"); enableTeleportProperty = serializedObject.FindProperty("EnableTeleport"); enableStrafeProperty = serializedObject.FindProperty("EnableStrafe"); strafeAmountProperty = serializedObject.FindProperty("StrafeAmount"); enableRotationProperty = serializedObject.FindProperty("EnableRotation"); rotationSizeProperty = serializedObject.FindProperty("RotationSize"); stayOnTheFloorProperty = serializedObject.FindProperty("StayOnTheFloor"); leftThumbstickXProperty = serializedObject.FindProperty("LeftThumbstickX"); leftThumbstickYProperty = serializedObject.FindProperty("LeftThumbstickY"); rightThumbstickXProperty = serializedObject.FindProperty("RightThumbstickX"); rightThumbstickYProperty = serializedObject.FindProperty("RightThumbstickY"); horizontalStrafeProperty = serializedObject.FindProperty("HorizontalStrafe"); forwardMovementProperty = serializedObject.FindProperty("ForwardMovement"); horizontalRotationProperty = serializedObject.FindProperty("HorizontalRotation"); verticalRotationProperty = serializedObject.FindProperty("VerticalRotation"); }
void Start() { fadeControl = FadeScript.Instance; warper = MixedRealityTeleport.Instance; animationController = GetComponentInChildren <Animator>(); animationController.StopPlayback(); animationController.speed = 0; gazeManager = GazeManager.Instance; ActiveMarker.SetActive(false); layerMask = 1 << (LayerMask.NameToLayer("Ignore Raycast")); layerMask = ~layerMask; Debug.Log(LayerMask.NameToLayer("Ignore Raycast")); }
private void InitializeLocalPlayer() { if (isLocalPlayer) { Debug.Log("Setting instance for local player "); _Instance = this; Debug.LogFormat("Set local player name {0} ip {1}", networkDiscovery.broadcastData, networkDiscovery.LocalIp); CmdSetPlayerName(networkDiscovery.broadcastData); CmdSetPlayerIp(networkDiscovery.LocalIp); bool opaqueDisplay = UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; Debug.LogFormat("local player {0} share anchors ", (opaqueDisplay ? "does not" : "does")); CmdSetCanShareAnchors(!opaqueDisplay); if (opaqueDisplay && levelState != null && levelState.isActiveAndEnabled) { Debug.Log("Requesting immersive path"); WaitingForFreePath = true; CmdRequestPathIndex(); } else { Debug.Log("Defaulting to bird's eye view"); CmdSendPathIndex(-1); if (opaqueDisplay && fadeManager != null && fadeManager.Busy == false) { fadeManager.DoFade(0.5f, 0.5f, () => { MixedRealityTeleport warper = MixedRealityTeleport.Instance; if (warper != null) { //warper.ResetRotation(); warper.SetWorldPosition(levelState.transform.position + levelState.transform.forward * -2.5f + Vector3.up * 0.25f + levelState.transform.transform.right * Random.Range(-2f, 2.0f)); } }, null); } } if (!opaqueDisplay && anchorManager.AnchorOwnerIP == "") { Invoke("DeferredAnchorOwnerCheck", 2.0f); } if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { InteractionManager.InteractionSourceUpdated += InteractionManager_InteractionSourceUpdated; } } }
void Start() { #if LINE_REND // This is for debugging the gaze ray. lineRend = gameObject.AddComponent <LineRenderer>(); lineRend.positionCount = 2; Vector3[] points = new Vector3[] { Vector3.zero, Vector3.one }; lineRend.SetPositions(points); #endif warper = MixedRealityTeleport.Instance; startScale = transform.localScale; SafetyColliders.SetActive(false); Debug.LogFormat("{0} {1}", gameObject.name, this.netId); }
void PathIndexChanged(int update) { Debug.LogFormat("{0}: Path index updated {1} => {2}", PlayerName, PathIndex, update); PathIndex = update; if (isLocalPlayer) { levelState.SetPathIndex(PathIndex); if (PathIndex == -1 && UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { Debug.Log("Getting in line"); WaitingForFreePath = true; if (fadeManager != null && fadeManager.Busy == false) { fadeManager.DoFade(0.5f, 0.5f, () => { MixedRealityTeleport warper = MixedRealityTeleport.Instance; if (warper != null) { // warper.ResetRotation(); warper.SetWorldPosition(levelState.transform.position + levelState.transform.forward * -2.5f + Vector3.up * 0.25f + levelState.transform.transform.right * Random.Range(-2f, 2.0f)); } }, null); } } else { WaitingForFreePath = false; } } else { levelState.OnPathMessage(PathIndex, PlayerName); } }