1
0
forked from cgvr/DeltaVR

21 Commits

Author SHA1 Message Date
30c0652453 Project Settings file. I don't know what change is this... 2026-02-03 23:00:57 +02:00
85beb73f51 Do not commit config.json. Unity creates it itself and we do not want configs from different devs to end up in the repo. 2026-02-03 22:59:02 +02:00
011d9dfdda Restore Defaults button to restore the default settings. 2026-02-03 22:56:01 +02:00
2e7dc403ad Restore Defaults button images. 2026-02-03 22:55:29 +02:00
4bda55baca Locomotion speed default value fix. 2026-02-03 22:55:03 +02:00
ba1f0c855d Settings are now loaded from and saved to the config.json file. Reworked the UI structure a bit (the script that manage the settings have to be active before the UI is opened to actually take effect at game startup). Fixed several UI bugs (slider deselection, UI labels blocking the sliders, etc). 2026-02-03 21:47:16 +02:00
415484c1f0 Removed unused namespaces that hindered building. 2026-02-03 21:44:40 +02:00
2347d27c62 For some reason Unity changed something in the font asset... Maybe it is the glow effect. 2026-02-03 21:43:50 +02:00
74c2ca6a98 Managers folder meta file. 2026-02-02 22:45:06 +02:00
f3d0f206af Config manager. Just creating, reading and writing the config file for now. 2026-02-02 22:44:17 +02:00
f9b2084876 Removed the nested .gitignore file that ignored the .meta files inside this directory. This should fix the missing script errors. 2026-02-02 21:30:45 +02:00
53c6b04d23 Main scene changes. The scene tree is now more readable. Removed the two previous networking prefabs and added the new one. The only thing scene-dependent on it is the player's spawn point. Maybe also the object pool, however it seems to create one itself. So, the object pool in the scene might also be deleted perhaps. 2026-02-02 20:36:34 +02:00
91e44c5dae Created a single prefab to incorporate all the networking stuff. This is the only networking prefab required in the scene. We will see if git breaks it. 2026-02-02 20:35:25 +02:00
216e2660df Hide FMOD setup wizard by default. 2026-02-02 19:54:17 +02:00
57222f0bb0 The arrow server can only be created after the bow server's ownership is done. Should be tested. 2026-02-02 19:36:00 +02:00
768ed39abe Animation player refactoring. Also, if the animation is already playing, do not log. Might be dangerous, but was a bit spam for now. 2026-02-02 19:35:01 +02:00
89b9b5bd7a Scan only the project assets, not the entire folder, to build the Asset Database. 2026-02-02 19:32:32 +02:00
901334b6bf Fix for the Lexus normal map. 2026-02-02 19:30:25 +02:00
1885b1fbe8 Added some debug logs. 2026-02-02 19:29:49 +02:00
f81bc2f7fd The last Interaction Layer name must be "Teleport" not "Player Only". 2026-02-02 19:28:40 +02:00
a4a6535779 Reworked the TutorialController so that it will show the info about trying to initialize once per some time interval. Not flood the entire log. 2026-02-02 19:26:28 +02:00
49 changed files with 3602 additions and 407 deletions

4
.gitignore vendored
View File

@@ -103,3 +103,7 @@ NetrworkManagerUI.prefab
NetrworkManagerUI.prefab.meta
CustomNetworkManager.prefab
CustomNetworkManager.prefab.meta
# Project-specific files
config.json

View File

