forked from cgvr/DeltaVR
Merge branch 'SamWorkset'
This commit is contained in:
240
Assets/_PROJECT/Animations/Doors/Handle turn.anim
Normal file
240
Assets/_PROJECT/Animations/Doors/Handle turn.anim
Normal file
@@ -0,0 +1,240 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Handle turn
|
||||
serializedVersion: 7
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: -90, y: 0, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: {x: -90, y: 35, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: {x: -90, y: 0, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path:
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves: []
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 0
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings:
|
||||
- serializedVersion: 2
|
||||
path: 0
|
||||
attribute: 4
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 4
|
||||
isPPtrCurve: 0
|
||||
isIntCurve: 0
|
||||
isSerializeReferenceCurve: 0
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 0.6666667
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -90
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: -90
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: -90
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.x
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 35
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.y
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: localEulerAnglesRaw.z
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
m_EulerEditorCurves:
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.x
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.y
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.z
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
flags: 0
|
||||
m_HasGenericRootTransform: 1
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
||||
8
Assets/_PROJECT/Animations/Doors/Handle turn.anim.meta
Normal file
8
Assets/_PROJECT/Animations/Doors/Handle turn.anim.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50462337bf29890408d9ae8bb3266c3f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
156
Assets/_PROJECT/Animations/Doors/Handle.controller
Normal file
156
Assets/_PROJECT/Animations/Doors/Handle.controller
Normal file
@@ -0,0 +1,156 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1107 &-1069537623632272288
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 3989251228479606634}
|
||||
m_Position: {x: 458, y: 258, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 3688584692115086133}
|
||||
m_Position: {x: 250, y: 430, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: 690, y: 0, z: 0}
|
||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 3989251228479606634}
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Handle
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters:
|
||||
- m_Name: TurnHandle
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: -1069537623632272288}
|
||||
m_Mask: {fileID: 0}
|
||||
m_Motions: []
|
||||
m_Behaviours: []
|
||||
m_BlendingMode: 0
|
||||
m_SyncedLayerIndex: -1
|
||||
m_DefaultWeight: 0
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1101 &406386627949578915
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 3989251228479606634}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0.24650171
|
||||
m_ExitTime: 0.98950523
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &3688584692115086133
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Handle turn
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 406386627949578915}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 50462337bf29890408d9ae8bb3266c3f, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1102 &3989251228479606634
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: New State
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 4639235367011125292}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 0}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &4639235367011125292
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: TurnHandle
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 3688584692115086133}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
8
Assets/_PROJECT/Animations/Doors/Handle.controller.meta
Normal file
8
Assets/_PROJECT/Animations/Doors/Handle.controller.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dff939b7bd92e7a49878acde7e3f25e1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,10 +1,12 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
using static MouseLook;
|
||||
|
||||
public class CarDrivingRoutine : MonoBehaviour
|
||||
public class CarDrivingRoutine : NetworkBehaviour
|
||||
{
|
||||
public AudioSource _stopSound;
|
||||
public AudioSource _tireSound;
|
||||
@@ -19,14 +21,22 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
private float targetSpeed;
|
||||
private float targetRotationSpeed;
|
||||
|
||||
private bool stopSoundPlayed = false;
|
||||
private float stopThreshold = 0.05f; // consider speed "0" when below this
|
||||
|
||||
private bool isBeingStoppedByPlayer = false;
|
||||
|
||||
|
||||
[Header("Tires")]
|
||||
public List<GameObject> FrontTires;
|
||||
public List<GameObject> BackTires;
|
||||
|
||||
public CarAudioController AudioController;
|
||||
private void Start()
|
||||
{
|
||||
targetSpeed = StraightSpeed;
|
||||
targetRotationSpeed = rotationSpeed;
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -47,23 +57,26 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
|
||||
rollTires(); // Just an aesthetic improvement.
|
||||
|
||||
if (Quaternion.Angle(transform.rotation, desiredRotation) > 1f) // If the car is turning.
|
||||
if (!isBeingStoppedByPlayer)
|
||||
{
|
||||
if (!isTurning)
|
||||
if (Quaternion.Angle(transform.rotation, desiredRotation) > 1f)
|
||||
{
|
||||
setTireRotation(tireTurnAngle);
|
||||
if (!isTurning)
|
||||
{
|
||||
setTireRotation(tireTurnAngle);
|
||||
AudioController.SetRPM(1300);
|
||||
}
|
||||
isTurning = true;
|
||||
}
|
||||
|
||||
isTurning = true;
|
||||
}
|
||||
if (Quaternion.Angle(transform.rotation, desiredRotation) <= 1f) // Reset the turn value.
|
||||
{
|
||||
if (isTurning)
|
||||
else
|
||||
{
|
||||
setTireRotation(-tireTurnAngle);
|
||||
if (isTurning)
|
||||
{
|
||||
setTireRotation(-tireTurnAngle);
|
||||
AudioController.SetRPM(1450);
|
||||
}
|
||||
isTurning = false;
|
||||
}
|
||||
|
||||
isTurning = false;
|
||||
}
|
||||
|
||||
// Check if close enough to the waypoint
|
||||
@@ -73,6 +86,18 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
// Proceed to the next waypoint
|
||||
_waypoint = _waypoint.Next;
|
||||
}
|
||||
|
||||
if (StraightSpeed <= stopThreshold && !stopSoundPlayed)
|
||||
{
|
||||
float currentRPM = AudioController.GetCurrentRPM();
|
||||
//Debug.LogError(currentRPM);
|
||||
if (currentRPM <= 550f) // confirms we are in the correct engine state
|
||||
{
|
||||
stopSoundPlayed = true;
|
||||
AudioController.PlayStopSound();
|
||||
//Debug.LogError("piiks");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void rollTires()
|
||||
@@ -101,21 +126,29 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{;
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed)); // Smoothly halt in 1 second
|
||||
_tireSound.Stop();
|
||||
_stopSound.Play();
|
||||
{
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
|
||||
isBeingStoppedByPlayer = true;
|
||||
|
||||
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed));
|
||||
|
||||
AudioController.SetRPM(475);
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed)); // Smoothly resume speed in 1 second
|
||||
_stopSound.Stop();
|
||||
_tireSound.Play();
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
|
||||
isBeingStoppedByPlayer = false;
|
||||
|
||||
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed));
|
||||
|
||||
AudioController.SetRPM(1450);
|
||||
stopSoundPlayed = false;
|
||||
}
|
||||
|
||||
|
||||
private IEnumerator SmoothAdjustSpeed(float targetStraightSpeed, float targetRotationSpeed, float duration)
|
||||
{
|
||||
float initialStraightSpeed = StraightSpeed;
|
||||
@@ -137,5 +170,12 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
// Ensure final values are set
|
||||
StraightSpeed = targetStraightSpeed;
|
||||
rotationSpeed = targetRotationSpeed;
|
||||
|
||||
// If we just came to a full stop, mark for sound playback
|
||||
if (StraightSpeed == 0)
|
||||
{
|
||||
stopSoundPlayed = false; // allow stop sound to fire
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class Carbehavior : MonoBehaviour
|
||||
public class Carbehavior : NetworkBehaviour
|
||||
{
|
||||
public AudioSource _carAlarm;
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class CarAudioController : MonoBehaviour
|
||||
{
|
||||
private EventInstance carMovementInstance;
|
||||
private EventInstance carStopInstance;
|
||||
private FirstPersonOcclusion occlusion;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
//Debug.LogError("AUDIO MANAGER:");
|
||||
//Debug.LogError(AudioManager.Instance);
|
||||
//Debug.LogError("FMOD EVENTS INSTANCE:");
|
||||
//Debug.LogError(FMODEvents.Instance);
|
||||
//Debug.LogError("Car Simple Driving:");
|
||||
//Debug.LogError(FMODEvents.Instance.BoltCarSimpleDriving);
|
||||
carMovementInstance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.CarModulatedDriving);
|
||||
carStopInstance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.BoltCarStopSound);
|
||||
|
||||
carMovementInstance.setParameterByName("RPM", 1450);
|
||||
carMovementInstance.setParameterByName("Load", 0);
|
||||
|
||||
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||
carStopInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||
|
||||
occlusion = GetComponent<FirstPersonOcclusion>();
|
||||
|
||||
if (occlusion != null)
|
||||
{
|
||||
occlusion.InitialiseWithInstance(carMovementInstance); // main looping engine sound
|
||||
occlusion.AddInstance(carStopInstance); // additional sound
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
carMovementInstance.start();
|
||||
AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 0.0f); //change the value of the global parameter in FMOD, initial value
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Always update 3D position to follow the car model transform
|
||||
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||
carStopInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||
}
|
||||
|
||||
// These methods are called externally by CarDrivingRoutine
|
||||
public void SetRPM(float value)
|
||||
{
|
||||
carMovementInstance.setParameterByName("RPM", value);
|
||||
}
|
||||
|
||||
public void PlayStopSound()
|
||||
{
|
||||
carStopInstance.start();
|
||||
//AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BoltCarStopSound, gameObject);
|
||||
|
||||
}
|
||||
public float GetCurrentRPM()
|
||||
{
|
||||
carMovementInstance.getParameterByName("RPM", out float value);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfb4dce81082ebf46801139bdb2ce8ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,6 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using FishNet.Object;
|
||||
using FMODUnity;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
@@ -6,7 +8,7 @@ using UnityEngine;
|
||||
using UnityEngine.XR.Content.Interaction;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class PassangerSeat : LocomotionProvider
|
||||
public class PassangerSeat : NetworkBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
public GameObject ExitSpot;
|
||||
@@ -36,13 +38,14 @@ public class PassangerSeat : LocomotionProvider
|
||||
Transform cameraTransform = cameraChild.transform.parent.transform;
|
||||
|
||||
Vector3 cameraShift = cameraTransform.localPosition;
|
||||
|
||||
|
||||
AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 2.0f); //change the value of the global parameter in FMOD, changed value
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorOpen, gameObject); //play 3d oneshot
|
||||
currentPassanger = player;
|
||||
player.transform.SetParent(this.transform);
|
||||
player.transform.localPosition = -cameraShift;
|
||||
player.transform.localRotation = Quaternion.identity;
|
||||
cameraTransform.localRotation = this.transform.rotation;
|
||||
BeginLocomotion();
|
||||
disablePlayerLocomotion(player);
|
||||
}
|
||||
private void disablePlayerLocomotion(XROrigin player)
|
||||
@@ -67,15 +70,16 @@ public class PassangerSeat : LocomotionProvider
|
||||
public void ExitCar()
|
||||
{
|
||||
if (currentPassanger == null) return;
|
||||
EndLocomotion();
|
||||
enablePlayerLocomotion(currentPassanger);
|
||||
|
||||
TutorialController cameraChild = currentPassanger.GetComponentInChildren<TutorialController>();
|
||||
if (cameraChild == null) return;
|
||||
|
||||
Transform cameraTransform = cameraChild.transform.parent.transform;
|
||||
AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 0.0f); //change the value of the global parameter in FMOD, initial value
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorClose, gameObject); //play 3d oneshot
|
||||
|
||||
// Set the player<65>s parent to null (making it part of the scene hierarchy)
|
||||
// Set the player<65>s parent to null (making it part of the scene hierarchy)
|
||||
currentPassanger.transform.SetParent(null);
|
||||
|
||||
// Put the player outside;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Waypoint : MonoBehaviour
|
||||
public class Waypoint : NetworkBehaviour
|
||||
{
|
||||
public float DesiredRotation = 0;
|
||||
public Waypoint Next;
|
||||
|
||||
@@ -12,6 +12,8 @@ GameObject:
|
||||
- component: {fileID: 3622985744187477872}
|
||||
- component: {fileID: 4889582830418939434}
|
||||
- component: {fileID: 4334268454398699518}
|
||||
- component: {fileID: 1040399542938643003}
|
||||
- component: {fileID: 7898671522480671537}
|
||||
m_Layer: 5
|
||||
m_Name: LetterButton
|
||||
m_TagString: Untagged
|
||||
@@ -122,6 +124,59 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &1040399542938643003
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1943907191875735250}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Delegates:
|
||||
- eventID: 0
|
||||
callback:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 7898671522480671537}
|
||||
m_TargetAssemblyTypeName: ButtonHoverSound, Assembly-CSharp
|
||||
m_MethodName: OnSelect
|
||||
m_Mode: 0
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 7898671522480671537}
|
||||
m_TargetAssemblyTypeName: ButtonHoverSound, Assembly-CSharp
|
||||
m_MethodName: OnDeselect
|
||||
m_Mode: 0
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &7898671522480671537
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1943907191875735250}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: cb2f1526149f8b44cad00bbed8424a37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &7747026983332875138
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -3,6 +3,7 @@ using FishNet.Object;
|
||||
using FishNet.Object.Synchronizing;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class ArcheryTarget : NetworkBehaviour, IArrowHittable
|
||||
{
|
||||
public GameObject pointsText;
|
||||
@@ -46,6 +47,8 @@ public class ArcheryTarget : NetworkBehaviour, IArrowHittable
|
||||
target.SetPoints(score);
|
||||
Spawn(prefab);
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.UFODestroy, gameObject);
|
||||
|
||||
Despawn(arrow.gameObject, DespawnType.Pool);
|
||||
Despawn(gameObject, DespawnType.Pool);
|
||||
}
|
||||
|
||||
15
Assets/_PROJECT/Components/Bow/Scripts/ButtonHoverSound.cs
Normal file
15
Assets/_PROJECT/Components/Bow/Scripts/ButtonHoverSound.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using FMODUnity;
|
||||
|
||||
public class ButtonHoverSound : MonoBehaviour, ISelectHandler, IDeselectHandler
|
||||
{
|
||||
public void OnSelect(BaseEventData eventData)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterHover, gameObject);
|
||||
}
|
||||
public void OnDeselect(BaseEventData eventData)
|
||||
{
|
||||
// Nothing needed here, unless you want a deselect effect
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb2f1526149f8b44cad00bbed8424a37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +1,10 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class KeyboardManager : MonoBehaviour
|
||||
public class KeyboardManager : NetworkBehaviour
|
||||
{
|
||||
public enum ShiftMode { Lowercase, NextUppercase, Uppercase }
|
||||
|
||||
@@ -25,6 +26,7 @@ public class KeyboardManager : MonoBehaviour
|
||||
private float _currentScore;
|
||||
private ShiftMode _shiftMode = ShiftMode.Lowercase;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
foreach (var button in letterButtons)
|
||||
@@ -76,6 +78,7 @@ public class KeyboardManager : MonoBehaviour
|
||||
|
||||
string letter = label.text;
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterEnter, button.gameObject);
|
||||
switch (_shiftMode)
|
||||
{
|
||||
case ShiftMode.Lowercase:
|
||||
@@ -96,6 +99,8 @@ public class KeyboardManager : MonoBehaviour
|
||||
|
||||
void OnShiftPressed()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterEnter, shiftButton.gameObject);
|
||||
|
||||
_shiftMode = _shiftMode switch
|
||||
{
|
||||
ShiftMode.Lowercase => ShiftMode.NextUppercase,
|
||||
@@ -109,6 +114,8 @@ public class KeyboardManager : MonoBehaviour
|
||||
|
||||
void OnBackspacePressed()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterEnter, backspaceButton.gameObject);
|
||||
|
||||
if (_input.Length > 0)
|
||||
_input = _input.Substring(0, _input.Length - 1);
|
||||
UpdateOutput();
|
||||
@@ -116,6 +123,8 @@ public class KeyboardManager : MonoBehaviour
|
||||
|
||||
void OnEnterPressed()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterEnter, enterButton.gameObject);
|
||||
|
||||
if (_input.Length > 0)
|
||||
{
|
||||
scoreBoard.SaveScore(_input, _currentScore);
|
||||
@@ -125,6 +134,8 @@ public class KeyboardManager : MonoBehaviour
|
||||
|
||||
void OnSpacePressed()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.LetterEnter, spaceButton.gameObject);
|
||||
|
||||
addToInput(" ");
|
||||
UpdateOutput();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using FishNet.Object;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -5,7 +6,7 @@ using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScoreBoard : MonoBehaviour
|
||||
public class ScoreBoard : NetworkBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class ScoreEntry
|
||||
|
||||
@@ -4960,7 +4960,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 5
|
||||
_componentIndexCache: 4
|
||||
_addedNetworkObject: {fileID: 1717143407103097221}
|
||||
_networkObjectCache: {fileID: 1717143407103097221}
|
||||
_synchronizeParent: 0
|
||||
@@ -5130,6 +5130,7 @@ GameObject:
|
||||
- component: {fileID: 933290339694180838}
|
||||
- component: {fileID: 2246675829434997248}
|
||||
- component: {fileID: 1717143407103097221}
|
||||
- component: {fileID: 2818003123056565107}
|
||||
m_Layer: 0
|
||||
m_Name: PaintGun
|
||||
m_TagString: Untagged
|
||||
@@ -5153,7 +5154,7 @@ Transform:
|
||||
- {fileID: 4826320045276546127}
|
||||
- {fileID: 316164716384481213}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 15}
|
||||
--- !u!95 &894335529310106930
|
||||
Animator:
|
||||
@@ -5426,7 +5427,6 @@ MonoBehaviour:
|
||||
- {fileID: 2246675829434997248}
|
||||
- {fileID: 7380372828037789915}
|
||||
- {fileID: 6466137562046178737}
|
||||
- {fileID: 0}
|
||||
- {fileID: 6641346233749009521}
|
||||
- {fileID: 7265139984553989061}
|
||||
<ParentNetworkObject>k__BackingField: {fileID: 0}
|
||||
@@ -5442,6 +5442,19 @@ MonoBehaviour:
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 8708812106909896480
|
||||
_sceneNetworkObjects: []
|
||||
--- !u!114 &2818003123056565107
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5253637933564617113}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7405dee79e06eca4795d2d3f39801f47, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
grabSoundType: 2
|
||||
--- !u!1 &8789365678454855824
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5486,7 +5499,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 4
|
||||
_componentIndexCache: 3
|
||||
_addedNetworkObject: {fileID: 1717143407103097221}
|
||||
_networkObjectCache: {fileID: 1717143407103097221}
|
||||
_synchronizeParent: 0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using FMOD.Studio;
|
||||
|
||||
namespace _PROJECT.Components.Drawing
|
||||
{
|
||||
@@ -18,16 +19,32 @@ namespace _PROJECT.Components.Drawing
|
||||
private float _cooldownTimer = 0f;
|
||||
private bool _isSpraying;
|
||||
|
||||
private EventInstance spray_sound;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
spray_sound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Spray); //creating the instance through AudioManager
|
||||
spray_sound.setParameterByName("SpraySwitcher", 0); //"Spray - 0 in FMOD"
|
||||
spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); //setting the 3D attributes
|
||||
}
|
||||
|
||||
protected override void OnActivated(ActivateEventArgs args)
|
||||
{
|
||||
base.OnActivated(args);
|
||||
StartSpray();
|
||||
|
||||
spray_sound.start(); //starting the instance
|
||||
spray_sound.setParameterByName("SpraySwitcher", 0); //"Spray - 0 in FMOD"
|
||||
|
||||
}
|
||||
|
||||
protected override void OnDeactivated(DeactivateEventArgs args)
|
||||
{
|
||||
base.OnDeactivated(args);
|
||||
StopSpray();
|
||||
|
||||
spray_sound.setParameterByName("SpraySwitcher", 1); //"NoSpray - 1 in FMOD"
|
||||
}
|
||||
|
||||
private new void Awake()
|
||||
@@ -36,6 +53,7 @@ namespace _PROJECT.Components.Drawing
|
||||
sprayPart.Stop(true, ParticleSystemStopBehavior.StopEmitting);
|
||||
_isSpraying = false;
|
||||
_layerMask = 1 << LayerMask.NameToLayer("Paintable");
|
||||
|
||||
}
|
||||
|
||||
private void StartSpray()
|
||||
@@ -43,21 +61,36 @@ namespace _PROJECT.Components.Drawing
|
||||
_isSpraying = true;
|
||||
trigger.transform.Rotate(0f, 0f, -8.5f);
|
||||
sprayPart.Play(true);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void StopSpray()
|
||||
{
|
||||
|
||||
|
||||
_isSpraying = false;
|
||||
trigger.transform.Rotate(0f, 0f, 8.5f);
|
||||
sprayPart.Stop(true, ParticleSystemStopBehavior.StopEmitting);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_isSpraying)
|
||||
{
|
||||
spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); //changing the attributes
|
||||
}
|
||||
|
||||
if (!isSelected || !_isSpraying)
|
||||
{
|
||||
if (!sprayPart.isPlaying) return;
|
||||
sprayPart.Stop(true, ParticleSystemStopBehavior.StopEmitting);
|
||||
|
||||
spray_sound.setParameterByName("SpraySwitcher", 1); //"NoSpray - 1 in FMOD"
|
||||
|
||||
_isSpraying = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ Material:
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _EmissionColor: {r: 32, g: 32, b: 32, a: 0}
|
||||
- _EmissionColor: {r: 10.680627, g: 10.680627, b: 10.680627, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &3687797256646661601
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator Variant 11
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 8264915245645977465, guid: e2815ed7e4ba71345aba4539e8e4b07e,
|
||||
type: 3}
|
||||
m_ModifiedSerializedProperties: 2
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0.6430054, b: 0.0039215684, a: 1}
|
||||
- _Color: {r: 1, g: 0.6430054, b: 0.0039215684, a: 1}
|
||||
- _EmissionColor: {r: 7.9709907, g: 0.07423936, b: 0, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &3687797256646661601
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e06a4feba1c7c8d4d9ccd9f08217c305
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-2369381272151528486
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator button 1 Variant
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 2100000, guid: d2cb0067ec2dac14b830006b4537c6d7, type: 2}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors: []
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8dbfd549222f4547b36a1d828e6cf01
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-5297191426521388487
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator fbx Variant 1
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 2100000, guid: fb15ade5b41060f43816470c3c3dae03, type: 2}
|
||||
m_ModifiedSerializedProperties: 2
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _EmissionColor: {r: 26.240507, g: 0.4325358, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df2499e0d0b1e5f4eb0aa3b7de2fb414
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator fbx Variant 2
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 2100000, guid: d2cb0067ec2dac14b830006b4537c6d7, type: 2}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _Color: {r: 0.9063317, g: 0.9063317, b: 0.9063317, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &7958070576693489127
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bc0f8cdd4cdf044eb3cb4c216505a74
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator fbx Variant 3
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 2100000, guid: 41f12eac51f3a45459e319b9f41ecb1a, type: 2}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _EmissionColor: {r: 16.233835, g: 2.703219, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &5211763387978159537
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b33054b96ed18074689b31c32a5df1e5
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: elevator fbx Variant
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 4164109902122252740, guid: e2815ed7e4ba71345aba4539e8e4b07e,
|
||||
type: 3}
|
||||
m_ModifiedSerializedProperties: 2
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors:
|
||||
- _Color: {r: 0.9063317, g: 0.9063317, b: 0.9063317, a: 1}
|
||||
- _EmissionColor: {r: 8, g: 8, b: 8, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &5894409217264877673
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2cb0067ec2dac14b830006b4537c6d7
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -294,10 +294,11 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1155267587565011288}
|
||||
m_LocalRotation: {x: 0.7071665, y: 0.0025170825, z: -0.7070381, w: 0.002517433}
|
||||
m_LocalPosition: {x: -0.9952316, y: 0.9510517, z: -0.91913366}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.2851704, z: 1.2851702}
|
||||
m_LocalPosition: {x: -0.99531555, y: 0.9510517, z: -0.91913366}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.2851704, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 40941494441971447}
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -362,7 +363,9 @@ GameObject:
|
||||
- component: {fileID: 3827770554830844204}
|
||||
- component: {fileID: 3329362411380229953}
|
||||
- component: {fileID: 165152649878582814}
|
||||
- component: {fileID: 9191466332692247096}
|
||||
- component: {fileID: 7180915592625416012}
|
||||
- component: {fileID: 5035439175284444213}
|
||||
- component: {fileID: 5880420167976964992}
|
||||
m_Layer: 0
|
||||
m_Name: Cylinder.002
|
||||
m_TagString: Untagged
|
||||
@@ -377,12 +380,13 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1343454156800876451}
|
||||
m_LocalRotation: {x: 0.0025174995, y: -0.7071667, z: 0.0025179575, w: 0.7070379}
|
||||
m_LocalPosition: {x: -0.99707794, y: 0.9908395, z: -0.9191284}
|
||||
m_LocalScale: {x: 1.040988, y: 1.0409881, z: 0.12851705}
|
||||
m_LocalRotation: {x: -0.0000016486738, y: -0.00000008940697, z: 4.656613e-10, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.00001, z: 0.00189}
|
||||
m_LocalScale: {x: 0.81, y: 0.81000036, z: 0.17931005}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_Children:
|
||||
- {fileID: 3003821954805478466}
|
||||
m_Father: {fileID: 2644315295173918728}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &3329362411380229953
|
||||
@@ -435,7 +439,7 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!65 &9191466332692247096
|
||||
--- !u!65 &7180915592625416012
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -454,8 +458,61 @@ BoxCollider:
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.02, y: 0.02, z: 0.013139977}
|
||||
m_Center: {x: -0.0000004768352, y: 9.974017e-14, z: -0.0034300117}
|
||||
m_Size: {x: 0.02, y: 0.02, z: 0.01}
|
||||
m_Center: {x: 0.00000047683454, y: -3.9396494e-13, z: 0.0005663533}
|
||||
--- !u!54 &5035439175284444213
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1343454156800876451}
|
||||
serializedVersion: 4
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 1
|
||||
m_ImplicitTensor: 1
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 124
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &5880420167976964992
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1343454156800876451}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 33e7127f1ef74754f93e1b2f236a7426, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
buttonDirectionRoot: {fileID: 1308047778134488800}
|
||||
minX: 0
|
||||
maxX: 0
|
||||
minY: 0
|
||||
maxY: 0
|
||||
minZ: -0.005
|
||||
maxZ: 0
|
||||
targetRenderers:
|
||||
- {fileID: 8004183478493254772}
|
||||
defaultMaterial: {fileID: 2100000, guid: fb15ade5b41060f43816470c3c3dae03, type: 2}
|
||||
pressedMaterial: {fileID: 2100000, guid: e06a4feba1c7c8d4d9ccd9f08217c305, type: 2}
|
||||
springForce: 3000
|
||||
damping: 8
|
||||
disabled: 0
|
||||
--- !u!1 &1655508674808552005
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -481,12 +538,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1655508674808552005}
|
||||
m_LocalRotation: {x: 0.70716655, y: 0.0025178997, z: -0.70703804, w: 0.0025182504}
|
||||
m_LocalPosition: {x: -0.99655914, y: 0.95216036, z: -0.91911745}
|
||||
m_LocalScale: {x: 0.64258516, y: 0.89961934, z: 0.12851703}
|
||||
m_LocalRotation: {x: 0.000000047613867, y: 9.094947e-13, z: -1.16411054e-10, w: 1}
|
||||
m_LocalPosition: {x: -0.000015805403, y: -0.0010740468, z: -0.0018429983}
|
||||
m_LocalScale: {x: 0.61728394, y: 0.86419785, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_Father: {fileID: 40941494441971447}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &7571450672470302808
|
||||
@@ -517,7 +574,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 4164109902122252740, guid: e2815ed7e4ba71345aba4539e8e4b07e, type: 3}
|
||||
- {fileID: 2100000, guid: d2cb0067ec2dac14b830006b4537c6d7, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
@@ -564,12 +621,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1799989022594837985}
|
||||
m_LocalRotation: {x: 0.0025174995, y: -0.7071667, z: 0.0025179575, w: 0.7070379}
|
||||
m_LocalPosition: {x: -0.9968262, y: 0.9897232, z: -0.9191284}
|
||||
m_LocalScale: {x: 0.64258516, y: 0.8996193, z: 0.12851705}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -2.0816682e-17, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.0010738493, z: -0.0018971369}
|
||||
m_LocalScale: {x: 0.61728394, y: 0.86419743, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_Father: {fileID: 3827770554830844204}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8163412218932540989
|
||||
@@ -600,7 +657,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 4164109902122252740, guid: e2815ed7e4ba71345aba4539e8e4b07e, type: 3}
|
||||
- {fileID: 2100000, guid: fb15ade5b41060f43816470c3c3dae03, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
@@ -651,12 +708,10 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2644315295173918728}
|
||||
- {fileID: 3827770554830844204}
|
||||
- {fileID: 3003821954805478466}
|
||||
- {fileID: 5440411313343636450}
|
||||
- {fileID: 40941494441971447}
|
||||
- {fileID: 412595011879194760}
|
||||
m_Father: {fileID: 6162202373723286846}
|
||||
- {fileID: 1707332620064940}
|
||||
- {fileID: 1308047778134488800}
|
||||
m_Father: {fileID: 7571658244325623340}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2764553145901649132
|
||||
@@ -1148,12 +1203,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4169556150134515299}
|
||||
m_LocalRotation: {x: 0.0025175, y: -0.7071667, z: 0.0025179575, w: 0.7070379}
|
||||
m_LocalPosition: {x: -0.99543, y: 0.913836, z: -0.9246607}
|
||||
m_LocalScale: {x: 93.89588, y: 80.72299, z: 100}
|
||||
m_LocalRotation: {x: 1.1641532e-10, y: -0, z: -1.1641532e-10, w: 1}
|
||||
m_LocalPosition: {x: -0.00010064437, y: -0.00037985033, z: -0.00002472628}
|
||||
m_LocalScale: {x: 1.7081451, y: 0.5381532, z: 14.285715}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6162202373723286846}
|
||||
m_Father: {fileID: 3304594250572515888}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4342248347662630292
|
||||
@@ -1335,10 +1390,12 @@ Transform:
|
||||
m_GameObject: {fileID: 5083988847387815339}
|
||||
m_LocalRotation: {x: 0.0025174997, y: -0.7071667, z: 0.0025179575, w: 0.7070379}
|
||||
m_LocalPosition: {x: -0.9960098, y: 0.9708109, z: -0.9191284}
|
||||
m_LocalScale: {x: 54.9695, y: 150.00002, z: 7}
|
||||
m_LocalScale: {x: 54.9695, y: 150.00003, z: 7}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6162202373723286846}
|
||||
m_Children:
|
||||
- {fileID: 7107645193982891531}
|
||||
- {fileID: 5532412708117151510}
|
||||
m_Father: {fileID: 7571658244325623340}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &6898644419604533241
|
||||
@@ -1625,14 +1682,11 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6345837147680569081}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_LocalPosition: {x: 0.024, y: 0, z: 0}
|
||||
m_LocalScale: {x: 2, y: 2, z: 2}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 3304594250572515888}
|
||||
- {fileID: 7107645193982891531}
|
||||
- {fileID: 5532412708117151510}
|
||||
- {fileID: 7725059319347024289}
|
||||
- {fileID: 7571658244325623340}
|
||||
m_Father: {fileID: 2318418055249420589}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -1647,7 +1701,9 @@ GameObject:
|
||||
- component: {fileID: 40941494441971447}
|
||||
- component: {fileID: 3208069010558204222}
|
||||
- component: {fileID: 6977373659876383704}
|
||||
- component: {fileID: 1091621344551845894}
|
||||
- component: {fileID: 4168737331772881164}
|
||||
- component: {fileID: 5117960061919655137}
|
||||
- component: {fileID: 6716688150999816398}
|
||||
m_Layer: 0
|
||||
m_Name: Cylinder.005
|
||||
m_TagString: Untagged
|
||||
@@ -1662,12 +1718,13 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6432132906871663243}
|
||||
m_LocalRotation: {x: 0.70716655, y: 0.0025179333, z: -0.70703804, w: 0.0025182841}
|
||||
m_LocalPosition: {x: -0.996788, y: 0.95104027, z: -0.91913414}
|
||||
m_LocalScale: {x: 1.040988, y: 1.040988, z: 0.12851703}
|
||||
m_LocalRotation: {x: -0.0000012035016, y: 0.00000008940606, z: 4.656613e-10, w: 1}
|
||||
m_LocalPosition: {x: -0, y: -0.00001, z: 0.00188}
|
||||
m_LocalScale: {x: 0.81, y: 0.8099997, z: 0.17931004}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_Children:
|
||||
- {fileID: 5440411313343636450}
|
||||
m_Father: {fileID: 412595011879194760}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &3208069010558204222
|
||||
@@ -1720,7 +1777,7 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!65 &1091621344551845894
|
||||
--- !u!65 &4168737331772881164
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -1739,8 +1796,61 @@ BoxCollider:
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.02, y: 0.019999998, z: 0.0131399855}
|
||||
m_Center: {x: -0.00000047681343, y: 8.796618e-14, z: -0.0033689765}
|
||||
m_Size: {x: 0.02, y: 0.020000001, z: 0.01}
|
||||
m_Center: {x: 2.0109322e-12, y: 4.1005228e-13, z: 0.00056635326}
|
||||
--- !u!54 &5117960061919655137
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6432132906871663243}
|
||||
serializedVersion: 4
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 1
|
||||
m_ImplicitTensor: 1
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 124
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &6716688150999816398
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6432132906871663243}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 33e7127f1ef74754f93e1b2f236a7426, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
buttonDirectionRoot: {fileID: 1707332620064940}
|
||||
minX: 0
|
||||
maxX: 0
|
||||
minY: 0
|
||||
maxY: 0
|
||||
minZ: -0.005
|
||||
maxZ: 0
|
||||
targetRenderers:
|
||||
- {fileID: 8629732451978090602}
|
||||
defaultMaterial: {fileID: 2100000, guid: fb15ade5b41060f43816470c3c3dae03, type: 2}
|
||||
pressedMaterial: {fileID: 2100000, guid: e06a4feba1c7c8d4d9ccd9f08217c305, type: 2}
|
||||
springForce: 3000
|
||||
damping: 8
|
||||
disabled: 0
|
||||
--- !u!1 &6792274789431496444
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1846,6 +1956,37 @@ BoxCollider:
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.01, y: 0.01, z: 0.009999999}
|
||||
m_Center: {x: -0.0000019073486, y: 0, z: 0}
|
||||
--- !u!1 &7428108723292836662
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1308047778134488800}
|
||||
m_Layer: 0
|
||||
m_Name: Target 1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1308047778134488800
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7428108723292836662}
|
||||
m_LocalRotation: {x: 0.7071665, y: 0.0025170825, z: -0.7070381, w: 0.0025174324}
|
||||
m_LocalPosition: {x: -0.99938095, y: 0.99083626, z: -0.9191292}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.2851703, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7489255191651269454
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1872,10 +2013,11 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7489255191651269454}
|
||||
m_LocalRotation: {x: 0.0025186653, y: -0.7071666, z: 0.0025191233, w: 0.707038}
|
||||
m_LocalPosition: {x: -0.9955139, y: 0.99085045, z: -0.9191284}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.2851701, z: 1.2851702}
|
||||
m_LocalPosition: {x: -0.9956, y: 0.99085045, z: -0.9191284}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.2851701, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 3827770554830844204}
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -1929,6 +2071,74 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &8040969224219013348
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7571658244325623340}
|
||||
- component: {fileID: 5508526013070946752}
|
||||
- component: {fileID: 3686724470914769516}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7571658244325623340
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8040969224219013348}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.479, y: -0.37, z: 0.445}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 3304594250572515888}
|
||||
- {fileID: 7725059319347024289}
|
||||
m_Father: {fileID: 6162202373723286846}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!65 &5508526013070946752
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8040969224219013348}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.01, y: 0.1, z: 0.07}
|
||||
m_Center: {x: -0.99, y: 0.97, z: -0.92}
|
||||
--- !u!114 &3686724470914769516
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8040969224219013348}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: eb10405b50598284a8ff23d1edde1407, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &8289553806241320887
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2034,6 +2244,37 @@ BoxCollider:
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.01, y: 0.009999999, z: 0.009999998}
|
||||
m_Center: {x: -0.00000023841858, y: -0.000000059604645, z: 0.0000000018626451}
|
||||
--- !u!1 &8320911064860559485
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1707332620064940}
|
||||
m_Layer: 0
|
||||
m_Name: Target 2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1707332620064940
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8320911064860559485}
|
||||
m_LocalRotation: {x: 0.7071665, y: 0.0025170825, z: -0.7070381, w: 0.002517433}
|
||||
m_LocalPosition: {x: -0.99908435, y: 0.9510375, z: -0.91913444}
|
||||
m_LocalScale: {x: 1.2851703, y: 1.285171, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7725059319347024289}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8520222310950346984
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2060,12 +2301,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8520222310950346984}
|
||||
m_LocalRotation: {x: 0.0025186648, y: -0.7071666, z: 0.0025191235, w: 0.707038}
|
||||
m_LocalPosition: {x: -0.9932709, y: 0.9708309, z: -0.91912794}
|
||||
m_LocalScale: {x: 50.199802, y: 146.42422, z: 1}
|
||||
m_LocalRotation: {x: 0.000001648441, y: 0.00000008940697, z: 3.4924597e-10, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.00039128936}
|
||||
m_LocalScale: {x: 0.9132302, y: 0.97616106, z: 0.14285713}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6162202373723286846}
|
||||
m_Father: {fileID: 3304594250572515888}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4589286648616132465
|
||||
@@ -2138,4 +2379,4 @@ BoxCollider:
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.001, y: 0.001, z: 0.0028471919}
|
||||
m_Center: {x: 0.000000014901076, y: -0.000000003725292, z: 0.00091596635}
|
||||
m_Center: {x: 0, y: -0.000000003725292, z: -0.001}
|
||||
|
||||
@@ -1777,7 +1777,12 @@ MonoBehaviour:
|
||||
<IsNested>k__BackingField: 0
|
||||
<ComponentIndex>k__BackingField: 0
|
||||
<PredictedSpawn>k__BackingField: {fileID: 0}
|
||||
_networkBehaviours: []
|
||||
_networkBehaviours:
|
||||
- {fileID: 7806173994934619905}
|
||||
- {fileID: 345553692048754556}
|
||||
- {fileID: 6603687395008658796}
|
||||
- {fileID: 764953073149743973}
|
||||
- {fileID: 2881803077339660242}
|
||||
<ParentNetworkObject>k__BackingField: {fileID: 0}
|
||||
<ChildNetworkObjects>k__BackingField: []
|
||||
_isNetworked: 1
|
||||
@@ -1787,7 +1792,7 @@ MonoBehaviour:
|
||||
NetworkObserver: {fileID: 0}
|
||||
<PrefabId>k__BackingField: 0
|
||||
<SpawnableCollectionId>k__BackingField: 0
|
||||
_scenePathHash: 353480863
|
||||
_scenePathHash: 0
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 15435807940015550974
|
||||
_sceneNetworkObjects:
|
||||
@@ -2163,6 +2168,41 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: right door
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: ElevatorOuter
|
||||
value:
|
||||
objectReference: {fileID: 345553692048754556}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: designatedFloor
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: ElevatorOuter
|
||||
value:
|
||||
objectReference: {fileID: 345553692048754556}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: designatedFloor
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7080676229175652277, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7235137764202097191, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
@@ -2231,6 +2271,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: b0a42248826403b4290be3c9eaf0cd8a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 3
|
||||
_addedNetworkObject: {fileID: 8195804890146573050}
|
||||
_networkObjectCache: {fileID: 8195804890146573050}
|
||||
floorNumbers:
|
||||
- floorNumber: 1
|
||||
floorNumberSprite: {fileID: 8645089989254867705}
|
||||
@@ -2274,6 +2317,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 5ef47691d9311604abf356d87aa8e028, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 1
|
||||
_addedNetworkObject: {fileID: 8195804890146573050}
|
||||
_networkObjectCache: {fileID: 8195804890146573050}
|
||||
box: {fileID: 7806173994934619905}
|
||||
floor: 2
|
||||
boxPos: {fileID: 4660138546890809471}
|
||||
@@ -2390,6 +2436,36 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: right door
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: ElevatorOuter
|
||||
value:
|
||||
objectReference: {fileID: 6603687395008658796}
|
||||
- target: {fileID: 5880420167976964992, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: designatedFloor
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: ElevatorOuter
|
||||
value:
|
||||
objectReference: {fileID: 6603687395008658796}
|
||||
- target: {fileID: 6716688150999816398, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: designatedFloor
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6941309913956637266, guid: 39c6662c65f8b8740b0dcba6607a839d,
|
||||
type: 3}
|
||||
propertyPath: m_BoxSize.y
|
||||
@@ -2509,7 +2585,7 @@ BoxCollider:
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 4, y: 3, z: 10}
|
||||
m_Center: {x: -2.96, y: 1.46, z: 0}
|
||||
@@ -2525,6 +2601,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 5ef47691d9311604abf356d87aa8e028, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 2
|
||||
_addedNetworkObject: {fileID: 8195804890146573050}
|
||||
_networkObjectCache: {fileID: 8195804890146573050}
|
||||
box: {fileID: 7806173994934619905}
|
||||
floor: 1
|
||||
boxPos: {fileID: 9140433812702186628}
|
||||
@@ -2572,6 +2651,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: b0a42248826403b4290be3c9eaf0cd8a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 4
|
||||
_addedNetworkObject: {fileID: 8195804890146573050}
|
||||
_networkObjectCache: {fileID: 8195804890146573050}
|
||||
floorNumbers:
|
||||
- floorNumber: 1
|
||||
floorNumberSprite: {fileID: 8278171174262717255}
|
||||
@@ -2598,11 +2680,31 @@ PrefabInstance:
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -0.327
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1868872862445697854, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 2472413635749971489, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 2540213522334542846, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Elevator box
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2769017712769253367, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 3104556117277622356, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 3833835715982065669, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -2688,6 +2790,21 @@ PrefabInstance:
|
||||
propertyPath: rolloffCustomCurve.m_Curve.Array.data[0].outWeight
|
||||
value: 0.85364515
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5849504599276584512, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 6897965602403835351, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 7333161818204528723, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
- target: {fileID: 8544266915878642225, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -2748,6 +2865,11 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9016434821259732323, guid: 74670edb0ba92b34f92801f43b666e78,
|
||||
type: 3}
|
||||
propertyPath: box
|
||||
value:
|
||||
objectReference: {fileID: 7806173994934619905}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects:
|
||||
@@ -2831,6 +2953,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73ccfdd4c926d054ba4f2e96fcb15082, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 8195804890146573050}
|
||||
_networkObjectCache: {fileID: 8195804890146573050}
|
||||
callers:
|
||||
- {fileID: 6603687395008658796}
|
||||
- {fileID: 345553692048754556}
|
||||
@@ -2843,7 +2968,7 @@ MonoBehaviour:
|
||||
doorOpenTime: 4
|
||||
doorCloseTime: 5.6
|
||||
floorMoveTime: 6
|
||||
doorStayOpenTime: 2
|
||||
doorStayOpenTime: 7
|
||||
floors:
|
||||
- floorNumber: 1
|
||||
floorPoint: {fileID: 9140433812702186628}
|
||||
@@ -2868,3 +2993,6 @@ MonoBehaviour:
|
||||
- {fileID: 8300000, guid: 0c020deef579e2d4aab4b2cc4b12d2e2, type: 3}
|
||||
- {fileID: 8300000, guid: 57951d8061bb3da4c84d70f7bf8b0339, type: 3}
|
||||
- {fileID: 8300000, guid: 0b3401cfc5e423d40aec96d322084d20, type: 3}
|
||||
currentFloor: 2
|
||||
targetFloor: 2
|
||||
state: 1
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ElevatorCaller : MonoBehaviour
|
||||
{
|
||||
|
||||
// Start is called before the first frame update
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
//Debug.Log(other);
|
||||
ElevatorSpringyButton button = other.GetComponent<ElevatorSpringyButton>();
|
||||
if (button == null) return;
|
||||
else
|
||||
{
|
||||
|
||||
button.Pressed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb10405b50598284a8ff23d1edde1407
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +1,4 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -9,7 +10,7 @@ public enum ElevatorMoveState
|
||||
Decending
|
||||
}
|
||||
|
||||
public class ElevatorStatusPlate : MonoBehaviour
|
||||
public class ElevatorStatusPlate : NetworkBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct FloorNumbers
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
@@ -6,15 +7,15 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
public enum ElevatorState
|
||||
{
|
||||
Stationary,
|
||||
OpenDoorsStationary,
|
||||
CloseDoorsStationary,
|
||||
OpeningDoors,
|
||||
AwaitingPassengers,
|
||||
ClosingDoors,
|
||||
Moving
|
||||
}
|
||||
|
||||
|
||||
public class ElevatorBox : MonoBehaviour
|
||||
public class ElevatorBox : NetworkBehaviour
|
||||
{
|
||||
public List<ElevatorOuter> callers = new List<ElevatorOuter>();
|
||||
|
||||
@@ -58,10 +59,10 @@ public class ElevatorBox : MonoBehaviour
|
||||
public AudioClip[] closeDoorsClips;
|
||||
public AudioClip[] moveElevatorClips;
|
||||
|
||||
private int currentFloor = 2;
|
||||
private int targetFloor = 2;
|
||||
public int currentFloor = 2;
|
||||
public int targetFloor = 2;
|
||||
|
||||
private ElevatorState state = ElevatorState.Stationary;
|
||||
public ElevatorState state = ElevatorState.CloseDoorsStationary;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -87,7 +88,7 @@ public class ElevatorBox : MonoBehaviour
|
||||
{
|
||||
//Debug.Log("Calling Elevator");
|
||||
Debug.Log(state);
|
||||
if (state == ElevatorState.Stationary || state == ElevatorState.ClosingDoors)
|
||||
if (state == ElevatorState.OpenDoorsStationary || state == ElevatorState.CloseDoorsStationary || state == ElevatorState.ClosingDoors)
|
||||
{
|
||||
Debug.Log(floor);
|
||||
|
||||
@@ -102,13 +103,13 @@ public class ElevatorBox : MonoBehaviour
|
||||
|
||||
StartCoroutine(OpenDoors());
|
||||
|
||||
SetState(ElevatorState.AwaitingPassengers);
|
||||
SetState(ElevatorState.OpenDoorsStationary);
|
||||
}
|
||||
}
|
||||
|
||||
public void interestExpired()
|
||||
{
|
||||
if (state == ElevatorState.AwaitingPassengers)
|
||||
if (state == ElevatorState.OpenDoorsStationary)
|
||||
{
|
||||
if (IsElevatorEmpty())
|
||||
{
|
||||
@@ -129,10 +130,13 @@ public class ElevatorBox : MonoBehaviour
|
||||
}
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.GetComponentInParent<SmartHandPresence>() != null) return; // So it ignores player hands.
|
||||
|
||||
XROrigin enteredPlayerVR = other.GetComponent<XROrigin>();
|
||||
KbmController enteredPlayerKbm = other.GetComponent<KbmController>();
|
||||
XRPlayerMirror networkPlayerDisplay = other.GetComponentInParent<XRPlayerMirror>();
|
||||
|
||||
Debug.Log("Player Entered box");
|
||||
//Debug.Log("Player Entered box");
|
||||
if (enteredPlayerVR != null)
|
||||
{
|
||||
addChild(enteredPlayerVR);
|
||||
@@ -141,11 +145,19 @@ public class ElevatorBox : MonoBehaviour
|
||||
{
|
||||
enteredPlayerKbm.transform.SetParent(this.transform);
|
||||
}
|
||||
else
|
||||
else if (networkPlayerDisplay != null)
|
||||
{
|
||||
//don't do any parenting but don't halt the function
|
||||
}
|
||||
else {
|
||||
|
||||
//Debug.Log(other + " Cannot ride in lifts.");
|
||||
return;
|
||||
}
|
||||
|
||||
/*Debug.Log("Calling Lift transfer sequence");
|
||||
|
||||
switch (targetFloor)
|
||||
switch (currentFloor)
|
||||
{
|
||||
case int f when f == floors[0].floorNumber:
|
||||
targetFloor = floors[1].floorNumber;
|
||||
@@ -158,8 +170,8 @@ public class ElevatorBox : MonoBehaviour
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
StartCoroutine(LiftTransferSequence());
|
||||
|
||||
StartCoroutine(LiftTransferSequence()); */
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +181,8 @@ public class ElevatorBox : MonoBehaviour
|
||||
// Was it a player, that exited?
|
||||
XROrigin exitedPlayerVR = other.GetComponent<XROrigin>();
|
||||
KbmController exitedPlayerKbm = other.GetComponent<KbmController>();
|
||||
XRPlayerMirror networkPlayerDisplay = other.GetComponentInParent<XRPlayerMirror>();
|
||||
|
||||
if (exitedPlayerVR != null)
|
||||
{
|
||||
removeChild(exitedPlayerVR);
|
||||
@@ -177,12 +191,16 @@ public class ElevatorBox : MonoBehaviour
|
||||
{
|
||||
exitedPlayerKbm.transform.SetParent(null);
|
||||
}
|
||||
else if (networkPlayerDisplay != null)
|
||||
{
|
||||
//don't do any parenting but don't halt the function
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
Debug.Log("Player exited box, state is: " + this.state);
|
||||
|
||||
if (this.state == ElevatorState.AwaitingPassengers)
|
||||
if (this.state == ElevatorState.OpenDoorsStationary)
|
||||
{
|
||||
if (IsElevatorEmpty())
|
||||
{
|
||||
@@ -261,26 +279,30 @@ public class ElevatorBox : MonoBehaviour
|
||||
audioSource.Play();
|
||||
}
|
||||
|
||||
private IEnumerator LiftTransferSequence()
|
||||
public IEnumerator LiftTransferSequence()
|
||||
{
|
||||
if (state != ElevatorState.Moving);
|
||||
Debug.Log("Started Lift transfer sequence");
|
||||
yield return StartCoroutine(CloseDoors());
|
||||
yield return StartCoroutine(MoveToFloor(targetFloor));
|
||||
}
|
||||
public IEnumerator MoveToFloor(int floorNumber)
|
||||
{
|
||||
Debug.Log("Moving to floor " + floorNumber);
|
||||
|
||||
if (floorDict.TryGetValue(floorNumber, out Transform target))
|
||||
{
|
||||
yield return StartCoroutine(MoveElevator(target.position));
|
||||
SetCurrentFloor(targetFloor);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"No floor defined for number {floorNumber}");
|
||||
}
|
||||
if (state == ElevatorState.CloseDoorsStationary) {
|
||||
//Debug.Log("Moving to floor " + floorNumber);
|
||||
if (floorDict.TryGetValue(floorNumber, out Transform target))
|
||||
{
|
||||
yield return StartCoroutine(MoveElevator(target.position));
|
||||
SetCurrentFloor(targetFloor);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"No floor defined for number {floorNumber}");
|
||||
}
|
||||
state = ElevatorState.CloseDoorsStationary;
|
||||
|
||||
yield return StartCoroutine(OpenDoors());
|
||||
yield return StartCoroutine(OpenDoors());
|
||||
}
|
||||
}
|
||||
private IEnumerator CloseAndStationary()
|
||||
{
|
||||
@@ -289,13 +311,15 @@ public class ElevatorBox : MonoBehaviour
|
||||
yield return StartCoroutine(CloseDoors());
|
||||
|
||||
// After doors have closed, set state
|
||||
SetState(ElevatorState.Stationary);
|
||||
SetState(ElevatorState.CloseDoorsStationary);
|
||||
}
|
||||
|
||||
private IEnumerator CloseDoors()
|
||||
public IEnumerator CloseDoors()
|
||||
{
|
||||
//if (state == ElevatorState.AwaitingPassengers) {
|
||||
//Debug.Log("Closing doors");
|
||||
Debug.Log(state);
|
||||
if (state != ElevatorState.OpeningDoors && state != ElevatorState.CloseDoorsStationary && state != ElevatorState.ClosingDoors)
|
||||
{
|
||||
Debug.Log("Closing doors");
|
||||
|
||||
if (Vector3.Distance(leftDoor.transform.position, leftDoorClosedPos.position) < 0.01f)
|
||||
yield break;
|
||||
@@ -303,21 +327,27 @@ public class ElevatorBox : MonoBehaviour
|
||||
SetState(ElevatorState.ClosingDoors);
|
||||
playRandomAudioClipFrom(closeDoorsClips);
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ElevatorDoorClosing, gameObject); //fmod attached 3d oneshot event
|
||||
|
||||
ElevatorOuter currentCaller = findCurrentCaller();
|
||||
|
||||
if (currentCaller != null) currentCaller.CloseDoors();
|
||||
|
||||
yield return StartCoroutine(MoveDoors(leftDoor, leftDoorClosedPos, rightDoor, rightDoorClosedPos, doorCloseTime));
|
||||
//}
|
||||
SetState(ElevatorState.CloseDoorsStationary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private IEnumerator OpenDoors()
|
||||
public IEnumerator OpenDoors()
|
||||
{
|
||||
if (state != ElevatorState.AwaitingPassengers) {
|
||||
//Debug.Log("Opening doors");
|
||||
if (state != ElevatorState.OpeningDoors && state != ElevatorState.OpenDoorsStationary && state != ElevatorState.Moving) {
|
||||
Debug.Log("Opening doors");
|
||||
SetState(ElevatorState.OpeningDoors);
|
||||
playRandomAudioClipFrom(openDoorsClips);
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ElevatorDoorOpening, gameObject); //fmod attached 3d oneshot event
|
||||
|
||||
ElevatorOuter targetCaller = findTargetCaller();
|
||||
//Debug.Log("Target caller is: " + targetCaller);
|
||||
if (targetCaller != null)
|
||||
@@ -326,8 +356,9 @@ public class ElevatorBox : MonoBehaviour
|
||||
yield return StartCoroutine(MoveDoors(leftDoor, leftDoorOpenPos, rightDoor, rightDoorOpenPos, doorOpenTime));
|
||||
|
||||
|
||||
SetState(ElevatorState.AwaitingPassengers);
|
||||
SetState(ElevatorState.OpenDoorsStationary);
|
||||
yield return new WaitForSeconds(doorStayOpenTime); // wait for passengers
|
||||
StartCoroutine(CloseDoors());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,28 +384,31 @@ public class ElevatorBox : MonoBehaviour
|
||||
|
||||
private IEnumerator MoveElevator(Vector3 targetPos)
|
||||
{
|
||||
if (targetFloor > currentFloor)
|
||||
foreach (ElevatorOuter caller in callers)
|
||||
caller.statusPlate.SetMoveState(ElevatorMoveState.Ascending);
|
||||
if (targetFloor != currentFloor) {
|
||||
if (targetFloor > currentFloor)
|
||||
foreach (ElevatorOuter caller in callers)
|
||||
caller.statusPlate.SetMoveState(ElevatorMoveState.Ascending);
|
||||
|
||||
else
|
||||
foreach (ElevatorOuter caller in callers)
|
||||
caller.statusPlate.SetMoveState(ElevatorMoveState.Decending);
|
||||
else
|
||||
foreach (ElevatorOuter caller in callers)
|
||||
caller.statusPlate.SetMoveState(ElevatorMoveState.Decending);
|
||||
|
||||
Vector3 startPos = transform.position;
|
||||
float t = 0;
|
||||
Vector3 startPos = transform.position;
|
||||
float t = 0;
|
||||
|
||||
SetState(ElevatorState.Moving);
|
||||
playRandomAudioClipFrom(moveElevatorClips);
|
||||
SetState(ElevatorState.Moving);
|
||||
playRandomAudioClipFrom(moveElevatorClips);
|
||||
|
||||
while (t < 1f)
|
||||
{
|
||||
t += Time.deltaTime / floorMoveTime;
|
||||
float easedT = Mathf.SmoothStep(0f, 1f, t); // ease in/out
|
||||
transform.position = Vector3.Lerp(startPos, targetPos, easedT);
|
||||
yield return null;
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ElevatorMovement, gameObject); //fmod attached 3d oneshot event
|
||||
|
||||
while (t < 1f)
|
||||
{
|
||||
t += Time.deltaTime / floorMoveTime;
|
||||
float easedT = Mathf.SmoothStep(0f, 1f, t); // ease in/out
|
||||
transform.position = Vector3.Lerp(startPos, targetPos, easedT);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ElevatorOuter caller in callers)
|
||||
caller.statusPlate.SetMoveState(ElevatorMoveState.NotMoving);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class ElevatorOuter : MonoBehaviour
|
||||
public class ElevatorOuter : NetworkBehaviour
|
||||
{
|
||||
public ElevatorBox box;
|
||||
|
||||
@@ -24,23 +26,34 @@ public class ElevatorOuter : MonoBehaviour
|
||||
public ElevatorStatusPlate statusPlate;
|
||||
public AudioSource arrivalBeeper;
|
||||
|
||||
private EventInstance arrivalBeep;
|
||||
private FirstPersonOcclusion occlusion;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
doorOpenTime = box.doorOpenTime;
|
||||
doorCloseTime = box.doorCloseTime;
|
||||
|
||||
arrivalBeep = AudioManager.Instance.CreateInstance(FMODEvents.Instance.ElevatorArrival); //initialising the variable
|
||||
arrivalBeep.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //setting 3d attributes
|
||||
|
||||
occlusion = GetComponent<FirstPersonOcclusion>();
|
||||
|
||||
if (occlusion != null)
|
||||
{
|
||||
occlusion.InitialiseWithInstance(arrivalBeep);
|
||||
}
|
||||
|
||||
}
|
||||
private void OnTriggerEnter(Collider other)
|
||||
public void CallElevator()
|
||||
{
|
||||
Debug.Log("Something entered call area");
|
||||
if (other.GetComponent<XROrigin>() == null && other.GetComponent<KbmController>() == null) return;
|
||||
StartCoroutine(box.callElevator(floor));
|
||||
Debug.Log("Player entered call area");
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
Debug.Log("Something entered call area");
|
||||
if (other.GetComponent<XROrigin>() == null && other.GetComponent<KbmController>() == null) return;
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
box.interestExpired();
|
||||
Debug.Log("Player exited call area");
|
||||
}
|
||||
@@ -53,6 +66,7 @@ public class ElevatorOuter : MonoBehaviour
|
||||
public void OpenDoors()
|
||||
{
|
||||
arrivalBeeper.Play();
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ElevatorArrival, gameObject);
|
||||
Debug.Log("Outer Doors opened");
|
||||
StartCoroutine(MoveDoors(leftDoor, leftDoorOpenPos, rightDoor, rightDoorOpenPos, doorOpenTime));
|
||||
|
||||
@@ -75,6 +89,11 @@ public class ElevatorOuter : MonoBehaviour
|
||||
Debug.Log("Outer Doors moved");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
arrivalBeep.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //updating the attributes
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
25
Assets/_PROJECT/Components/Elevator/Scripts/Push Button.cs
Normal file
25
Assets/_PROJECT/Components/Elevator/Scripts/Push Button.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ButtonAxisLock : MonoBehaviour
|
||||
{
|
||||
public Transform buttonDirectionRoot;
|
||||
|
||||
public float minX = 0f;
|
||||
public float maxX = 0.02f;
|
||||
public float minY = 0f;
|
||||
public float maxY = 0f;
|
||||
public float minZ = 0f;
|
||||
public float maxZ = 0f;
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
Vector3 localPos = buttonDirectionRoot.InverseTransformPoint(transform.position);
|
||||
|
||||
localPos.x = Mathf.Clamp(localPos.z, minX, maxX);
|
||||
localPos.y = Mathf.Clamp(localPos.z, minY, maxY);
|
||||
localPos.z = Mathf.Clamp(localPos.z, minZ, maxZ);
|
||||
|
||||
transform.position = buttonDirectionRoot.TransformPoint(localPos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6faa56fe20fbd1b4fa28a756a4d9ffb6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
176
Assets/_PROJECT/Components/Elevator/Scripts/Springy Button.cs
Normal file
176
Assets/_PROJECT/Components/Elevator/Scripts/Springy Button.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
public class ElevatorSpringyButton : MonoBehaviour {
|
||||
public Transform buttonDirectionRoot;
|
||||
|
||||
public ElevatorOuter ElevatorOuter;
|
||||
public ElevatorBox box;
|
||||
|
||||
[Header("Movement limits")]
|
||||
public float minX = 0f;
|
||||
public float maxX = 0f;
|
||||
public float minY = 0f;
|
||||
public float maxY = 0f;
|
||||
public float minZ = 0.005f;
|
||||
public float maxZ = 0f;
|
||||
|
||||
[Header("Visuals")]
|
||||
public Renderer[] targetRenderers;
|
||||
public Material defaultMaterial;
|
||||
public Material pressedMaterial;
|
||||
|
||||
[Header("Spring Settings")]
|
||||
public float springForce = 300f; // how strong it returns
|
||||
public float damping = 8f; // prevents vibration
|
||||
|
||||
[Header("Button Type Settings")]
|
||||
public bool isFloorButton;
|
||||
public bool isInsideButton;
|
||||
public bool isCloseDoorsButton;
|
||||
public int designatedFloor;
|
||||
|
||||
|
||||
private Rigidbody rb;
|
||||
private Vector3 restLocalPos;
|
||||
|
||||
public bool disabled;
|
||||
|
||||
private bool isAwaitingResponse = false;
|
||||
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody>();
|
||||
rb.useGravity = false;
|
||||
|
||||
// initial local rest position
|
||||
restLocalPos = buttonDirectionRoot.InverseTransformPoint(transform.position);
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
// 1. Local pos
|
||||
Vector3 localPos = buttonDirectionRoot.InverseTransformPoint(transform.position);
|
||||
|
||||
// 2. Spring in LOCAL space
|
||||
Vector3 spring = (restLocalPos - localPos) * springForce;
|
||||
|
||||
// 3. Damping also must be in LOCAL space!!
|
||||
Vector3 localVelocity = buttonDirectionRoot.InverseTransformDirection(rb.velocity);
|
||||
localVelocity *= damping;
|
||||
spring -= localVelocity;
|
||||
|
||||
// 4. Convert spring to WORLD space
|
||||
Vector3 worldSpring = buttonDirectionRoot.TransformDirection(spring);
|
||||
|
||||
// 5. Apply
|
||||
rb.AddForce(worldSpring, ForceMode.Acceleration);
|
||||
|
||||
// --- 3. Compute new local pos after physics ---
|
||||
Vector3 newLocalPos = buttonDirectionRoot.InverseTransformPoint(transform.position);
|
||||
//Debug.Log(spring);
|
||||
// --- 4. Clamp to allowed ranges ---
|
||||
newLocalPos.x = Mathf.Clamp(newLocalPos.x, minX, maxX);
|
||||
newLocalPos.y = Mathf.Clamp(newLocalPos.y, minY, maxY);
|
||||
newLocalPos.z = Mathf.Clamp(newLocalPos.z, minZ, maxZ);
|
||||
|
||||
// --- 5. Convert back to world and move via Rigidbody ---
|
||||
Vector3 worldPos = buttonDirectionRoot.TransformPoint(newLocalPos);
|
||||
rb.MovePosition(worldPos);
|
||||
|
||||
//Keeping the buttons firing until their needs have been met
|
||||
|
||||
if (!isAwaitingResponse || disabled) return;
|
||||
if (!isInsideButton && box != null)
|
||||
{
|
||||
if (box.currentFloor == designatedFloor) StartCoroutine(DeactivateAfterDelay(0.5f));
|
||||
else Pressed();
|
||||
return;
|
||||
}
|
||||
if (isInsideButton && box != null)
|
||||
{
|
||||
|
||||
if (isFloorButton)
|
||||
{
|
||||
if (designatedFloor == box.currentFloor) StartCoroutine(DeactivateAfterDelay(0.5f));
|
||||
else Pressed();
|
||||
return;
|
||||
}
|
||||
if (isCloseDoorsButton)
|
||||
{
|
||||
if (box.state == ElevatorState.ClosingDoors|| box.state == ElevatorState.Moving) StartCoroutine(DeactivateAfterDelay(0.5f));
|
||||
else Pressed();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (box.state == ElevatorState.OpeningDoors || box.state == ElevatorState.Moving) StartCoroutine(DeactivateAfterDelay(0.5f));
|
||||
else Pressed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Pressed()
|
||||
{
|
||||
isAwaitingResponse = true;
|
||||
|
||||
foreach (Renderer renderer in targetRenderers)
|
||||
{
|
||||
renderer.material = pressedMaterial;
|
||||
}
|
||||
//Debug.Log("Button is pressed");
|
||||
if (ElevatorOuter != null && !isInsideButton) ElevatorOuter.CallElevator();
|
||||
if (disabled)
|
||||
{
|
||||
StartCoroutine(DeactivateAfterDelay(0.5f));
|
||||
return;
|
||||
}
|
||||
if (box != null && isInsideButton)
|
||||
{
|
||||
if (isFloorButton)
|
||||
{
|
||||
box.targetFloor = designatedFloor;
|
||||
if (box.targetFloor != box.currentFloor) {
|
||||
Debug.Log("Lift transfer sequence");
|
||||
StartCoroutine(box.LiftTransferSequence());
|
||||
|
||||
}
|
||||
else StartCoroutine(box.OpenDoors());
|
||||
return;
|
||||
|
||||
}
|
||||
if (isCloseDoorsButton)
|
||||
{
|
||||
//Debug.Log("Closing Doors");
|
||||
StartCoroutine(box.CloseDoors());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(box.OpenDoors());
|
||||
//Debug.Log("Opening Doors");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void Deactivate()
|
||||
{
|
||||
Debug.Log("Deactivating");
|
||||
//if (isAwaitingResponse) return;
|
||||
isAwaitingResponse = false;
|
||||
foreach (Renderer renderer in targetRenderers)
|
||||
{
|
||||
renderer.material = defaultMaterial;
|
||||
}
|
||||
|
||||
}
|
||||
private System.Collections.IEnumerator DeactivateAfterDelay(float delay)
|
||||
{
|
||||
yield return new WaitForSeconds(delay);
|
||||
//isAwaitingResponse = false;
|
||||
Deactivate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33e7127f1ef74754f93e1b2f236a7426
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -31,6 +31,9 @@ Transform:
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 7921922657197840971}
|
||||
- {fileID: 5538929780198363686}
|
||||
- {fileID: 4592115865606785128}
|
||||
- {fileID: 7014926098072648185}
|
||||
m_Father: {fileID: 9164851303759649724}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0}
|
||||
@@ -85,6 +88,59 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &2159071680447297791
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4592115865606785128}
|
||||
- component: {fileID: 1238617081323543605}
|
||||
m_Layer: 0
|
||||
m_Name: Collider (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4592115865606785128
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2159071680447297791}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.0092}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2682289115991355014}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 60}
|
||||
--- !u!65 &1238617081323543605
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2159071680447297791}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.017320512, y: 0.01, z: 0.0015800049}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &4472433257338951034
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -365,6 +421,59 @@ MonoBehaviour:
|
||||
m_hasFontAssetChanged: 0
|
||||
m_renderer: {fileID: 3155261771512299869}
|
||||
m_maskType: 0
|
||||
--- !u!1 &4942053202746612151
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7014926098072648185}
|
||||
- component: {fileID: 8131730683290524916}
|
||||
m_Layer: 0
|
||||
m_Name: Collider (2)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7014926098072648185
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4942053202746612151}
|
||||
m_LocalRotation: {x: -0.007179506, y: -0.00414509, z: -0.49998283, w: 0.86599565}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.0092}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2682289115991355014}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: -0.95, y: 0, z: -60}
|
||||
--- !u!65 &8131730683290524916
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4942053202746612151}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.017320512, y: 0.01, z: 0.0015800049}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &4944465253087424345
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -504,6 +613,59 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
|
||||
--- !u!1 &6166976609312591130
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5538929780198363686}
|
||||
- component: {fileID: 6982848044266025958}
|
||||
m_Layer: 0
|
||||
m_Name: Collider
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5538929780198363686
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6166976609312591130}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.0092}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2682289115991355014}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!65 &6982848044266025958
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6166976609312591130}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.017320512, y: 0.01, z: 0.0015800049}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8393521238868148486
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -9,7 +9,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4066697426206295884}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: grip_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -41,7 +41,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3134737213848559909}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: thumbstick_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -73,7 +73,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4952025666149278534}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: trigger_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -107,7 +107,7 @@ GameObject:
|
||||
- component: {fileID: 9062241314923908314}
|
||||
- component: {fileID: 6247171210129923414}
|
||||
- component: {fileID: 8158463085824228395}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: thumbstick
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -190,7 +190,7 @@ GameObject:
|
||||
- component: {fileID: 9062241314867636624}
|
||||
- component: {fileID: 6247171210077157404}
|
||||
- component: {fileID: 8158463085742774625}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: grip
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -273,7 +273,7 @@ GameObject:
|
||||
- component: {fileID: 9062241314862212276}
|
||||
- component: {fileID: 6247171210065802552}
|
||||
- component: {fileID: 8158463085735253061}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: body
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -356,7 +356,7 @@ GameObject:
|
||||
- component: {fileID: 9062241315346829503}
|
||||
- component: {fileID: 6247171210487136563}
|
||||
- component: {fileID: 8158463085112582222}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: trigger
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -439,7 +439,7 @@ GameObject:
|
||||
- component: {fileID: 9062241315375960027}
|
||||
- component: {fileID: 6247171210516733527}
|
||||
- component: {fileID: 8158463085099777834}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: button_x
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -522,7 +522,7 @@ GameObject:
|
||||
- component: {fileID: 9062241315500892323}
|
||||
- component: {fileID: 6247171210643468591}
|
||||
- component: {fileID: 8158463085226790994}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: button_y
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -605,7 +605,7 @@ GameObject:
|
||||
- component: {fileID: 9062241315501822880}
|
||||
- component: {fileID: 6247171210642522668}
|
||||
- component: {fileID: 8158463085225632593}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: menu_button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -689,7 +689,7 @@ GameObject:
|
||||
- component: {fileID: 1270581827023853383}
|
||||
- component: {fileID: 3649480308885486090}
|
||||
- component: {fileID: 3376253515980734203}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: Oculus Touch Left
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -781,10 +781,18 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8824389019078637771}
|
||||
m_Modifications:
|
||||
- target: {fileID: 106450, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 140952, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: hint billboard
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 140952, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 444586, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
@@ -829,6 +837,21 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3698684970970094947, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5615189752425831018, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6886418318191067747, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
|
||||
@@ -9,7 +9,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4558648361292797792}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: grip_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -44,7 +44,7 @@ GameObject:
|
||||
- component: {fileID: 3060242288266649367}
|
||||
- component: {fileID: 6570840354189838564}
|
||||
- component: {fileID: 4475894781922331434}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: Oculus Touch Right
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -72,7 +72,7 @@ Transform:
|
||||
- {fileID: 4558648361292797792}
|
||||
- {fileID: 5973681094436754426}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: -1
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3060242288266649367
|
||||
MonoBehaviour:
|
||||
@@ -127,6 +127,60 @@ Animator:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!1 &5311823096500135044
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 835650820590754452}
|
||||
- component: {fileID: 2252121980502252906}
|
||||
m_Layer: 21
|
||||
m_Name: Collider
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &835650820590754452
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5311823096500135044}
|
||||
m_LocalRotation: {x: 0.041203193, y: -0.08091445, z: 0.003347616, w: 0.99586344}
|
||||
m_LocalPosition: {x: 0.016, y: 0.0187, z: 0.0367}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5507434294320401727}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 4.738, y: -9.29, z: 0}
|
||||
--- !u!65 &2252121980502252906
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5311823096500135044}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.09, y: 0.09, z: -0.02}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5926245407173495046
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -138,7 +192,7 @@ GameObject:
|
||||
- component: {fileID: 5507434295091381683}
|
||||
- component: {fileID: 7430854878937093183}
|
||||
- component: {fileID: 4653754205148935490}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: right_button_b
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -221,7 +275,7 @@ GameObject:
|
||||
- component: {fileID: 5507434294993827119}
|
||||
- component: {fileID: 7430854878908834979}
|
||||
- component: {fileID: 4653754205112174046}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: thumbstick
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -304,7 +358,7 @@ GameObject:
|
||||
- component: {fileID: 5507434295805006344}
|
||||
- component: {fileID: 7430854879188157316}
|
||||
- component: {fileID: 4653754204280251129}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: right_grip
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -387,7 +441,7 @@ GameObject:
|
||||
- component: {fileID: 5507434295828729425}
|
||||
- component: {fileID: 7430854879139274717}
|
||||
- component: {fileID: 4653754204277767840}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: right_button_menu
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -470,7 +524,7 @@ GameObject:
|
||||
- component: {fileID: 5507434295466739281}
|
||||
- component: {fileID: 7430854879383820253}
|
||||
- component: {fileID: 4653754204484105888}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: right_button_a
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -553,7 +607,7 @@ GameObject:
|
||||
- component: {fileID: 5507434294320401727}
|
||||
- component: {fileID: 7430854878240070835}
|
||||
- component: {fileID: 4653754203366079950}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: body
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -571,7 +625,8 @@ Transform:
|
||||
m_LocalPosition: {x: -0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 835650820590754452}
|
||||
m_Father: {fileID: 5466065062541431104}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -636,7 +691,7 @@ GameObject:
|
||||
- component: {fileID: 5507434294574195081}
|
||||
- component: {fileID: 7430854878422495237}
|
||||
- component: {fileID: 4653754203519193464}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: right_trigger
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -717,7 +772,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1577107718795983854}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: trigger_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -749,7 +804,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6509558431624773915}
|
||||
m_Layer: 0
|
||||
m_Layer: 21
|
||||
m_Name: thumbstick_rotation_center
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -780,10 +835,18 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 5466065062541431104}
|
||||
m_Modifications:
|
||||
- target: {fileID: 106450, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 140952, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: hint billboard
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 140952, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 444586, guid: 31fb231465c0ba947a9eb173e60f1679, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
@@ -836,6 +899,21 @@ PrefabInstance:
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -0.05
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3698684970970094947, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5615189752425831018, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6886418318191067747, guid: 31fb231465c0ba947a9eb173e60f1679,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 21
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 132cf4c4098ee7b479ff18c13432cc00
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2f20a68704983e4c9f8a61d5684cd7a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90dd5f3f0cdc75c4ca3d4c5dd604bf80
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 4094291069417963952}
|
||||
- component: {fileID: 4094291069417963953}
|
||||
- component: {fileID: 3968873566812316387}
|
||||
m_Layer: 0
|
||||
m_Name: SmartHandPresence Left
|
||||
m_TagString: NetworkHide
|
||||
@@ -51,3 +52,24 @@ MonoBehaviour:
|
||||
- {fileID: 11400000, guid: 6a509cd8fcf2901489e42ba44b5ac991, type: 2}
|
||||
- {fileID: 11400000, guid: 122b65a97d948e94da7a963fe110b068, type: 2}
|
||||
- {fileID: 11400000, guid: 5cd37cccbf3023d43818e487f29248c8, type: 2}
|
||||
--- !u!135 &3968873566812316387
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4094291069417963955}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Radius: 0.08
|
||||
m_Center: {x: -0.01, y: -0.03, z: -0.12}
|
||||
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 3440047626596586913}
|
||||
- component: {fileID: 3440047626596586917}
|
||||
- component: {fileID: 7103916417101120392}
|
||||
m_Layer: 0
|
||||
m_Name: SmartHandPresence Right
|
||||
m_TagString: NetworkHide
|
||||
@@ -51,3 +52,24 @@ MonoBehaviour:
|
||||
- {fileID: 11400000, guid: 2440c680cf2f3c947af431fb58aa75bb, type: 2}
|
||||
- {fileID: 11400000, guid: 772380a82cd83174cbd672430aca6941, type: 2}
|
||||
- {fileID: 11400000, guid: 41bbb243b8f86c24489e2262946c7e45, type: 2}
|
||||
--- !u!135 &7103916417101120392
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3440047626596586914}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Radius: 0.08
|
||||
m_Center: {x: -0.01, y: -0.03, z: -0.12}
|
||||
|
||||
@@ -28,6 +28,7 @@ Transform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.05, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7931660231731467089}
|
||||
m_RootOrder: 1
|
||||
@@ -51,6 +52,7 @@ MeshRenderer:
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
@@ -109,6 +111,7 @@ Transform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.555, z: 0}
|
||||
m_LocalScale: {x: 0.7, y: 0.5, z: 0.7}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7931660231731467089}
|
||||
m_RootOrder: 0
|
||||
@@ -132,6 +135,7 @@ MeshRenderer:
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
@@ -188,6 +192,7 @@ Transform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -76.37219, y: 4.513916, z: -12.719563}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7931660231006572051}
|
||||
- {fileID: 7931660229594303655}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class AudioSliderDragHandler : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||
{
|
||||
|
||||
public RectTransform sliderBackground; // Assign in Inspector
|
||||
public float minValue = 0f;
|
||||
public float maxValue = 1f;
|
||||
public float slideareaOffsetMultiplier = 0.9f;
|
||||
public float CurrentValue { get; private set; }
|
||||
|
||||
private RectTransform handleRect;
|
||||
private Vector2 backgroundStart;
|
||||
private float backgroundWidth;
|
||||
|
||||
public System.Action<float> OnValueChanged;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
handleRect = GetComponent<RectTransform>();
|
||||
|
||||
if (sliderBackground != null)
|
||||
{
|
||||
backgroundStart = sliderBackground.position;
|
||||
backgroundWidth = sliderBackground.rect.width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void SetHandlePosition(float normalizedValue)
|
||||
{
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
|
||||
float x = Mathf.Lerp(-limit, limit, normalizedValue);
|
||||
handleRect.localPosition = new Vector3(x, handleRect.localPosition.y, 0);
|
||||
|
||||
CurrentValue = normalizedValue;
|
||||
}
|
||||
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
//notify FMOD
|
||||
}
|
||||
private void UpdateSlider(PointerEventData eventData)
|
||||
{
|
||||
|
||||
//Debug.Log("UpDating Slider");
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
|
||||
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
|
||||
|
||||
|
||||
// Only allow dragging within 90% of the slider width, centered
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
float clampedX = Mathf.Clamp(localPoint.x, -limit, limit);
|
||||
|
||||
Vector3 newPosition = new Vector3(clampedX, handleRect.localPosition.y, handleRect.localPosition.z);
|
||||
handleRect.localPosition = newPosition;
|
||||
|
||||
// Normalize within the limited 90% range
|
||||
float normalized = (clampedX + limit) / (limit * 2f);
|
||||
//Debug.Log(normalized);
|
||||
CurrentValue = Mathf.Lerp(minValue, maxValue, normalized);
|
||||
|
||||
//Debug.Log(warningThreshholdValue);
|
||||
OnValueChanged?.Invoke(CurrentValue);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7aaef185c6472241ad9bb96b2e4ee6d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -10,33 +11,38 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
public Button turnOnButton;
|
||||
public ContinuousMoveProviderBase locomotion;
|
||||
|
||||
// Events for listeners
|
||||
public event Action<bool> OnLocomotionToggled; // true = enabled, false = disabled
|
||||
public event Action<float> OnSpeedChanged; // sends new speed
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
turnOnButton.onClick.AddListener(enableLocomotion);
|
||||
turnOffButton.onClick.AddListener(disableLocomotion);
|
||||
turnOffButton.gameObject.SetActive(false); // off by default
|
||||
enableLocomotion();
|
||||
turnOffButton.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void UpdateSpeed(float speed)
|
||||
{
|
||||
locomotion.moveSpeed = speed;
|
||||
OnSpeedChanged?.Invoke(speed);
|
||||
}
|
||||
|
||||
private void enableLocomotion()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
locomotion.enabled = true;
|
||||
turnOnButton.gameObject.SetActive(false);
|
||||
turnOffButton.gameObject.SetActive(true);
|
||||
OnLocomotionToggled?.Invoke(true);
|
||||
}
|
||||
|
||||
private void disableLocomotion()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
locomotion.enabled = false;
|
||||
turnOnButton.gameObject.SetActive(true);
|
||||
turnOffButton.gameObject.SetActive(false);
|
||||
OnLocomotionToggled?.Invoke(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FloorButtonVisualizer : MonoBehaviour
|
||||
@@ -9,7 +10,7 @@ public class FloorButtonVisualizer : MonoBehaviour
|
||||
public Sprite ActiveSprite;
|
||||
public bool ActiveState;
|
||||
private Image buttonImage;
|
||||
// Start is called before the first frame update
|
||||
|
||||
void Start()
|
||||
{
|
||||
buttonImage = gameObject.GetComponent<Image>();
|
||||
@@ -19,12 +20,23 @@ public class FloorButtonVisualizer : MonoBehaviour
|
||||
{
|
||||
this.ActiveState = true;
|
||||
buttonImage.sprite = ActiveSprite;
|
||||
//Debug.Log("Floorbutton of " + gameObject.name + " activated");
|
||||
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
this.ActiveState = false;
|
||||
buttonImage.sprite = InactiveSprite;
|
||||
//Debug.Log("Floorbutton of " + gameObject.name + " deactivated");
|
||||
}
|
||||
public void OnSelect(BaseEventData eventData) // joystick hover/select
|
||||
{
|
||||
buttonImage.sprite = ActiveSprite;
|
||||
// Play FMOD sound here
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, buttonImage.gameObject);
|
||||
}
|
||||
|
||||
public void OnDeselect(BaseEventData eventData) // joystick moves away
|
||||
{
|
||||
buttonImage.sprite = InactiveSprite;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
using static FMODEvents;
|
||||
|
||||
public class GrabAudioProfile : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GrabSoundType grabSoundType = GrabSoundType.Default;
|
||||
|
||||
public GrabSoundType GrabSoundType => grabSoundType;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7405dee79e06eca4795d2d3f39801f47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -23,6 +23,7 @@ public class HoverSlideButton : MonoBehaviour, IPointerEnterHandler, IPointerExi
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
SlideToPosition(onPosition);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, buttonTransform.gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
@@ -1,8 +1,11 @@
|
||||
using FMOD.Studio;
|
||||
using FMODUnity;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
@@ -20,9 +23,25 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
private Button button;
|
||||
private TeleportLocation target; // Target teleport position
|
||||
|
||||
private EventInstance TeleportingSound;
|
||||
FMOD.Studio.Bus SpecialBus; //FMOD bus variable
|
||||
|
||||
// External state: map must be held/visible
|
||||
public static bool MapIsOpen = false;
|
||||
private Menu menu;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
TeleportingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Teleport); //initialise the instance
|
||||
SpecialBus = FMODUnity.RuntimeManager.GetBus("bus:/LogicalMute");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
button = GetComponent<Button>();
|
||||
menu = FindObjectOfType<Menu>();
|
||||
|
||||
// Subscribe to button events
|
||||
button.onClick.AddListener(TeleportPlayer);
|
||||
@@ -48,6 +67,7 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
if (button != null && HoverSprite != null)
|
||||
{
|
||||
button.targetGraphic.GetComponent<Image>().sprite = HoverSprite;
|
||||
//AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +83,29 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Player-driven hover (joystick or controller)
|
||||
public void OnSelect(BaseEventData eventData)
|
||||
{
|
||||
if (HoverSprite != null)
|
||||
{
|
||||
button.targetGraphic.GetComponent<Image>().sprite = HoverSprite;
|
||||
}
|
||||
// Play FMOD hover sound
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, button.gameObject);
|
||||
}
|
||||
|
||||
public void OnDeselect(BaseEventData eventData)
|
||||
{
|
||||
if (NormalSprite != null)
|
||||
{
|
||||
button.targetGraphic.GetComponent<Image>().sprite = NormalSprite;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void TeleportPlayer()
|
||||
{
|
||||
TutorialAudioListener.SuppressNextTeleportSound = true;
|
||||
if (target == null || Player == null || teleportationProvider == null)
|
||||
{
|
||||
Debug.LogWarning("Teleportation failed: Target, Player, or TeleportationProvider is missing.");
|
||||
@@ -90,5 +131,23 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
// Refresh the button state
|
||||
button.interactable = false;
|
||||
button.interactable = true;
|
||||
|
||||
//muting teleportation when not needed
|
||||
StartCoroutine(MuteBusForSeconds(2.0f));
|
||||
|
||||
TeleportingSound.start(); //playing 2d oneshot
|
||||
}
|
||||
|
||||
private IEnumerator MuteBusForSeconds(float duration)
|
||||
{
|
||||
// Lower volume to 0 instantly
|
||||
SpecialBus.setVolume(0f);
|
||||
Debug.Log("[MenuTeleportButton] Muting LogicalMute bus...");
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
|
||||
// Restore volume
|
||||
SpecialBus.setVolume(1f);
|
||||
Debug.Log("[MenuTeleportButton] Unmuted LogicalMute bus.");
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,12 @@ public class Menu : MonoBehaviour
|
||||
private float floor1LowerLimit = -5;
|
||||
private bool activated = true;
|
||||
|
||||
|
||||
|
||||
private bool hasFloorButtonSoundInitialized = false;
|
||||
private bool hasMapButtonSoundInitialized = false;
|
||||
|
||||
public static bool IsMapOpen { get; private set; }
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -84,17 +89,26 @@ public class Menu : MonoBehaviour
|
||||
|
||||
private void activateMapPanel()
|
||||
{
|
||||
if (hasMapButtonSoundInitialized) //if statement to check if the button sound instance was initiated in the beginning, thie applies to Map and Floor click sounds.
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
else
|
||||
hasMapButtonSoundInitialized = true;
|
||||
|
||||
SetActiveTab(MenuTab.Map);
|
||||
|
||||
IsMapOpen = canvas.enabled;
|
||||
}
|
||||
|
||||
private void activateOptionsPanel()
|
||||
{
|
||||
SetActiveTab(MenuTab.Options);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
private void activateCreditsPanel()
|
||||
{
|
||||
SetActiveTab(MenuTab.Credits);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
private void SetActiveTab(MenuTab tab)
|
||||
@@ -115,6 +129,8 @@ public class Menu : MonoBehaviour
|
||||
public void setCanvasVisibility(bool enabled)
|
||||
{
|
||||
canvas.enabled = enabled;
|
||||
|
||||
IsMapOpen = enabled;
|
||||
}
|
||||
|
||||
private void ToggleMenu(InputAction.CallbackContext context)
|
||||
@@ -125,6 +141,8 @@ public class Menu : MonoBehaviour
|
||||
|
||||
// Toggle the menu visibility
|
||||
setCanvasVisibility(!canvas.enabled);
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.MapOpen, gameObject);
|
||||
}
|
||||
|
||||
public Transform updateMenuTransform()
|
||||
@@ -154,6 +172,7 @@ public class Menu : MonoBehaviour
|
||||
}
|
||||
private void DisplayFloor1()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
//Debug.Log("Dispaling floor 1");
|
||||
Floor1Panel.gameObject.SetActive(true);
|
||||
Floor2Panel.gameObject.SetActive(false);
|
||||
@@ -165,7 +184,14 @@ public class Menu : MonoBehaviour
|
||||
buttonComponent.interactable = true;
|
||||
}
|
||||
private void DisplayFloor2()
|
||||
{
|
||||
{
|
||||
|
||||
|
||||
if (hasFloorButtonSoundInitialized)
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
else
|
||||
hasFloorButtonSoundInitialized = true;
|
||||
|
||||
//Debug.Log("Dispaling floor 2");
|
||||
Floor1Panel.gameObject.SetActive(false);
|
||||
Floor2Panel.gameObject.SetActive(true);
|
||||
@@ -3,7 +3,7 @@ using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using TMPro;
|
||||
|
||||
public class SliderDragHandler : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
|
||||
public class MoveSliderDragHandler : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
|
||||
{
|
||||
public RectTransform sliderBackground; // Assign in Inspector
|
||||
public float minValue = 2f;
|
||||
@@ -45,9 +45,12 @@ public class SliderDragHandler : MonoBehaviour, IDragHandler, IBeginDragHandler,
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
configurator.UpdateSpeed(CurrentValue);
|
||||
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
}
|
||||
private void UpdateSlider(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log("UpDating Slider");
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SliderToVCA : MonoBehaviour
|
||||
{
|
||||
public enum VCATarget
|
||||
{
|
||||
Master,
|
||||
Ambiences,
|
||||
Music,
|
||||
SFX,
|
||||
UI
|
||||
}
|
||||
|
||||
public VCATarget target;
|
||||
private AudioSliderDragHandler slider;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
slider = GetComponent<AudioSliderDragHandler>();
|
||||
slider.OnValueChanged += ApplyVolume;
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
float initialValue = GetInitialValueFromAudioManager();
|
||||
slider.SetHandlePosition(initialValue); // we will add this function
|
||||
}
|
||||
|
||||
|
||||
private float GetInitialValueFromAudioManager()
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case VCATarget.Master:
|
||||
return AudioManager.Instance.MasterVolume;
|
||||
case VCATarget.Ambiences:
|
||||
return AudioManager.Instance.AmbienceVolume;
|
||||
case VCATarget.Music:
|
||||
return AudioManager.Instance.MusicVolume;
|
||||
case VCATarget.SFX:
|
||||
return AudioManager.Instance.SFXVolume;
|
||||
case VCATarget.UI:
|
||||
return AudioManager.Instance.UIVolume;
|
||||
default:
|
||||
return 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Constantly push slider value to the VCA
|
||||
ApplyVolume(slider.CurrentValue);
|
||||
//Debug.Log("CurrentValue: " + slider.CurrentValue);
|
||||
}
|
||||
|
||||
private void ApplyVolume(float value)
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case VCATarget.Master:
|
||||
AudioManager.Instance.SetMasterVCA(value);
|
||||
//Debug.LogError(value);
|
||||
break;
|
||||
|
||||
case VCATarget.Ambiences:
|
||||
AudioManager.Instance.SetAmbientVCA(value);
|
||||
break;
|
||||
|
||||
case VCATarget.Music:
|
||||
AudioManager.Instance.SetMusicVCA(value);
|
||||
break;
|
||||
|
||||
case VCATarget.SFX:
|
||||
AudioManager.Instance.SetSFXVCA(value);
|
||||
break;
|
||||
|
||||
case VCATarget.UI:
|
||||
AudioManager.Instance.SetUIVCA(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebe1ab889a9bed940995d4f47bc743ef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,206 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using static FMODEvents;
|
||||
using FMODUnity;
|
||||
|
||||
public class TutorialAudioListener : MonoBehaviour
|
||||
{
|
||||
[Header("References")]
|
||||
[SerializeField] private TutorialController tutorialController;
|
||||
[SerializeField] private ContinuoslocomotionConfigurator locomotionConfigurator;
|
||||
|
||||
private InputAction moveAction;
|
||||
private InputAction turnAction;
|
||||
private TeleportationProvider teleportationProvider;
|
||||
|
||||
private float lastStepTime;
|
||||
|
||||
[Header("Settings")]
|
||||
[SerializeField] private float baseStepRate = 0.5f; // Step interval at joystick = 1 and slider = 1
|
||||
[SerializeField] private float joystickThreshold = 0.1f; // Minimum stick movement to count as walking
|
||||
|
||||
private float settingsSpeedMultiplier = 1f; // From slider (1 = default)
|
||||
private bool locomotionEnabled = false;
|
||||
|
||||
private Vector2 currentMoveVector;
|
||||
|
||||
public static bool SuppressNextTeleportSound = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (tutorialController == null)
|
||||
tutorialController = FindObjectOfType<TutorialController>();
|
||||
|
||||
if (locomotionConfigurator == null)
|
||||
locomotionConfigurator = FindObjectOfType<ContinuoslocomotionConfigurator>();
|
||||
|
||||
if (tutorialController != null)
|
||||
{
|
||||
moveAction = tutorialController.moveProvider.leftHandMoveAction.action;
|
||||
turnAction = tutorialController.turnProvider.rightHandSnapTurnAction.action;
|
||||
teleportationProvider = tutorialController.teleportProvider;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (moveAction != null)
|
||||
{
|
||||
moveAction.performed += OnMoveInput;
|
||||
moveAction.canceled += OnMoveCanceled;
|
||||
}
|
||||
|
||||
if (turnAction != null)
|
||||
turnAction.performed += OnTurnPerformed;
|
||||
|
||||
if (teleportationProvider != null)
|
||||
teleportationProvider.endLocomotion += OnTeleportEnd;
|
||||
|
||||
if (locomotionConfigurator != null)
|
||||
{
|
||||
locomotionConfigurator.OnLocomotionToggled += HandleLocomotionToggled;
|
||||
locomotionConfigurator.OnSpeedChanged += HandleSpeedChanged;
|
||||
}
|
||||
|
||||
if (tutorialController != null)
|
||||
tutorialController.OnGrab += HandleGrab;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (moveAction != null)
|
||||
{
|
||||
moveAction.performed -= OnMoveInput;
|
||||
moveAction.canceled -= OnMoveCanceled;
|
||||
}
|
||||
|
||||
if (turnAction != null)
|
||||
turnAction.performed -= OnTurnPerformed;
|
||||
|
||||
if (teleportationProvider != null)
|
||||
teleportationProvider.endLocomotion -= OnTeleportEnd;
|
||||
|
||||
if (locomotionConfigurator != null)
|
||||
{
|
||||
locomotionConfigurator.OnLocomotionToggled -= HandleLocomotionToggled;
|
||||
locomotionConfigurator.OnSpeedChanged -= HandleSpeedChanged;
|
||||
}
|
||||
if (tutorialController != null)
|
||||
tutorialController.OnGrab -= HandleGrab;
|
||||
}
|
||||
|
||||
private void HandleLocomotionToggled(bool enabled)
|
||||
{
|
||||
locomotionEnabled = enabled;
|
||||
}
|
||||
|
||||
private void HandleSpeedChanged(float newSpeed)
|
||||
{
|
||||
// Slider is allowed to range normally but we clamp for stability
|
||||
settingsSpeedMultiplier = Mathf.Clamp(newSpeed, 0.4f, 1.2f);
|
||||
}
|
||||
|
||||
private void OnMoveInput(InputAction.CallbackContext ctx)
|
||||
{
|
||||
currentMoveVector = ctx.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
private void OnMoveCanceled(InputAction.CallbackContext ctx)
|
||||
{
|
||||
currentMoveVector = Vector2.zero;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
TryPlayStep();
|
||||
}
|
||||
|
||||
private void TryPlayStep()
|
||||
{
|
||||
if (!locomotionEnabled)
|
||||
return;
|
||||
|
||||
float joystickMagnitude = currentMoveVector.magnitude;
|
||||
|
||||
if (joystickMagnitude < joystickThreshold)
|
||||
return; // Not moving enough to walk
|
||||
|
||||
float sliderInfluence = 1f + (settingsSpeedMultiplier) * 0.25f;
|
||||
float effectiveMagnitude = joystickMagnitude * sliderInfluence;
|
||||
|
||||
float dynamicCooldown = baseStepRate / Mathf.Max(effectiveMagnitude, 0.01f);
|
||||
dynamicCooldown = Mathf.Clamp(dynamicCooldown, 0.33f, 0.65f);
|
||||
|
||||
if (Time.time - lastStepTime < dynamicCooldown)
|
||||
return;
|
||||
|
||||
lastStepTime = Time.time;
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.StepOverall, gameObject);
|
||||
}
|
||||
|
||||
private void OnTurnPerformed(InputAction.CallbackContext context)
|
||||
{
|
||||
// If magnitude above threshold = walking don't play spin sound
|
||||
if (currentMoveVector.magnitude > joystickThreshold)
|
||||
return;
|
||||
|
||||
// Otherwise play turning sound
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.StepSpin, gameObject);
|
||||
}
|
||||
|
||||
private void OnTeleportEnd(LocomotionSystem locomotionSystem)
|
||||
{
|
||||
// If magnitude above threshold = walking don't play the "teleportaion" step sound
|
||||
if (currentMoveVector.magnitude > joystickThreshold)
|
||||
return;
|
||||
|
||||
if (SuppressNextTeleportSound)
|
||||
{
|
||||
SuppressNextTeleportSound = false; // reset
|
||||
return; // Skip playing landing step
|
||||
}
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Steps, gameObject);
|
||||
Debug.Log("[TeleportationListen] Teleport sound played.");
|
||||
}
|
||||
|
||||
private EventReference GetGrabEvent(GrabSoundType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GrabSoundType.Bow:
|
||||
return FMODEvents.Instance.BowGrab;
|
||||
|
||||
case GrabSoundType.Sprayer:
|
||||
return FMODEvents.Instance.SprayerGrab;
|
||||
|
||||
//Add more objects for grabbing here and do not forget to define them in FMODEvents.cs
|
||||
//Add the GrabAudioProfile.cs component to an object instance
|
||||
|
||||
default:
|
||||
return FMODEvents.Instance.DefaultGrab;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void HandleGrab(XRGrabInteractable grab)
|
||||
{
|
||||
if (grab == null)
|
||||
return;
|
||||
|
||||
var profile = grab.GetComponent<GrabAudioProfile>();
|
||||
GrabSoundType type = profile != null
|
||||
? profile.GrabSoundType
|
||||
: GrabSoundType.Default;
|
||||
|
||||
EventReference grabEvent = GetGrabEvent(type);
|
||||
Debug.Log(grabEvent);
|
||||
AudioManager.Instance.PlayAttachedInstance(grabEvent, grab.gameObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca400fa6ff24b104190032fa85eedf91
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -10,6 +10,8 @@ namespace _PROJECT.NewHandPresence
|
||||
public bool showController;
|
||||
public bool showHand;
|
||||
|
||||
private bool inDoorGrabRadius = false;
|
||||
|
||||
public InputDeviceCharacteristics controllerCharacteristics;
|
||||
public List<ControllerInformationScriptableObject> controllerInformation;
|
||||
|
||||
@@ -55,14 +57,14 @@ namespace _PROJECT.NewHandPresence
|
||||
var devices = new List<InputDevice>();
|
||||
InputDevices.GetDevicesWithCharacteristics(controllerCharacteristics, devices);
|
||||
|
||||
Debug.Log("Found devices: " + devices.Count);
|
||||
//Debug.Log("Found devices: " + devices.Count);
|
||||
|
||||
if (devices.Count <= 0) return;
|
||||
|
||||
_targetDevice = devices[0];
|
||||
|
||||
Debug.Log("Found device: " + _targetDevice.name + _targetDevice.characteristics);
|
||||
|
||||
|
||||
ControllerInformationScriptableObject controllerInfo =
|
||||
controllerInformation.Find(x => _targetDevice.name.ToLower().Contains(x.controllerName.ToLower()));
|
||||
|
||||
@@ -70,19 +72,36 @@ namespace _PROJECT.NewHandPresence
|
||||
|
||||
var transform1 = transform.parent; // Right/Left hand direct position
|
||||
|
||||
_spawnedController = Instantiate(controllerInfo.controllerPrefab,
|
||||
transform1.TransformPoint(Quaternion.Euler(controllerInfo.controllerRotationOffset) * controllerInfo.controllerOffset),
|
||||
transform1.rotation * Quaternion.Euler(controllerInfo.controllerRotationOffset),
|
||||
transform1);
|
||||
_xrControllerAnimator = _spawnedController.GetComponent<XRControllerAnimator>();
|
||||
|
||||
_spawnedHandModel = Instantiate(controllerInfo.handPrefab,
|
||||
// --- Spawn hand model first ---
|
||||
_spawnedHandModel = Instantiate(
|
||||
controllerInfo.handPrefab,
|
||||
transform1.TransformPoint(Quaternion.Euler(controllerInfo.handRotationOffset) * controllerInfo.handOffset),
|
||||
transform1.rotation * Quaternion.Euler(controllerInfo.handRotationOffset),
|
||||
transform1.rotation * Quaternion.Euler(controllerInfo.handRotationOffset),
|
||||
transform1);
|
||||
_handAnimator = _spawnedHandModel.GetComponent<Animator>();
|
||||
|
||||
// --- Find the correct child in the hand prefab ---
|
||||
Transform attachPoint = null;
|
||||
if (_spawnedHandModel.name.Contains("Left"))
|
||||
attachPoint = _spawnedHandModel.transform.Find("hands:l_hand_world");
|
||||
else if (_spawnedHandModel.name.Contains("Right"))
|
||||
attachPoint = _spawnedHandModel.transform.Find("hands:r_hand_world");
|
||||
|
||||
if (attachPoint == null)
|
||||
{
|
||||
Debug.LogWarning("Attach point not found in hand prefab, defaulting to hand root.");
|
||||
attachPoint = _spawnedHandModel.transform;
|
||||
}
|
||||
|
||||
// --- Spawn controller under the hand ---
|
||||
_spawnedController = Instantiate(controllerInfo.controllerPrefab, attachPoint);
|
||||
_spawnedController.transform.localPosition = controllerInfo.controllerOffset;
|
||||
_spawnedController.transform.localRotation = Quaternion.Euler(controllerInfo.controllerRotationOffset);
|
||||
|
||||
_xrControllerAnimator = _spawnedController.GetComponent<XRControllerAnimator>();
|
||||
}
|
||||
|
||||
|
||||
private void UpdateControllerAnimation()
|
||||
{
|
||||
_xrControllerAnimator.UpdateAnimations(_targetDevice);
|
||||
@@ -96,5 +115,37 @@ namespace _PROJECT.NewHandPresence
|
||||
updateAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (!inDoorGrabRadius) return;
|
||||
if (_spawnedHandModel != null)
|
||||
_spawnedHandModel.SetActive(false);
|
||||
|
||||
if (_spawnedController != null)
|
||||
_spawnedController.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// Let Update handle visibility naturally
|
||||
// or force refresh:
|
||||
if (_spawnedHandModel != null)
|
||||
_spawnedHandModel.SetActive(showHand);
|
||||
|
||||
if (_spawnedController != null)
|
||||
_spawnedController.SetActive(showController);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.GetComponent<DoorHandReplacer>() == null) return;
|
||||
inDoorGrabRadius = true;
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.GetComponent<DoorHandReplacer>() == null) return;
|
||||
inDoorGrabRadius = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ namespace _PROJECT.NewHandPresence
|
||||
|
||||
private List<XRGrabInteractable> _grabInteractables = new List<XRGrabInteractable>();
|
||||
private XRGrabInteractable _grabInteractable;
|
||||
public event Action<XRGrabInteractable> OnGrab;
|
||||
|
||||
private GameObject _billboard;
|
||||
|
||||
@@ -93,23 +94,27 @@ namespace _PROJECT.NewHandPresence
|
||||
break;
|
||||
case TutorialState.Turn:
|
||||
ShowTurnHint();
|
||||
SetControllerVisibility(true);
|
||||
break;
|
||||
case TutorialState.Move:
|
||||
ShowLocomotionHint();
|
||||
SetControllerVisibility(true);
|
||||
break;
|
||||
case TutorialState.Teleport:
|
||||
ShowTeleportHint();
|
||||
SetControllerVisibility(true);
|
||||
break;
|
||||
case TutorialState.WaitForGrip:
|
||||
SetHandsVisibility(true);
|
||||
SetControllerVisibility(false);
|
||||
break;
|
||||
case TutorialState.Grip:
|
||||
SetHandsVisibility(false);
|
||||
//SetHandsVisibility(false);
|
||||
CreateBillboard(_grabInteractable.gameObject, "Grab me!");
|
||||
ShowGripHint();
|
||||
SetControllerVisibility(true);
|
||||
break;
|
||||
case TutorialState.Done:
|
||||
SetHandsVisibility(true);
|
||||
SetControllerVisibility(false);
|
||||
DestroyBillboard();
|
||||
break;
|
||||
default:
|
||||
@@ -215,6 +220,11 @@ namespace _PROJECT.NewHandPresence
|
||||
|
||||
private void OnGripPerformed(SelectEnterEventArgs arg0)
|
||||
{
|
||||
var grab = arg0.interactableObject as XRGrabInteractable;
|
||||
|
||||
// Notify any listeners
|
||||
OnGrab?.Invoke(grab);
|
||||
|
||||
if (_state != TutorialState.Grip) return;
|
||||
Debug.Log("Grip performed");
|
||||
UpdateState(_state.Next());
|
||||
|
||||
@@ -491,7 +491,7 @@ GameObject:
|
||||
- component: {fileID: 682103954761243621}
|
||||
- component: {fileID: 7057699864170177475}
|
||||
m_Layer: 0
|
||||
m_Name: Button (1)
|
||||
m_Name: Multiplayer button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -904,7 +904,7 @@ GameObject:
|
||||
- component: {fileID: 972804331316405723}
|
||||
- component: {fileID: 4409105029378525441}
|
||||
m_Layer: 0
|
||||
m_Name: Button
|
||||
m_Name: Start Playing Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -1691,8 +1691,8 @@ GameObject:
|
||||
- component: {fileID: 2403481060362975301}
|
||||
- component: {fileID: 150987804393607111}
|
||||
- component: {fileID: 2849620166313326850}
|
||||
- component: {fileID: 5954151782133518590}
|
||||
- component: {fileID: 3623653364064856318}
|
||||
- component: {fileID: 6605356447225771655}
|
||||
m_Layer: 0
|
||||
m_Name: NetworkManagerUI
|
||||
m_TagString: Untagged
|
||||
@@ -1714,7 +1714,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1938936874169646409}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 33
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -1783,30 +1783,6 @@ MonoBehaviour:
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &5954151782133518590
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8920648335286241163}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 891e12d2218566241a2acd395d5d3892, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
VRToggle: {fileID: 48284653022802127}
|
||||
startPlayingButton: {fileID: 4409105029378525441}
|
||||
reloadButton: {fileID: 3248072787155925101}
|
||||
joinMultiplayerButton: {fileID: 7057699864170177475}
|
||||
serverListContainer: {fileID: 1182580605524482518}
|
||||
serverListItemPrefab: {fileID: 8155264290485183093, guid: 161eef8a6244baa46b0988be67d74a08,
|
||||
type: 3}
|
||||
statusText: {fileID: 2762709333159616741}
|
||||
quitButton: {fileID: 856744223094475457}
|
||||
networkDiscovery: {fileID: 0}
|
||||
uiCamera: {fileID: 0}
|
||||
placeholderAudioListener: {fileID: 3623653364064856318}
|
||||
--- !u!81 &3623653364064856318
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1815,6 +1791,29 @@ AudioListener:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8920648335286241163}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &6605356447225771655
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8920648335286241163}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0be1f6fa249e2b74d80c57af214b930d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
VRToggle: {fileID: 48284653022802127}
|
||||
startPlayingButton: {fileID: 4409105029378525441}
|
||||
reloadButton: {fileID: 3248072787155925101}
|
||||
joinMultiplayerButton: {fileID: 7057699864170177475}
|
||||
serverListContainer: {fileID: 6604224998162932651}
|
||||
IPButton: {fileID: 8799561993934626415}
|
||||
statusText: {fileID: 2762709333159616741}
|
||||
quitButton: {fileID: 856744223094475457}
|
||||
networkDiscovery: {fileID: 0}
|
||||
uiCamera: {fileID: 0}
|
||||
placeholderAudioListener: {fileID: 0}
|
||||
--- !u!1 &8930421849167053048
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -123,7 +123,6 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6021721823031538141}
|
||||
- component: {fileID: 4707456952479937532}
|
||||
m_Layer: 0
|
||||
m_Name: Portal
|
||||
m_TagString: Untagged
|
||||
@@ -148,149 +147,8 @@ Transform:
|
||||
- {fileID: 1266057804064659733}
|
||||
- {fileID: 5614923999591170275}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &4707456952479937532
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4777591596180506993}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 4d691c6581003c94bbfe74b21deb8784, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 0.8
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 40
|
||||
Pan2D: 0
|
||||
rolloffMode: 2
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1.0028496
|
||||
inSlope: -40.015934
|
||||
outSlope: -40.015934
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.03449707
|
||||
value: 0.49145508
|
||||
inSlope: -10.0039835
|
||||
outSlope: -10.0039835
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.1
|
||||
value: 0.25
|
||||
inSlope: -2.5009959
|
||||
outSlope: -2.5009959
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.2
|
||||
value: 0.125
|
||||
inSlope: -0.62524897
|
||||
outSlope: -0.62524897
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.4348816
|
||||
value: 0.03970337
|
||||
inSlope: -0.15631224
|
||||
outSlope: -0.15631224
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.8
|
||||
value: 0
|
||||
inSlope: -0.03907806
|
||||
outSlope: -0.03907806
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.9980469
|
||||
value: 0
|
||||
inSlope: -0.02500997
|
||||
outSlope: -0.02500997
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &6014189720456933605
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -409,6 +267,8 @@ GameObject:
|
||||
- component: {fileID: 2501038558182094805}
|
||||
- component: {fileID: 8089229340536715967}
|
||||
- component: {fileID: 7305371174892849299}
|
||||
- component: {fileID: 3068203956378754948}
|
||||
- component: {fileID: 4895790527008502425}
|
||||
m_Layer: 0
|
||||
m_Name: Portal
|
||||
m_TagString: Untagged
|
||||
@@ -527,3 +387,55 @@ MonoBehaviour:
|
||||
portalScene: {fileID: 7751003758844882782}
|
||||
occlusionPortal: {fileID: 0}
|
||||
_shouldTeleport: 1
|
||||
teleportationProvider: {fileID: 0}
|
||||
--- !u!54 &3068203956378754948
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8507770192447112443}
|
||||
serializedVersion: 4
|
||||
m_Mass: 0.001
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 0
|
||||
m_ImplicitTensor: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 1
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &4895790527008502425
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8507770192447112443}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6c6205a218222364ca440c740b7a6b8f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
SelectAudio:
|
||||
Guid:
|
||||
Data1: 214152321
|
||||
Data2: 1136432684
|
||||
Data3: -1979358295
|
||||
Data4: 727957873
|
||||
Path: event:/Ambiences/PortalSpacial
|
||||
SoundOcclusionWidening: 1
|
||||
PlayerOcclusionWidening: 1
|
||||
OcclusionLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 268438528
|
||||
|
||||
@@ -2,12 +2,27 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
public GameObject InstructionText;
|
||||
|
||||
private EventInstance PortalEntrance;
|
||||
private EventInstance SpaceMusic;
|
||||
|
||||
private bool musicStarted = false;
|
||||
private void Awake()
|
||||
{
|
||||
PortalEntrance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.PortalEnter);
|
||||
|
||||
SpaceMusic = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Kosmos);
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
|
||||
XROrigin player = other.GetComponent<XROrigin>();
|
||||
if (player == null) return;
|
||||
|
||||
@@ -18,7 +33,7 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
InstructionText.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
|
||||
//Debug.Log("Instruction text rotation" + InstructionText.transform.rotation);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InstructionText.transform.rotation = Quaternion.Euler(0f, 0f, -180f);
|
||||
@@ -30,7 +45,21 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
playerGravity.isInSpace = true;
|
||||
}
|
||||
|
||||
|
||||
Debug.Log(other + " entered space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
|
||||
if (!musicStarted)
|
||||
{
|
||||
SpaceMusic.start();
|
||||
musicStarted = true;
|
||||
}
|
||||
|
||||
// Fade music in on entering
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 0f);
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -42,9 +71,14 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
if (playerGravity != null)
|
||||
{
|
||||
StartCoroutine(DelayExit(playerGravity));
|
||||
|
||||
//playerGravity.AdjustGravity(new Quaternion()); // Set Gravity back to default
|
||||
}
|
||||
Debug.Log(other + " left space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
// Fade music out on leaving
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private IEnumerator DelayExit(GravityHandler playerGravity)
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.XR;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
@@ -34,7 +35,11 @@ public class StencilPortal : MonoBehaviour
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
//Debug.Log("Something entered portal");
|
||||
if (other.GetComponent<UniversalAdditionalCameraData>() == null) return;
|
||||
//if (other.GetComponent<XROrigin>() == null) return;
|
||||
XROrigin player = other.GetComponentInParent<XROrigin>();
|
||||
if (player == null) return;
|
||||
|
||||
if (occlusionPortal != null)
|
||||
{
|
||||
@@ -55,8 +60,8 @@ public class StencilPortal : MonoBehaviour
|
||||
|
||||
if (teleportationProvider != null)
|
||||
{
|
||||
Vector3 targetPosition = TransformPositionBetweenPortals(this, targetPortal, other.transform.position);
|
||||
Quaternion targetRotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
Vector3 targetPosition = TransformPositionBetweenPortals(this, targetPortal, player.transform.position);
|
||||
Quaternion targetRotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
|
||||
TeleportRequest request = new TeleportRequest
|
||||
{
|
||||
@@ -65,20 +70,23 @@ public class StencilPortal : MonoBehaviour
|
||||
matchOrientation = MatchOrientation.TargetUpAndForward
|
||||
};
|
||||
|
||||
|
||||
teleportationProvider.QueueTeleportRequest(request);
|
||||
other.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
|
||||
player.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("TeleportationProvider is not assigned!", this);
|
||||
other.transform.position = TransformPositionBetweenPortals(this, targetPortal, other.transform.position);
|
||||
other.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
player.transform.position = TransformPositionBetweenPortals(this, targetPortal, player.transform.position);
|
||||
player.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
}
|
||||
|
||||
if (destroyAfterTeleport)
|
||||
{
|
||||
Destroy(gameObject, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -86,6 +94,7 @@ public class StencilPortal : MonoBehaviour
|
||||
AllowTeleport();
|
||||
if (!_shouldTeleport || IsInvoking(nameof(AllowTeleport))) return;
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
Debug.Log(transform.name + " player exited");
|
||||
Invoke(nameof(AllowTeleport), 1f);
|
||||
}
|
||||
|
||||
@@ -1,42 +1,52 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using UnityEngine;
|
||||
using UnityEngine.PlayerLoop;
|
||||
using UnityEngine.XR.Content.Interaction;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class AlarmTrigger : MonoBehaviour
|
||||
{
|
||||
public XRPushButton PushButton;
|
||||
public AudioSource AlarmSequence;
|
||||
public AudioSource VentilationSequence;
|
||||
private bool hasAlarm = false;
|
||||
|
||||
private EventInstance AlarmSound;
|
||||
|
||||
private FirstPersonOcclusion occlusion;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
AlarmSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.ServerRoomAlarm); //initialise the instance
|
||||
|
||||
occlusion = GetComponent<FirstPersonOcclusion>(); //apply occlusion
|
||||
if (occlusion != null)
|
||||
{
|
||||
occlusion.InitialiseWithInstance(AlarmSound);
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
|
||||
if (PushButton != null)
|
||||
{
|
||||
PushButton.onPress.AddListener(OnButtonPressed);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void OnButtonPressed()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ServerRoomButton, PushButton.gameObject); //3d oneshot instance
|
||||
Debug.Log("Alarm button Pressed!");
|
||||
|
||||
if (!AlarmSequence.isPlaying) { //if alarm isn't already triggered.
|
||||
VentilationSequence.Stop();
|
||||
AlarmSequence.Play();
|
||||
hasAlarm = true;
|
||||
|
||||
|
||||
if (!AudioManager.IsPlaying(AlarmSound))
|
||||
{
|
||||
AlarmSound.start();
|
||||
}
|
||||
|
||||
}
|
||||
void Update()
|
||||
{
|
||||
if(hasAlarm && !AlarmSequence.isPlaying) // If alarm state has ended.
|
||||
{
|
||||
VentilationSequence.Play(); // Return to normal.
|
||||
hasAlarm = false;
|
||||
}
|
||||
AlarmSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //updating 3d attributes
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: ac65e655dd40bcd48b72b3f8ddcf45bd,
|
||||
type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 2488785156293713400}
|
||||
addedObject: {fileID: 7307865721977554787}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: ac65e655dd40bcd48b72b3f8ddcf45bd, type: 3}
|
||||
--- !u!1 &7023167506039495560 stripped
|
||||
GameObject:
|
||||
@@ -126,129 +126,30 @@ MeshCollider:
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_Convex: 1
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 6074735673208717538, guid: ac65e655dd40bcd48b72b3f8ddcf45bd, type: 3}
|
||||
--- !u!82 &2488785156293713400
|
||||
AudioSource:
|
||||
--- !u!114 &7307865721977554787
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7023167506039495560}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 5bcb02b6a0d913d4c90781538c787b2f, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 0.05
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 10
|
||||
Pan2D: 0
|
||||
rolloffMode: 2
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6c6205a218222364ca440c740b7a6b8f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
SelectAudio:
|
||||
Guid:
|
||||
Data1: 2088767158
|
||||
Data2: 1236037630
|
||||
Data3: 1977926589
|
||||
Data4: -1933500246
|
||||
Path: event:/Ambiences/Server/OnlyHum
|
||||
SoundOcclusionWidening: 1
|
||||
PlayerOcclusionWidening: 1
|
||||
OcclusionLayer:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.1
|
||||
value: 1
|
||||
inSlope: -10.0039835
|
||||
outSlope: -10.0039835
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.2
|
||||
value: 0.5
|
||||
inSlope: -2.5009959
|
||||
outSlope: -2.5009959
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.4
|
||||
value: 0.25
|
||||
inSlope: -0.62524897
|
||||
outSlope: -0.62524897
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.7940491
|
||||
value: 0.057891846
|
||||
inSlope: -0.27374932
|
||||
outSlope: -0.27374932
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.24773687
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0.018304445
|
||||
inSlope: -0.10003988
|
||||
outSlope: -0.10003988
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
m_Bits: 268438528
|
||||
|
||||
@@ -58,11 +58,13 @@ namespace _PROJECT.Multiplayer.NewBow
|
||||
if (PullAmount == 0 & newPull > 0)
|
||||
{
|
||||
pullSounds.Play();
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BowPullback, gameObject);
|
||||
}
|
||||
|
||||
if (PullAmount < 0.98f & newPull >= 0.98f)
|
||||
{
|
||||
maxPullSounds.Play();
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BowPullbackMax, gameObject);
|
||||
}
|
||||
|
||||
PullAmount = newPull;
|
||||
|
||||
@@ -3,7 +3,16 @@ guid: 93a8cd8d2c83a1c4da7720c8a59fa706
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
defaultReferences:
|
||||
- m_InteractionManager: {instanceID: 0}
|
||||
- m_CustomReticle: {instanceID: 0}
|
||||
- m_AttachTransform: {instanceID: 0}
|
||||
- m_SecondaryAttachTransform: {instanceID: 0}
|
||||
- pullMin: {instanceID: 0}
|
||||
- pullMax: {instanceID: 0}
|
||||
- pullSounds: {fileID: 11400000, guid: 3c359cbce1e053d4f97c86ed8998405b, type: 2}
|
||||
- maxPullSounds: {fileID: 11400000, guid: a052046b894aee042a62bcc609a5afc7, type: 2}
|
||||
- stringRenderer: {instanceID: 0}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
|
||||
@@ -234,6 +234,7 @@ GameObject:
|
||||
- component: {fileID: 7888619987859216817}
|
||||
- component: {fileID: 4423156612440135391}
|
||||
- component: {fileID: 7492444969113415356}
|
||||
- component: {fileID: 7342908215105292480}
|
||||
m_Layer: 2
|
||||
m_Name: TwoHandedBow
|
||||
m_TagString: Untagged
|
||||
@@ -258,7 +259,7 @@ Transform:
|
||||
- {fileID: 390935087474091724}
|
||||
- {fileID: 4619910383191300727}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!136 &6168004718997640786
|
||||
CapsuleCollider:
|
||||
@@ -663,7 +664,19 @@ MonoBehaviour:
|
||||
arrowPrefab: {fileID: 5016704277711162129, guid: 5c51937e899ec9443a1757aefe9d49cb,
|
||||
type: 3}
|
||||
_arrowNetworkObject: {fileID: 0}
|
||||
lastKnownLaunchDirection: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7342908215105292480
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6208239738837795797}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7405dee79e06eca4795d2d3f39801f47, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
grabSoundType: 1
|
||||
--- !u!1 &6812977384739690676
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -817,9 +830,9 @@ LineRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Positions:
|
||||
- {x: -76.62825, y: 6.285376, z: -11.368651}
|
||||
- {x: -76.61169, y: 5.785746, z: -11.358892}
|
||||
- {x: -76.59347, y: 5.2361526, z: -11.348157}
|
||||
- {x: -4.723722, y: 5.7963943, z: 73.294556}
|
||||
- {x: -4.7137837, y: 5.496616, z: 73.30041}
|
||||
- {x: -4.702852, y: 5.1668596, z: 73.30685}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 0.01
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace _PROJECT.Multiplayer.NewBow
|
||||
OwnerDeselectRpc(Owner, arrow);
|
||||
_interactionManager.SelectExit(_notch, _notch.firstInteractableSelected);
|
||||
PlayReleaseSoundRPC();
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BowArrowRelease, gameObject);
|
||||
}
|
||||
|
||||
_arrowNetworkObject = null;
|
||||
@@ -81,6 +82,7 @@ namespace _PROJECT.Multiplayer.NewBow
|
||||
_interactionManager.SelectEnter(_notch as IXRSelectInteractor, arrow);
|
||||
OwnerSelectRpc(Owner, arrowObject.GetComponent<NetworkObject>());
|
||||
PlayNockSoundRPC();
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BowArrowNock, gameObject);
|
||||
}
|
||||
|
||||
public override void OnOwnershipClient(NetworkConnection prevOwner)
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
fileFormatVersion: 2
|
||||
guid: 5c49785f8ddb436bb890408012c0da7d
|
||||
timeCreated: 1679237121
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_InteractionManager: {instanceID: 0}
|
||||
- m_AttachTransform: {instanceID: 0}
|
||||
- m_StartingSelectedInteractable: {instanceID: 0}
|
||||
- m_StartingTargetFilter: {instanceID: 0}
|
||||
- m_InteractableHoverMeshMaterial: {instanceID: 0}
|
||||
- m_InteractableCantHoverMeshMaterial: {instanceID: 0}
|
||||
- nockSounds: {fileID: 11400000, guid: 6d1727a79cb00364c8adb70e8396e743, type: 2}
|
||||
- releaseSounds: {fileID: 11400000, guid: 08fd7432471e0aa40b7a08f6d88b7281, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
146
Assets/_PROJECT/Models/DoorHandReplacer.cs
Normal file
146
Assets/_PROJECT/Models/DoorHandReplacer.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public enum GrabbingHand
|
||||
{
|
||||
Right,
|
||||
Left
|
||||
}
|
||||
|
||||
public class DoorHandReplacer : MonoBehaviour
|
||||
{
|
||||
public GameObject LeftHand;
|
||||
public GameObject RightHand;
|
||||
public GameObject DoorSlab;
|
||||
public GameObject handle;
|
||||
public float DoorClosedTolerance = 5f;
|
||||
|
||||
|
||||
private GrabbingHand? hand = null; // nullable
|
||||
private SmartHandPresence currentHand = null;
|
||||
private bool isGrabbing;
|
||||
|
||||
// Tracks all hands currently inside the trigger
|
||||
private HashSet<SmartHandPresence> handsInTrigger = new HashSet<SmartHandPresence>();
|
||||
|
||||
public void ManifestDoorHand()
|
||||
{
|
||||
if (currentHand == null || hand == null) return;
|
||||
|
||||
|
||||
|
||||
|
||||
isGrabbing = true;
|
||||
switch (hand.Value)
|
||||
{
|
||||
case GrabbingHand.Left:
|
||||
RightHand.SetActive(false);
|
||||
LeftHand.SetActive(true);
|
||||
Debug.Log("Dissapearing hand");
|
||||
break;
|
||||
|
||||
case GrabbingHand.Right:
|
||||
LeftHand.SetActive(false);
|
||||
RightHand.SetActive(true);
|
||||
Debug.Log("Dissapearing hand");
|
||||
break;
|
||||
}
|
||||
float doorSlabRotation = DoorSlab.transform.localRotation.y;
|
||||
|
||||
if (Mathf.Abs(doorSlabRotation) < Mathf.Abs(DoorClosedTolerance)) // If door is closed
|
||||
{
|
||||
Animator animator = handle.GetComponent<Animator>();
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetTrigger("TurnHandle");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void DeManifestDoorHand()
|
||||
{
|
||||
isGrabbing = false;
|
||||
LeftHand.SetActive(false);
|
||||
RightHand.SetActive(false);
|
||||
if (currentHand == null) return;
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (isGrabbing && other.GetComponentInParent<HandPresencePhysics>() != null) {
|
||||
|
||||
if (other.gameObject.name.Contains("left", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (hand == GrabbingHand.Left) DeManifestDoorHand();
|
||||
isGrabbing = false;
|
||||
return;
|
||||
}
|
||||
else if (other.gameObject.name.Contains("right", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (hand == GrabbingHand.Right) DeManifestDoorHand();
|
||||
isGrabbing = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isGrabbing) return;
|
||||
|
||||
// IMPORTANT: in case hands have multiple colliders
|
||||
SmartHandPresence playerHand = other.GetComponentInParent<SmartHandPresence>();
|
||||
if (playerHand == null) return;
|
||||
|
||||
handsInTrigger.Add(playerHand);
|
||||
|
||||
currentHand = playerHand;
|
||||
|
||||
string name = playerHand.gameObject.name;
|
||||
|
||||
if (name.Contains("left", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
hand = GrabbingHand.Left;
|
||||
}
|
||||
else if (name.Contains("right", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
hand = GrabbingHand.Right;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (isGrabbing) return;
|
||||
|
||||
SmartHandPresence playerHand = other.GetComponentInParent<SmartHandPresence>();
|
||||
if (playerHand == null) return;
|
||||
|
||||
handsInTrigger.Remove(playerHand);
|
||||
|
||||
// If no hands remain, clear everything
|
||||
if (handsInTrigger.Count == 0)
|
||||
{
|
||||
currentHand = null;
|
||||
hand = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pick any remaining hand as current
|
||||
foreach (var remainingHand in handsInTrigger)
|
||||
{
|
||||
currentHand = remainingHand;
|
||||
|
||||
string name = remainingHand.gameObject.name;
|
||||
hand = name.Contains("left", System.StringComparison.OrdinalIgnoreCase)
|
||||
? GrabbingHand.Left
|
||||
: GrabbingHand.Right;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user