generated from raccoon/vrchat-project-template
Added sounds
This commit is contained in:
@@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
Data: 6
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -113,16 +113,199 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: isOpen
|
||||
Data: audioSource
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: isOpen
|
||||
Data: audioSource
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 7|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.AudioSource, UnityEngine.AudioModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 9|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
- Name: tooltip
|
||||
Entry: 1
|
||||
Data: '"Door''s" sounds source'
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: openSound
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: openSound
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 11|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.AudioClip, UnityEngine.AudioModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 13|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
- Name: tooltip
|
||||
Entry: 1
|
||||
Data: Sound when opening
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: closingSound
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: closingSound
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 16|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
- Name: tooltip
|
||||
Entry: 1
|
||||
Data: Sound when closing
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: isOpen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: isOpen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 18|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
@@ -131,7 +314,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 18
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -146,13 +329,13 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 9|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
Data: 20|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
- Name: tooltip
|
||||
Entry: 1
|
||||
Data: Start state of the "Door" (parameter 'isOpen' in controller)
|
||||
@@ -161,13 +344,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 10|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
Data: 21|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 11|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
||||
Data: 22|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -191,16 +374,16 @@ MonoBehaviour:
|
||||
Data: reverse
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: reverse
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 18
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 18
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -215,13 +398,13 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 14|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
Data: 25|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
||||
- Name: tooltip
|
||||
Entry: 1
|
||||
Data: The "Door" opens from the other side (parameter 'reverse' in controller)
|
||||
|
||||
@@ -7,6 +7,12 @@ public class GenericDoor : UdonSharpBehaviour
|
||||
{
|
||||
[Tooltip("Put your \"Door\" object with animator component here")]
|
||||
public Animator animator;
|
||||
[Tooltip("\"Door's\" sounds source")]
|
||||
public AudioSource audioSource;
|
||||
[Tooltip("Sound when opening")]
|
||||
public AudioClip openSound;
|
||||
[Tooltip("Sound when closing")]
|
||||
public AudioClip closingSound;
|
||||
[Tooltip("Start state of the \"Door\" (parameter \'isOpen\' in controller)"), UdonSynced, FieldChangeCallback(nameof(IsOpen))]
|
||||
public bool isOpen = false;
|
||||
[Tooltip("The \"Door\" opens from the other side (parameter \'reverse\' in controller)")]
|
||||
@@ -17,7 +23,7 @@ public class GenericDoor : UdonSharpBehaviour
|
||||
set
|
||||
{
|
||||
isOpen = value;
|
||||
SetAnimatorValue(value);
|
||||
SetDoorState(value);
|
||||
}
|
||||
get => isOpen;
|
||||
}
|
||||
@@ -34,6 +40,25 @@ public class GenericDoor : UdonSharpBehaviour
|
||||
SetAnimatorValue(isOpen);
|
||||
}
|
||||
|
||||
private void SetDoorState(bool open)
|
||||
{
|
||||
PlaySound(open);
|
||||
SetAnimatorValue(open);
|
||||
}
|
||||
|
||||
private void PlaySound(bool open)
|
||||
{
|
||||
if (audioSource == null || openSound == null || closingSound == null)
|
||||
return;
|
||||
|
||||
audioSource.clip = open ? openSound : closingSound;
|
||||
|
||||
if (!audioSource.isPlaying)
|
||||
{
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAnimatorValue(bool value)
|
||||
{
|
||||
animator.SetBool("reverse", reverse);
|
||||
|
||||
@@ -80,6 +80,9 @@ MonoBehaviour:
|
||||
SerializationNodes: []
|
||||
_udonSharpBackingUdonBehaviour: {fileID: 4617731759297412656}
|
||||
animator: {fileID: 513558882628817560}
|
||||
audioSource: {fileID: 8581911545463114097}
|
||||
openSound: {fileID: 8300000, guid: 19cad2994b7378c4d83707b13cadbaf5, type: 3}
|
||||
closingSound: {fileID: 8300000, guid: 6aefa337433ecf4478572d1bc823712e, type: 3}
|
||||
isOpen: 0
|
||||
reverse: 1
|
||||
--- !u!114 &4617731759297412656
|
||||
@@ -230,6 +233,9 @@ MonoBehaviour:
|
||||
SerializationNodes: []
|
||||
_udonSharpBackingUdonBehaviour: {fileID: 3292840451036670731}
|
||||
animator: {fileID: 513558882628817560}
|
||||
audioSource: {fileID: 8581911545463114097}
|
||||
openSound: {fileID: 8300000, guid: 19cad2994b7378c4d83707b13cadbaf5, type: 3}
|
||||
closingSound: {fileID: 8300000, guid: 6aefa337433ecf4478572d1bc823712e, type: 3}
|
||||
isOpen: 0
|
||||
reverse: 0
|
||||
--- !u!114 &3292840451036670731
|
||||
@@ -289,6 +295,134 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4879351568774202922}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7681430886952281138
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 644643761086828937}
|
||||
- component: {fileID: 8581911545463114097}
|
||||
m_Layer: 0
|
||||
m_Name: door-sound
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &644643761086828937
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7681430886952281138}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4879351568774202922}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &8581911545463114097
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7681430886952281138}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
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
|
||||
panLevelCustomCurve:
|
||||
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
|
||||
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!1001 &4916885274060218817
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -403,6 +537,10 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: babb049c4bcec2e4497c22361fff4d44,
|
||||
type: 3}
|
||||
insertIndex: 0
|
||||
addedObject: {fileID: 644643761086828937}
|
||||
- targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: babb049c4bcec2e4497c22361fff4d44,
|
||||
type: 3}
|
||||
insertIndex: 1
|
||||
addedObject: {fileID: 5771671160741384798}
|
||||
- targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: babb049c4bcec2e4497c22361fff4d44,
|
||||
type: 3}
|
||||
|
||||
8
Assets/occlusion-portals/prefabs/measuredoor/sound.meta
Normal file
8
Assets/occlusion-portals/prefabs/measuredoor/sound.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 367b5d4e48b597b449914107e0603204
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/occlusion-portals/prefabs/measuredoor/sound/door-close.wav
LFS
Normal file
BIN
Assets/occlusion-portals/prefabs/measuredoor/sound/door-close.wav
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aefa337433ecf4478572d1bc823712e
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/occlusion-portals/prefabs/measuredoor/sound/door-open.wav
LFS
Normal file
BIN
Assets/occlusion-portals/prefabs/measuredoor/sound/door-open.wav
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19cad2994b7378c4d83707b13cadbaf5
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user