@@ -1,61 +0,0 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
*.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
# Crashlytics generated file
crashlytics-build.properties

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4939e812d2cae8a448666fc57569da59
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e8cb728e8e288c947a1e0870382445bd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -81,6 +81,7 @@ public class NetworkMenuUI : MonoBehaviour
}
private void OnStartPlaying()
{
Debug.Log("START PRESSED");
statusText.text = "Starting host...";
StartCoroutine(HostAndSearchRoutine());
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49f99c1c0ae8c774eb6bdcbc83c2cfef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e928fc8fc03e26a46ad7f8520d468e41
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8d77d91c1b4e73044b53ddce11333fea
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 474f76f05fac11a4e8e1ed68314fba90
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

23
Assets/FishNet.Config.XML Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<ConfigurationData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Loaded>true</Loaded>
<PrefabGenerator>
<Enabled>true</Enabled>
<LogToConsole>true</LogToConsole>
<FullRebuild>false</FullRebuild>
<SaveChanges>true</SaveChanges>
<DefaultPrefabObjectsPath>Assets\DefaultPrefabObjects.asset</DefaultPrefabObjectsPath>
<SearchScope>1</SearchScope>
<ExcludedFolders />
<IncludedFolders>
<string>Assets\_PROJECT</string>
</IncludedFolders>
</PrefabGenerator>
<CodeStripping>
<IsBuilding>false</IsBuilding>
<IsDevelopment>false</IsDevelopment>
<IsHeadless>false</IsHeadless>
<StripReleaseBuilds>false</StripReleaseBuilds>
<StrippingType>0</StrippingType>
</CodeStripping>
</ConfigurationData>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fdec8b985bdf2364cac858b4136da794
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -319,9 +319,12 @@ namespace FishNet.Editing.PrefabCollectionGenerator
{
foreach (string path in GetPrefabFiles("Assets", excludedPaths, true))
{
NetworkObject nob = AssetDatabase.LoadAssetAtPath<NetworkObject>(path);
if (nob != null)
foundNobs.Add(nob);
else
UnityEngine.Debug.LogWarning("Last loading error with: " + path);
}
}
//Specific folders.

View File

@@ -7,7 +7,7 @@ TextureImporter:
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
@@ -54,7 +54,7 @@ TextureImporter:
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1

View File

@@ -0,0 +1,124 @@
fileFormatVersion: 2
guid: 261e77f9774b3224b9f61ebaff302284
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 262dce796e1903548b7a2a7909d20be4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,124 @@
fileFormatVersion: 2
guid: ab1a16880e37cfa499309fc8fd4250ba
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -119,7 +119,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &2888630431832822380
RectTransform:
m_ObjectHideFlags: 0
@@ -128,7 +128,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 674832405591274748}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 6.199966}
m_LocalPosition: {x: 0, y: 0, z: 6}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -137,8 +137,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 198, y: 29.999985}
m_SizeDelta: {x: 178.01, y: 338.4}
m_AnchoredPosition: {x: 25.8, y: -57.9}
m_SizeDelta: {x: 485, y: 46.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7009866660814900916
CanvasRenderer:
@@ -168,9 +168,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Warning:
High speeds may cause nausea'
m_text: High speeds may cause nausea!
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: d564a6b9a8a781b438125b614edcc297, type: 2}
m_sharedMaterial: {fileID: 2467261418627247352, guid: d564a6b9a8a781b438125b614edcc297,
@@ -205,7 +203,7 @@ MonoBehaviour:
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
@@ -236,7 +234,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 1.8959656, y: 6.638962, z: 3.9048767, w: 1.7601442}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -582,6 +580,7 @@ Transform:
- {fileID: 7867682990484010893}
- {fileID: 385502688868600332}
- {fileID: 8911245181170312639}
- {fileID: 4369549003892251738}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -711,8 +710,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -371.7, y: 0.000015258789}
m_SizeDelta: {x: 469.55, y: 50.48}
m_AnchoredPosition: {x: -429.3, y: 0.000015258789}
m_SizeDelta: {x: 319.7, y: 50.48}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1756154180137300123
CanvasRenderer:
@@ -808,7 +807,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 2.8457031, y: 0, z: 2.8460312, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -1140,6 +1139,149 @@ RectTransform:
m_AnchoredPosition: {x: -5.404525, y: 60.661545}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1647071810007517722
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4369549003892251738}
- component: {fileID: 18611445735460691}
- component: {fileID: 8343075384873062513}
- component: {fileID: 5285357331933866282}
- component: {fileID: 1310480035629572623}
- component: {fileID: 1510780549024052800}
- component: {fileID: 4307275810096043329}
- component: {fileID: 143507707063213418}
m_Layer: 12
m_Name: Settings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4369549003892251738
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
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_Children: []
m_Father: {fileID: 5343771095006709614}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &18611445735460691
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26a0dd79a025e5041a41f576b1aa4968, type: 3}
m_Name:
m_EditorClassIdentifier:
turnOffButton: {fileID: 3645818974320619446}
turnOnButton: {fileID: 1311809556432207317}
moveSpeedSlider: {fileID: 6956878155406096985}
locomotion: {fileID: 1565464911732960072}
--- !u!114 &8343075384873062513
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 0
slider: {fileID: 7370795858478176567}
--- !u!114 &5285357331933866282
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 3
slider: {fileID: 8524569723447833986}
--- !u!114 &1310480035629572623
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 5
slider: {fileID: 3954205046647893400}
--- !u!114 &1510780549024052800
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 4
slider: {fileID: 7262865820799039206}
--- !u!114 &4307275810096043329
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 1
slider: {fileID: 512852062931003448}
--- !u!114 &143507707063213418
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647071810007517722}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1ebe1a3f8ef35a041a8ef39da672dd49, type: 3}
m_Name:
m_EditorClassIdentifier:
valueControllers:
- {fileID: 18611445735460691}
- {fileID: 8343075384873062513}
- {fileID: 5285357331933866282}
- {fileID: 1310480035629572623}
- {fileID: 1510780549024052800}
- {fileID: 4307275810096043329}
--- !u!1 &1694677102371321062
GameObject:
m_ObjectHideFlags: 0
@@ -2219,7 +2361,6 @@ GameObject:
- component: {fileID: 5495779272626688296}
- component: {fileID: 270386226070323618}
- component: {fileID: 7370795858478176567}
- component: {fileID: 9192465668386235667}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
@@ -2346,19 +2487,6 @@ MonoBehaviour:
minValue: 0
maxValue: 1
slideareaOffsetMultiplier: 0.9
--- !u!114 &9192465668386235667
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3421967330093517364}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 0
--- !u!1 &3434260850308121859
GameObject:
m_ObjectHideFlags: 0
@@ -2412,7 +2540,6 @@ GameObject:
- component: {fileID: 5857106340495004348}
- component: {fileID: 467034009919322666}
- component: {fileID: 3954205046647893400}
- component: {fileID: 8737582689073729793}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
@@ -2539,19 +2666,6 @@ MonoBehaviour:
minValue: 0
maxValue: 1
slideareaOffsetMultiplier: 0.9
--- !u!114 &8737582689073729793
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3504227185401202113}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 5
--- !u!1 &3847096334227967442
GameObject:
m_ObjectHideFlags: 0
@@ -2858,6 +2972,153 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4399914816600051466
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3664260978476899140}
- component: {fileID: 7108608958374546862}
- component: {fileID: 2424293117796193332}
- component: {fileID: 5839269911837038846}
- component: {fileID: 8403009779207699600}
m_Layer: 5
m_Name: Restore Defaults Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3664260978476899140
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4399914816600051466}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -5.9}
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 4738851406616228330}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 399.3, y: 266.8}
m_SizeDelta: {x: 2155, y: 1076}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7108608958374546862
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4399914816600051466}
m_CullTransparentMesh: 1
--- !u!114 &2424293117796193332
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4399914816600051466}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &5839269911837038846
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4399914816600051466}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 2
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284,
type: 3}
m_PressedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284, type: 3}
m_SelectedSprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2424293117796193332}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 143507707063213418}
m_TargetAssemblyTypeName: RestoreDefaultsController, Assembly-CSharp
m_MethodName: OnRestoreDefaults
m_Mode: 1
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 &8403009779207699600
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4399914816600051466}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c648a319c5c6aa47b3ef152a10657bf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &4745390056551288905
GameObject:
m_ObjectHideFlags: 0
@@ -3036,7 +3297,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -1849.8, y: 30}
m_SizeDelta: {x: 90.1, y: 50.5}
m_SizeDelta: {x: 89, y: 50.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1344781521441133505
CanvasRenderer:
@@ -3539,7 +3800,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -2404.8, y: 34.7}
m_AnchoredPosition: {x: -2600, y: 34.7}
m_SizeDelta: {x: 220, y: 49.6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2306375091028476275
@@ -3605,7 +3866,7 @@ MonoBehaviour:
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
@@ -3636,7 +3897,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 14.186401, y: 0, z: -0.9451599, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -3655,7 +3916,6 @@ GameObject:
- component: {fileID: 4467346825075014904}
- component: {fileID: 1078020185355697329}
- component: {fileID: 7262865820799039206}
- component: {fileID: 8463522706283787556}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
@@ -3782,19 +4042,6 @@ MonoBehaviour:
minValue: 0
maxValue: 1
slideareaOffsetMultiplier: 0.9
--- !u!114 &8463522706283787556
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5731468542189211806}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 4
--- !u!1 &5770108565631511295
GameObject:
m_ObjectHideFlags: 0
@@ -5374,6 +5621,7 @@ RectTransform:
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 3664260978476899140}
- {fileID: 3355479367658290507}
- {fileID: 4818343909123725175}
m_Father: {fileID: 1774211016983706491}
@@ -5429,13 +5677,14 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6798620428918177696}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26a0dd79a025e5041a41f576b1aa4968, type: 3}
m_Name:
m_EditorClassIdentifier:
turnOffButton: {fileID: 3645818974320619446}
turnOnButton: {fileID: 1311809556432207317}
moveSpeedSlider: {fileID: 6956878155406096985}
locomotion: {fileID: 1565464911732960072}
--- !u!1 &6976341305452677775
GameObject:
@@ -5463,7 +5712,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6976341305452677775}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.0000267}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -5472,8 +5721,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -406.48022, y: 260}
m_SizeDelta: {x: 383.04, y: 50.5}
m_AnchoredPosition: {x: -446.3, y: 255.3}
m_SizeDelta: {x: 327.3, y: 50.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8334943640923905114
CanvasRenderer:
@@ -5569,7 +5818,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 0, y: 0, z: 0.9477234, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
@@ -5625,7 +5874,6 @@ GameObject:
- component: {fileID: 7392776148620295955}
- component: {fileID: 623723497249906612}
- component: {fileID: 8524569723447833986}
- component: {fileID: 2518031444015721236}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
@@ -5752,19 +6000,6 @@ MonoBehaviour:
minValue: 0
maxValue: 1
slideareaOffsetMultiplier: 0.9
--- !u!114 &2518031444015721236
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7116268483853744053}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 3
--- !u!1 &7137625347935658456
GameObject:
m_ObjectHideFlags: 0
@@ -6850,7 +7085,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -2404.8, y: 30}
m_AnchoredPosition: {x: -2424, y: 30}
m_SizeDelta: {x: 186.1, y: 50.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6159749963066026057
@@ -6916,7 +7151,7 @@ MonoBehaviour:
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
@@ -6966,7 +7201,6 @@ GameObject:
- component: {fileID: 4806540607707404536}
- component: {fileID: 1263225200033619485}
- component: {fileID: 512852062931003448}
- component: {fileID: 5185990981600041478}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
@@ -7093,19 +7327,6 @@ MonoBehaviour:
minValue: 0
maxValue: 1
slideareaOffsetMultiplier: 0.9
--- !u!114 &5185990981600041478
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7795711801980221647}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 1
--- !u!1 &7941339244779152679
GameObject:
m_ObjectHideFlags: 0
@@ -7851,7 +8072,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -3755, y: 30}
m_AnchoredPosition: {x: -3897, y: 30}
m_SizeDelta: {x: 131.9, y: 50.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7891019527381773321

View File

@@ -0,0 +1,112 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
abstract public class AbstractSlider : 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; }
public float CurrentNormalizedValue { get; private set; }
private RectTransform handleRect;
private Vector2 backgroundStart;
private float backgroundWidth;
public System.Action<float, bool> OnValueChanged;
private void OnEnable()
{
if (null == handleRect)
{
handleRect = GetComponent<RectTransform>();
}
if (sliderBackground != null)
{
backgroundStart = sliderBackground.position;
backgroundWidth = sliderBackground.rect.width;
}
UpdateHandlePosition();
}
virtual public void OnBeginDrag(PointerEventData eventData)
{
UpdateSlider(eventData);
}
virtual public void OnDrag(PointerEventData eventData)
{
UpdateSlider(eventData);
}
virtual public void OnEndDrag(PointerEventData eventData)
{
UpdateSlider(eventData, true);
EventSystem.current.SetSelectedGameObject(null);
}
virtual public void SetHandleValue(float unnormalizedValue)
{
SetValuesFromValue(unnormalizedValue);
UpdateHandlePosition();
}
virtual public void SetHandleNormalizedValue(float normalizedValue)
{
SetValuesFromNormalizedValue(normalizedValue);
UpdateHandlePosition();
}
virtual protected void UpdateHandlePosition()
{
if (null == handleRect) return; // The options menu might not be opened yet
float halfWidth = sliderBackground.rect.width * 0.5f;
float limit = halfWidth * slideareaOffsetMultiplier;
float x = Mathf.Lerp(-limit, limit, CurrentNormalizedValue);
handleRect.localPosition = new Vector3(x, handleRect.localPosition.y, 0);
}
virtual protected void UpdateSlider(PointerEventData eventData, bool draggingEnded = false)
{
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);
SetValuesFromValue(Mathf.Lerp(minValue, maxValue, normalized));
OnValueChanged?.Invoke(CurrentValue, draggingEnded);
}
protected void SetValuesFromNormalizedValue(float normalizedValue)
{
CurrentNormalizedValue = normalizedValue;
CurrentValue = CurrentNormalizedValue * (maxValue - minValue) + minValue;
}
protected void SetValuesFromValue(float unnormalizedValue)
{
CurrentValue = unnormalizedValue;
CurrentNormalizedValue = (CurrentValue - minValue) / (maxValue - minValue);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8fe704cafb6cf2441a62a6497d58f229
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
abstract public class AbstractValueController : MonoBehaviour
{
abstract public void RestoreFromConfig();
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfd6e172b2a79944788029ce9d4220dd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -4,87 +4,8 @@ using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
public class AudioSliderDragHandler : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
public class AudioSliderDragHandler : AbstractSlider, 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);
}
}

View File

@@ -3,12 +3,14 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//using UnityEngine.UIElements;
using UnityEngine.XR.Interaction.Toolkit;
public class ContinuoslocomotionConfigurator : MonoBehaviour
public class ContinuoslocomotionConfigurator : AbstractValueController
{
public Button turnOffButton;
public Button turnOnButton;
public MoveSliderDragHandler moveSpeedSlider;
public ContinuousMoveProviderBase locomotion;
// Events for listeners
@@ -19,13 +21,28 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
{
turnOnButton.onClick.AddListener(enableLocomotion);
turnOffButton.onClick.AddListener(disableLocomotion);
turnOffButton.gameObject.SetActive(false);
RestoreFromConfig();
}
override public void RestoreFromConfig()
{
bool isContinuousLocomotion = ConfigManager.instance.GetIsContinuousLocomotion();
turnOffButton.gameObject.SetActive(isContinuousLocomotion);
turnOnButton.gameObject.SetActive(!isContinuousLocomotion);
locomotion.enabled = isContinuousLocomotion;
OnLocomotionToggled?.Invoke(isContinuousLocomotion);
float continuousLocomotionSpeed = ConfigManager.instance.GetContinuousLocomotionSpeed();
moveSpeedSlider.SetHandleValue(continuousLocomotionSpeed);
locomotion.moveSpeed = continuousLocomotionSpeed;
}
public void UpdateSpeed(float speed)
{
locomotion.moveSpeed = speed;
OnSpeedChanged?.Invoke(speed);
WriteToConfig();
}
private void enableLocomotion()
@@ -35,6 +52,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
turnOnButton.gameObject.SetActive(false);
turnOffButton.gameObject.SetActive(true);
OnLocomotionToggled?.Invoke(true);
WriteToConfig();
}
private void disableLocomotion()
@@ -44,5 +62,12 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
turnOnButton.gameObject.SetActive(true);
turnOffButton.gameObject.SetActive(false);
OnLocomotionToggled?.Invoke(false);
WriteToConfig();
}
protected void WriteToConfig()
{
ConfigManager.instance.SetIsContinuousLocomotion(locomotion.enabled);
ConfigManager.instance.SetContinuousLocomotionSpeed(locomotion.moveSpeed);
}
}

View File

@@ -3,82 +3,35 @@ using UnityEngine.UI;
using UnityEngine.EventSystems;
using TMPro;
public class MoveSliderDragHandler : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
public class MoveSliderDragHandler : AbstractSlider, IDragHandler, IBeginDragHandler, IEndDragHandler
{
public RectTransform sliderBackground; // Assign in Inspector
public float minValue = 2f;
public float maxValue = 5f;
public float slideareaOffsetMultiplier = 0.9f;
public TMP_Text warningText;
public float warningThreshholdValue = 0.65f;
public float CurrentValue { get; private set; }
public ContinuoslocomotionConfigurator configurator;
private RectTransform handleRect;
private Vector2 backgroundStart;
private float backgroundWidth;
void Awake()
override public void OnEndDrag(PointerEventData eventData)
{
handleRect = GetComponent<RectTransform>();
if (sliderBackground != null)
{
backgroundStart = sliderBackground.position;
backgroundWidth = sliderBackground.rect.width;
}
}
public void OnBeginDrag(PointerEventData eventData)
{
UpdateSlider(eventData);
}
public void OnDrag(PointerEventData eventData)
{
UpdateSlider(eventData);
}
public void OnEndDrag(PointerEventData eventData)
{
UpdateSlider(eventData);
base.OnEndDrag(eventData);
configurator.UpdateSpeed(CurrentValue);
EventSystem.current.SetSelectedGameObject(null);
}
private void UpdateSlider(PointerEventData eventData)
override protected void UpdateSlider(PointerEventData eventData, bool draggingEnded = false)
{
Debug.Log("UpDating Slider");
Vector2 localPoint;
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
base.UpdateSlider(eventData, draggingEnded);
DisplayWarningTextIfNecessary();
}
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);
// Displaying the warning.
override protected void UpdateHandlePosition()
{
base.UpdateHandlePosition();
DisplayWarningTextIfNecessary();
}
protected void DisplayWarningTextIfNecessary()
{
if (CurrentValue > (warningThreshholdValue * (maxValue - minValue) + minValue)) warningText.gameObject.SetActive(true);
else warningText.gameObject.SetActive(false);
//Debug.Log(warningThreshholdValue);
}
}

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class RegularButtonView : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler
{
public void OnPointerEnter(PointerEventData eventData)
{
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, this.gameObject);
}
public void OnPointerClick(PointerEventData eventData)
{
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, this.gameObject);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9c648a319c5c6aa47b3ef152a10657bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Burst;
using UnityEngine;
public class RestoreDefaultsController : MonoBehaviour
{
[SerializeField]
public List<AbstractValueController> valueControllers = new List<AbstractValueController>();
public void OnRestoreDefaults()
{
ConfigManager.instance.RestoreDefaultConfig();
foreach (AbstractValueController avc in valueControllers)
{
avc.RestoreFromConfig();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1ebe1a3f8ef35a041a8ef39da672dd49
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,6 +1,6 @@
using UnityEngine;
public class SliderToVCA : MonoBehaviour
public class SliderToVCA : AbstractValueController
{
public enum VCATarget
{
@@ -13,36 +13,39 @@ public class SliderToVCA : MonoBehaviour
}
public VCATarget target;
private AudioSliderDragHandler slider;
public 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
RestoreFromConfig();
}
override public void RestoreFromConfig()
{
float initialValue = GetInitialValue();
slider.SetHandleValue(initialValue);
}
private float GetInitialValueFromAudioManager()
private float GetInitialValue()
{
switch (target)
{
case VCATarget.Master:
return AudioManager.Instance.MasterVolume;
return ConfigManager.instance.getVolumeMaster();
case VCATarget.Ambiences:
return AudioManager.Instance.AmbienceVolume;
return ConfigManager.instance.getVolumeAmbient();
case VCATarget.Music:
return AudioManager.Instance.MusicVolume;
return ConfigManager.instance.getVolumeMusic();
case VCATarget.SFX:
return AudioManager.Instance.SFXVolume;
return ConfigManager.instance.getVolumeSFX();
case VCATarget.UI:
return AudioManager.Instance.UIVolume;
return ConfigManager.instance.getVolumeUI();
case VCATarget.Voiceovers:
return AudioManager.Instance.VoiceoverVolume;
return ConfigManager.instance.getVolumeVO();
default:
return 0.5f;
}
@@ -51,38 +54,44 @@ private float GetInitialValueFromAudioManager()
private void Update()
{
// Constantly push slider value to the VCA
ApplyVolume(slider.CurrentValue);
ApplyVolume(slider.CurrentValue, false);
//Debug.Log("CurrentValue: " + slider.CurrentValue);
}
private void ApplyVolume(float value)
private void ApplyVolume(float value, bool isLastChange)
{
switch (target)
{
case VCATarget.Master:
AudioManager.Instance.SetMasterVCA(value);
//Debug.LogError(value);
if (isLastChange) ConfigManager.instance.SetVolumeMaster(value);
break;
case VCATarget.Ambiences:
AudioManager.Instance.SetAmbientVCA(value);
if (isLastChange) ConfigManager.instance.SetVolumeAmbient(value);
break;
case VCATarget.Music:
AudioManager.Instance.SetMusicVCA(value);
if (isLastChange) ConfigManager.instance.SetVolumeMusic(value);
break;
case VCATarget.SFX:
AudioManager.Instance.SetSFXVCA(value);
if (isLastChange) ConfigManager.instance.SetVolumeSFX(value);
break;
case VCATarget.UI:
AudioManager.Instance.SetUIVCA(value);
if (isLastChange) ConfigManager.instance.SetVolumeUI(value);
break;
case VCATarget.Voiceovers:
AudioManager.Instance.SetVoiceoverVCA(value);
if (isLastChange) ConfigManager.instance.SetVolumeVO(value);
break;
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -44,6 +45,26 @@ namespace _PROJECT.NewHandPresence
private GameObject _billboard;
public enum TutorialInfoKey
{
Initialized,
LeftHintController,
RightHintController,
LeftSmartHandPresence,
RightSmartHandPresence
}
protected Dictionary<TutorialInfoKey, bool> initializationInfoStatus = new Dictionary<TutorialInfoKey, bool>();
protected Coroutine initializationInfoCoroutine;
private void Awake()
{
initializationInfoStatus.Add(TutorialInfoKey.Initialized, false);
initializationInfoStatus.Add(TutorialInfoKey.LeftHintController, false);
initializationInfoStatus.Add(TutorialInfoKey.RightHintController, false);
initializationInfoStatus.Add(TutorialInfoKey.LeftSmartHandPresence, false);
initializationInfoStatus.Add(TutorialInfoKey.RightSmartHandPresence, false);
}
private void Update()
{
if (_state == TutorialState.Initializing)
@@ -177,29 +198,33 @@ namespace _PROJECT.NewHandPresence
private void TryInitialize()
{
if (!CanInitialize()) return;
if (null == initializationInfoCoroutine)
{
initializationInfoCoroutine = StartCoroutine(InitializationInfoCoroutine());
}
_camera = Camera.main;
Debug.Log("Initializing tutorial");
//Debug.Log("Initializing tutorial");
_leftHintController = leftHand.GetComponentInChildren<XRControllerHintController>();
_rightHintController = rightHand.GetComponentInChildren<XRControllerHintController>();
Debug.Log($"Left hint controller: {_leftHintController}");
Debug.Log($"Right hint controller: {_rightHintController}");
initializationInfoStatus[TutorialInfoKey.LeftHintController] = null != _leftHintController;
initializationInfoStatus[TutorialInfoKey.RightHintController] = null != _rightHintController;
_leftSmartHandPresence = leftHand.GetComponentInChildren<SmartHandPresence>();
_rightSmartHandPresence = rightHand.GetComponentInChildren<SmartHandPresence>();
Debug.Log($"Left smart hand presence: {_leftSmartHandPresence}");
Debug.Log($"Right smart hand presence: {_rightSmartHandPresence}");
initializationInfoStatus[TutorialInfoKey.LeftSmartHandPresence] = null != _leftSmartHandPresence;
initializationInfoStatus[TutorialInfoKey.RightSmartHandPresence] = null != _rightSmartHandPresence;
if (_leftHintController == null ||
_rightHintController == null ||
_leftSmartHandPresence == null ||
_rightSmartHandPresence == null)
{
Debug.Log("Hint controller or smart hand presence is null");
//Debug.Log("Hint controller or smart hand presence is null");
return;
}
@@ -216,6 +241,7 @@ namespace _PROJECT.NewHandPresence
UpdateState(_state.Next());
Debug.Log("Tutorial initialized");
StopCoroutine(initializationInfoCoroutine);
}
private void OnGripPerformed(SelectEnterEventArgs arg0)
@@ -307,5 +333,35 @@ namespace _PROJECT.NewHandPresence
}
}
IEnumerator InitializationInfoCoroutine()
{
string CombineMessage(TutorialInfoKey key, object value, string prefix)
{
bool isAvailable = initializationInfoStatus.GetValueOrDefault(key);
return prefix + ": " + (isAvailable ? value.ToString() : "NULL") + "\r\n";
}
bool isInitialized = initializationInfoStatus.GetValueOrDefault(TutorialInfoKey.Initialized);
while (!isInitialized)
{
isInitialized = initializationInfoStatus.GetValueOrDefault(TutorialInfoKey.Initialized);
string infoMessage = "Tutorial not yet initialized!" + "\r\n";
infoMessage += "(click me for more info)" + "\r\n";
infoMessage += "Hint controllers" + "\r\n";
infoMessage += CombineMessage(TutorialInfoKey.LeftHintController, _leftHintController, "Left");
infoMessage += CombineMessage(TutorialInfoKey.RightHintController, _rightHintController, "Right");
infoMessage += "Smart hand presence" + "\r\n";
infoMessage += CombineMessage(TutorialInfoKey.LeftSmartHandPresence, _leftSmartHandPresence, "Left");
infoMessage += CombineMessage(TutorialInfoKey.RightSmartHandPresence, _rightSmartHandPresence, "Right");
Debug.Log(infoMessage);
yield return new WaitForSeconds(7);
}
}
}
}

View File

@@ -1,10 +1,22 @@
using System.Collections.Generic;
using UnityEngine;
public class PlayAnimationOnTrigger : MonoBehaviour
{
[SerializeField] public Animator animator; // Reference to the Animator component
[SerializeField] public string animationName = "YourAnimation"; // Name of the animation to play
public enum KnownAnimations
{
UFOFlight1
}
protected Dictionary<KnownAnimations, string> animationNames = new Dictionary<KnownAnimations, string>();
[SerializeField] public Animator animator; // Reference to the Animator component
[SerializeField] public KnownAnimations animationName = KnownAnimations.UFOFlight1; // Name of the animation to play
protected void Awake()
{
animationNames[KnownAnimations.UFOFlight1] = "UFO group flight 1";
}
private void OnTriggerEnter(Collider other)
{
@@ -15,15 +27,16 @@ public class PlayAnimationOnTrigger : MonoBehaviour
return;
}
string animationNameString = animationNames[animationName];
// Check if the animation is already playing
if (animator.GetCurrentAnimatorStateInfo(0).IsName(animationName) && animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1)
if (animator.GetCurrentAnimatorStateInfo(0).IsName(animationNameString) && animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1)
{
Debug.Log("Animation is already playing.");
return;
}
// Play the animation
animator.Play(animationName, 0, 0f);
Debug.Log("Playing animation: " + animationName);
animator.Play(animationNameString, 0, 0f);
Debug.Log("Playing animation: " + animationNameString);
}
}

View File

@@ -29,6 +29,14 @@ namespace _PROJECT.Multiplayer.NewBow
if (_notch == null)
Debug.LogError("Notch not found");
//CreateArrowServer();
}
public override void OnOwnershipServer(NetworkConnection prevOwner)
{
base.OnOwnershipServer(prevOwner);
if (Owner.IsValid)
CreateArrowServer();
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7db8366967e9da242adbfd3af7e17fcd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,197 @@
using FishNet.Component.Spawning;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using UnityEngine;
using Valve.Newtonsoft.Json;
using static ConfigManager;
public class ConfigManager : MonoBehaviour
{
public static ConfigManager instance = null;
[System.Serializable]
public class Config
{
public bool isContinuousLocomotion = false;
public float continuousLocomotionSpeed = 3.0f;
public float volumeMaster = 0.5f;
public float volumeAmbient = 0.5f;
public float volumeMusic = 0.5f;
public float volumeSFX = 0.5f;
public float volumeUI = 0.5f;
public float volumeVO = 0.5f;
}
protected Config currentConfig = new Config();
protected string configFileName = "config.json";
protected string configFilePath;
void Awake()
{
if (!instance) { instance = this; }
else if (instance != this) { Destroy(gameObject); }
DontDestroyOnLoad(gameObject);
}
private void Start()
{
configFilePath = Directory.GetCurrentDirectory() + "\\" + configFileName;
Debug.Log(configFilePath);
currentConfig = LoadConfigFromFile();
}
public Config GetConfig()
{
return currentConfig;
}
protected void SaveConfigToFile()
{
FileStream fileStream;
if (!File.Exists(configFilePath))
{
fileStream = File.Create(configFilePath);
fileStream.Close();
} else
{
//fileStream = new FileStream(configFilePath, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
}
//StreamWriter writer = new StreamWriter(fileStream);
//writer.Write(JsonUtility.ToJson(currentConfig));
//writer.Close();
//fileStream.Close();
string json = JsonUtility.ToJson(currentConfig, true);
File.WriteAllText(configFilePath, json);
}
protected Config LoadConfigFromFile()
{
if (!File.Exists(configFilePath))
{
CreateDefaultConfigFile(); // File did not exist, try to create an empty file
if (!File.Exists(configFilePath))
{
Debug.LogError("Config file was not found and could not be created: " + configFilePath);
return currentConfig;
}
}
Config config = JsonUtility.FromJson<Config>(File.ReadAllText(configFilePath));
/*FileStream fileStream = new FileStream(configFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader reader = new StreamReader(fileStream);
Config config = JsonUtility.FromJson<Config>(reader.ReadToEnd());
reader.Close();
fileStream.Close();*/
return config;
}
protected void CreateDefaultConfigFile()
{
currentConfig = new Config();
SaveConfigToFile();
}
public void RestoreDefaultConfig()
{
currentConfig = new Config();
SaveConfigToFile();
}
// Getters and Setters
public bool GetIsContinuousLocomotion()
{
return currentConfig.isContinuousLocomotion;
}
public void SetIsContinuousLocomotion(bool isContinuousLocomotion)
{
currentConfig.isContinuousLocomotion = isContinuousLocomotion;
SaveConfigToFile();
}
public float GetContinuousLocomotionSpeed()
{
return currentConfig.continuousLocomotionSpeed;
}
public void SetContinuousLocomotionSpeed(float continuousLocomotionSpeed)
{
currentConfig.continuousLocomotionSpeed = continuousLocomotionSpeed;
SaveConfigToFile();
}
public float getVolumeMaster()
{
return currentConfig.volumeMaster;
}
public void SetVolumeMaster(float masterVolume)
{
currentConfig.volumeMaster = masterVolume;
SaveConfigToFile();
}
public float getVolumeAmbient()
{
return currentConfig.volumeAmbient;
}
public void SetVolumeAmbient(float ambientVolume)
{
currentConfig.volumeAmbient = ambientVolume;
SaveConfigToFile();
}
public float getVolumeMusic()
{
return currentConfig.volumeMusic;
}
public void SetVolumeMusic(float musicVolume)
{
currentConfig.volumeMusic = musicVolume;
SaveConfigToFile();
}
public float getVolumeSFX()
{
return currentConfig.volumeSFX;
}
public void SetVolumeSFX(float sfxVolume)
{
currentConfig.volumeSFX = sfxVolume;
SaveConfigToFile();
}
public float getVolumeUI()
{
return currentConfig.volumeUI;
}
public void SetVolumeUI(float uiVolume)
{
currentConfig.volumeUI = uiVolume;
SaveConfigToFile();
}
public float getVolumeVO()
{
return currentConfig.volumeVO;
}
public void SetVolumeVO(float voVolume)
{
currentConfig.volumeVO = voVolume;
SaveConfigToFile();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c7622588c230b4b448152a6dfd6c0588
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8320216767994874586
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7021351325020055800}
- component: {fileID: 4493448285314379156}
m_Layer: 0
m_Name: ConfigManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7021351325020055800
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8320216767994874586}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -74.23521, y: 4.9800367, z: -13.716739}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 38
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4493448285314379156
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8320216767994874586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7622588c230b4b448152a6dfd6c0588, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5d19b02089b931a469209b09142786a0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
using FishNet.Component.Spawning;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CustomNetworkManager : MonoBehaviour
{
public static CustomNetworkManager instance = null;
public PlayerSpawner playerSpawner;
void Awake()
{
if (!instance) { instance = this; }
else if (instance != this) { Destroy(gameObject); }
DontDestroyOnLoad(gameObject);
}
private void Start()
{
if (playerSpawner.Spawns.Length == 0) {
Debug.LogWarning("Player spawns undefined. Assign a player spawn to PlayerSpawner!");
} else {
bool hasSpawn = false;
foreach (Transform spawn in playerSpawner.Spawns)
{
hasSpawn |= spawn != null;
}
if (!hasSpawn)
{
Debug.LogWarning("Player spawns undefined. Assign a player spawn to PlayerSpawner!");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 067fc70e6bd1a024ba644f52017165fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 67f163b4eb8c8df43b48aab810b8a0a8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.