石头功能

This commit is contained in:
2024-11-12 14:32:02 +08:00
parent 577ec13fa5
commit fccc58f5b9
50 changed files with 8871 additions and 1225 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6ff13991ee06cb3489892a5be46ce067 guid: fd3209e3845a2b24dbcf3a658f4e6a79
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
-20
View File
@@ -1,20 +0,0 @@
# Yarn自定义命令列表
***
## 1.主场景中定义的命令
| 命令名 | 描述 |参数1| 参数2 | 已实现 | 备注 |
|-----------|---|-----|---|---|----|
| switch_tv | 切换电视机图片 |电视机图片名称| - | 是 |-|
| indoor |电视界面淡出 | - | - | 是 | 太怪了,回头删掉 |
|character_init|角色初始化|角色图片名|-|是|进入诊所时要调用|
|character_switch_image|切换角色图片|角色图片名|-|是|-|
|character_fade_in|角色淡入|淡入耗时|-|是|不支持默认参数,回头再想想|
|character_fade_out|角色淡出|淡出耗时|-|是|同上|
|character_move_to_fix|角色移动到维修位置|-|-|是|-|
|load_scene|加载场景|场景名|-|是|场景名是Addressables定的|
|hide_dialog|隐藏对话框|-|-|是|一般不需要手动收,临时用|
|fade_in|遮罩淡入|耗时|-|是|-|
|fade_out|遮罩淡出|耗时|-|是|-|
-3
View File
@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 92a558ad9fc2432d8785ce293355e953
timeCreated: 1724075985
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d94593d48f1abe94e9435f3ca7909486
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+33
View File
@@ -0,0 +1,33 @@
using UnityEditor;
using UnityEngine;
namespace AibisDream
{
/// <summary>
/// 齿轮系统编辑器
/// </summary>
[CustomEditor(typeof(GearController))]
public class GearSystemEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
GearController controller = (GearController)target;
GUILayout.Label("关卡编辑功能");
if (GUILayout.Button("添加一个齿轮轴"))
{
Debug.Log("添加齿轮轴");
}
if (GUILayout.Button("添加一个浮动的齿轮"))
{
Debug.Log("添加浮动齿轮");
}
GUILayout.Label("关卡加载/编辑");
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab611734fd046fe41b0b72a904792339
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,31 @@
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MeshRenderer))]
public class MeshRendererEditor : Editor
{
MeshRenderer _meshRenderer;
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
_meshRenderer = target as MeshRenderer;
string[] layerNames = new string[SortingLayer.layers.Length];
for (int i = 0; i < SortingLayer.layers.Length; i++)
layerNames[i] = SortingLayer.layers[i].name;
if (_meshRenderer)
{
int layerValue = SortingLayer.GetLayerValueFromID(_meshRenderer.sortingLayerID);
layerValue = EditorGUILayout.Popup("Sorting Layer", layerValue, layerNames);
SortingLayer layer = SortingLayer.layers[layerValue];
_meshRenderer.sortingLayerName = layer.name;
_meshRenderer.sortingLayerID = layer.id;
}
if (_meshRenderer)
_meshRenderer.sortingOrder = EditorGUILayout.IntField("Order in Layer", _meshRenderer.sortingOrder);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0fefa37d226261843b407d6aa323b50c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dde730b9972f3954c9640fb6ccbf9624
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -119,6 +119,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []
@@ -0,0 +1,153 @@
fileFormatVersion: 2
guid: 6f1e19b22a956634b86a43a0ee4ae6f6
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: 1
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
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 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
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 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
ignorePlatformSupport: 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:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7964e6288354cc846a5a95917ad67d9d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,821 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1527569254408819154
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2471109205967132558}
- component: {fileID: 8881519943291054062}
m_Layer: 0
m_Name: Amb2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2471109205967132558
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1527569254408819154}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &8881519943291054062
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1527569254408819154}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -4767431408014039957, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 1
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!1 &4263441732887063756
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4286586740530885281}
- component: {fileID: 951614760418124979}
m_Layer: 0
m_Name: Voice
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4286586740530885281
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4263441732887063756}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &951614760418124979
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4263441732887063756}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -2297450186869358485, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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!1 &6247080755836924787
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 336529723513575472}
- component: {fileID: 7215266311881862311}
m_Layer: 0
m_Name: Audio Manager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &336529723513575472
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6247080755836924787}
serializedVersion: 2
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:
- {fileID: 1142927291631534488}
- {fileID: 2613293443474806118}
- {fileID: 4286586740530885281}
- {fileID: 4912850787450048457}
- {fileID: 7940577869805702019}
- {fileID: 2471109205967132558}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7215266311881862311
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6247080755836924787}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d02d13e0ef27eb544b62d5a8d296f2ee, type: 3}
m_Name:
m_EditorClassIdentifier:
fadeTime: 1
--- !u!1 &6862447680092929665
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1142927291631534488}
- component: {fileID: 5202610640273100065}
m_Layer: 0
m_Name: Loop
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1142927291631534488
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6862447680092929665}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &5202610640273100065
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6862447680092929665}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 8866379113506573767, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 0.659
m_Pitch: 1
Loop: 1
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!1 &7126836783281766734
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2613293443474806118}
- component: {fileID: 6843084311142123149}
m_Layer: 0
m_Name: Interaction
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2613293443474806118
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7126836783281766734}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &6843084311142123149
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7126836783281766734}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -1154322574682727772, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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!1 &7665279057604741938
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7940577869805702019}
- component: {fileID: 523535875782967003}
m_Layer: 0
m_Name: Amb1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7940577869805702019
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7665279057604741938}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &523535875782967003
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7665279057604741938}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 1773163451604355202, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 8300000, guid: fc69ad6fefb757c43b4d68c6a82363b3, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
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!1 &9082819828820354776
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4912850787450048457}
- component: {fileID: 2280720808147471031}
m_Layer: 0
m_Name: Memery
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4912850787450048457
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082819828820354776}
serializedVersion: 2
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: 336529723513575472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &2280720808147471031
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082819828820354776}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -6773993072664640036, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b8280919ceaa0a2489020c94c7376cd0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6b861cf8ca2b934458e03a94afdf8490
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -196,7 +196,7 @@ SpriteRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 2 m_SortingOrder: 2
m_Sprite: {fileID: -1923825764, guid: 4007956251f7161409b80ba58fa68f1f, type: 3} m_Sprite: {fileID: -1923825764, guid: 4007956251f7161409b80ba58fa68f1f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
m_DrawMode: 0 m_DrawMode: 0
@@ -223,3 +223,4 @@ MonoBehaviour:
initialSpeed: 0 initialSpeed: 0
gearModel: {fileID: 0} gearModel: {fileID: 0}
targetSpeed: 0 targetSpeed: 0
speed: 0
+1 -1
View File
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
<<<<<<<< HEAD:Assets/Resources/Yarn/Interactive.meta <<<<<<<< HEAD:Assets/Resources/Yarn/Interactive.meta
guid: 99621e64c99c4e844a3eba8ac29085be guid: b95f6f900179151479264624a07d43b9
folderAsset: yes folderAsset: yes
======== ========
guid: 6049fd85ed8ebc143ae61df5851ba784 guid: 6049fd85ed8ebc143ae61df5851ba784
+1 -1
View File
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
<<<<<<<< HEAD:Assets/AddressableAssetsData/WebGL.meta <<<<<<<< HEAD:Assets/AddressableAssetsData/WebGL.meta
guid: 6ff13991ee06cb3489892a5be46ce067 guid: 785de48ca85c1484fb49e606aff0cba2
folderAsset: yes folderAsset: yes
======== ========
guid: 525b4d1751c2ca547940912006eb87c3 guid: 525b4d1751c2ca547940912006eb87c3
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8220a2f6b45b8dd4e8dab6e1aaefb073
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
<<<<<<<< HEAD:Assets/Resources/Yarn/Interactive.meta <<<<<<<< HEAD:Assets/Resources/Yarn/Interactive.meta
guid: 99621e64c99c4e844a3eba8ac29085be guid: 3e078c84a882fcf4faf777ade6497555
folderAsset: yes folderAsset: yes
======== ========
guid: 6049fd85ed8ebc143ae61df5851ba784 guid: 6049fd85ed8ebc143ae61df5851ba784
+61 -817
View File
@@ -123,185 +123,11 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &40915749 --- !u!4 &40915750 stripped
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 40915750}
- component: {fileID: 40915751}
m_Layer: 0
m_Name: Audio Manager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &40915750
Transform: Transform:
m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 2818890696597710427}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 40915749}
serializedVersion: 2
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:
- {fileID: 1410207950}
- {fileID: 460780905}
- {fileID: 57390246}
- {fileID: 1403040025}
- {fileID: 868192523}
- {fileID: 262337781}
m_Father: {fileID: 1009826577}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &40915751
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 40915749}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d02d13e0ef27eb544b62d5a8d296f2ee, type: 3}
m_Name:
m_EditorClassIdentifier:
fadeTime: 1
--- !u!1 &57390245
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 57390246}
- component: {fileID: 57390247}
m_Layer: 0
m_Name: Voice
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &57390246
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 57390245}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &57390247
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 57390245}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -2297450186869358485, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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!224 &62394964 stripped --- !u!224 &62394964 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 7131956091114956203, guid: e2211373480d40243a377721316dd8f7, type: 3} m_CorrespondingSourceObject: {fileID: 7131956091114956203, guid: e2211373480d40243a377721316dd8f7, type: 3}
@@ -387,6 +213,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
quickRunMode: 0 quickRunMode: 0
isInPause: 0
--- !u!1001 &152335402 --- !u!1001 &152335402
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -668,134 +495,6 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
--- !u!1 &262337780
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 262337781}
- component: {fileID: 262337782}
m_Layer: 0
m_Name: Amb2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &262337781
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 262337780}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &262337782
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 262337780}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -4767431408014039957, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 1
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!1 &331068878 --- !u!1 &331068878
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -986,134 +685,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 8677370814205024500, guid: 55eac30d86443354ebfe3cc06c7b00e8, type: 3} m_CorrespondingSourceObject: {fileID: 8677370814205024500, guid: 55eac30d86443354ebfe3cc06c7b00e8, type: 3}
m_PrefabInstance: {fileID: 442870837} m_PrefabInstance: {fileID: 442870837}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &460780904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 460780905}
- component: {fileID: 460780906}
m_Layer: 0
m_Name: Interaction
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &460780905
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 460780904}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &460780906
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 460780904}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -1154322574682727772, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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!1 &494300778 --- !u!1 &494300778
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2131,134 +1702,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 791733123} m_GameObject: {fileID: 791733123}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &868192522
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 868192523}
- component: {fileID: 868192524}
m_Layer: 0
m_Name: Amb1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &868192523
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 868192522}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &868192524
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 868192522}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 1773163451604355202, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 8300000, guid: fc69ad6fefb757c43b4d68c6a82363b3, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
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!1 &886733270 --- !u!1 &886733270
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -3478,262 +2921,6 @@ Transform:
- {fileID: 515480973} - {fileID: 515480973}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1403040024
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1403040025}
- component: {fileID: 1403040026}
m_Layer: 0
m_Name: Memery
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1403040025
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1403040024}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &1403040026
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1403040024}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -6773993072664640036, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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!1 &1410207949
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1410207950}
- component: {fileID: 1410207951}
m_Layer: 0
m_Name: Loop
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1410207950
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410207949}
serializedVersion: 2
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: 40915750}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &1410207951
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410207949}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 8866379113506573767, guid: b14347481450a234a852407119bfecb4, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 0.659
m_Pitch: 1
Loop: 1
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!1 &1445926170 --- !u!1 &1445926170
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -5363,6 +4550,63 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e2211373480d40243a377721316dd8f7, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e2211373480d40243a377721316dd8f7, type: 3}
--- !u!1001 &2818890696597710427
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1009826577}
m_Modifications:
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 336529723513575472, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6247080755836924787, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
propertyPath: m_Name
value: Audio Manager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b8280919ceaa0a2489020c94c7376cd0, type: 3}
--- !u!1001 &3153424427816356459 --- !u!1001 &3153424427816356459
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
+1 -1
View File
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
<<<<<<<< HEAD:Assets/Scripts/Framework/LifeCycle.meta <<<<<<<< HEAD:Assets/Scripts/Framework/LifeCycle.meta
guid: 3e1e2a81dd2780b4694d103dddd3a53e guid: d594b07ec3b385044b3fd98affc8edee
folderAsset: yes folderAsset: yes
======== ========
guid: 39db4a518afdbd74f8c0100de0f68c74 guid: 39db4a518afdbd74f8c0100de0f68c74
+1
View File
@@ -13,6 +13,7 @@ public class Cable : MonoBehaviour
get { return end; } get { return end; }
set { end = value; } set { end = value; }
} }
public int resolution = 10; public int resolution = 10;
public float dstMin = 0.1f; public float dstMin = 0.1f;
public float dstMax = 1.0f; public float dstMax = 1.0f;
+31 -19
View File
@@ -11,13 +11,13 @@ using System;
public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler
{ {
public delegate void PlugEventHandler(Plug plug); public delegate void PlugEventHandler(Plug plug);
public event PlugEventHandler OnPlugStartDrag; public event PlugEventHandler OnPlugStartDrag;
public event PlugEventHandler OnPlugEndDrag; public event PlugEventHandler OnPlugEndDrag;
private Vector3 startPosition; private Vector3 startPosition;
private Quaternion startRotation; private Quaternion startRotation;
private bool isDragging = false; private bool isDragging = false;
[HideInInspector] [HideInInspector] public Socket currentSocket = null;
public Socket currentSocket = null;
private Image image; private Image image;
private Vector3 pickupOffset = new Vector3(0, 0, 0); private Vector3 pickupOffset = new Vector3(0, 0, 0);
private Quaternion pickupRotationOffset = Quaternion.Euler(0, 0, 30); private Quaternion pickupRotationOffset = Quaternion.Euler(0, 0, 30);
@@ -28,11 +28,13 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
public bool IsActive { get; set; } = true; public bool IsActive { get; set; } = true;
private Cable cableref; private Cable cableref;
public Cable CableRef public Cable CableRef
{ {
get { return cableref; } get { return cableref; }
set { cableref = value; } set { cableref = value; }
} }
public event Action<Plug> OnPlugInserted; public event Action<Plug> OnPlugInserted;
public event Action OnPlugRemoved; public event Action OnPlugRemoved;
@@ -40,8 +42,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
private void Awake() private void Awake()
{ {
image = GetComponent<Image>(); image = GetComponent<Image>();
cableref=FindObjectOfType<Cable>(); cableref = FindObjectOfType<Cable>();
cableref.End=transform; cableref.End = transform;
} }
private void Start() private void Start()
@@ -51,41 +53,44 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
transform.position = startPosition; transform.position = startPosition;
initialSocket.InsertPlug(this); initialSocket.InsertPlug(this);
plugSprite.enabled = false; plugSprite.enabled = false;
currentSocket=initialSocket; currentSocket = initialSocket;
DialogController.OnDialogueStart += HandleDialogueStart; DialogController.OnDialogueStart += HandleDialogueStart;
DialogController.OnDialogueComplete += HandleDialogueComplete; DialogController.OnDialogueComplete += HandleDialogueComplete;
} }
void OnDestroy()
void OnDestroy()
{ {
// Unsubscribe from dialogue events // Unsubscribe from dialogue events
DialogController.OnDialogueStart -= HandleDialogueStart; DialogController.OnDialogueStart -= HandleDialogueStart;
DialogController.OnDialogueComplete -= HandleDialogueComplete; DialogController.OnDialogueComplete -= HandleDialogueComplete;
} }
public void HandleDialogueStart()
public void HandleDialogueStart()
{ {
// Dialogue has started, disable plug interactions // Dialogue has started, disable plug interactions
IsInDialogue = true; IsInDialogue = true;
//Debug.Log("in dialogue"); //Debug.Log("in dialogue");
} }
public void HandleDialogueComplete() public void HandleDialogueComplete()
{ {
// Dialogue has completed, enable plug interactions // Dialogue has completed, enable plug interactions
IsInDialogue = false; IsInDialogue = false;
//Debug.Log("dialoguecompleted"); //Debug.Log("dialoguecompleted");
} }
[YarnCommand("Disable_plugInput")] [YarnCommand("Disable_plugInput")]
public void Disable_plugInput() public void Disable_plugInput()
{ {
// Dialogue has started, disable plug interactions // Dialogue has started, disable plug interactions
IsActive = false; IsActive = false;
//Debug.Log("in dialogue"); //Debug.Log("in dialogue");
} }
[YarnCommand("Enable_plugInput")] [YarnCommand("Enable_plugInput")]
public void Enable_plugInput() public void Enable_plugInput()
{ {
// Dialogue has completed, enable plug interactions // Dialogue has completed, enable plug interactions
IsActive = true; IsActive = true;
//Debug.Log("dialoguecompleted"); //Debug.Log("dialoguecompleted");
} }
@@ -96,13 +101,15 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
{ {
return; return;
} }
if (IsInDialogue) if (IsInDialogue)
{ {
return; return;
} }
isDragging = true; isDragging = true;
image.raycastTarget = false; image.raycastTarget = false;
// 通知 DialogueManager 开始拖拽 // 通知 DialogueManager 开始拖拽
DialogueManager.Instance.SetDragging(true); DialogueManager.Instance.SetDragging(true);
currentSocket?.RemovePlug(this); currentSocket?.RemovePlug(this);
OnPlugRemoved?.Invoke(); OnPlugRemoved?.Invoke();
@@ -119,15 +126,17 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
{ {
return; return;
} }
if (IsInDialogue) if (IsInDialogue)
{ {
return; return;
} }
if (isDragging) if (isDragging)
{ {
CableRef.End=transform.GetChild(0).transform; CableRef.End = transform.GetChild(0).transform;
Vector3 screenPosition = new Vector3(eventData.position.x, eventData.position.y, Vector3 screenPosition = new Vector3(eventData.position.x, eventData.position.y,
Camera.main.WorldToScreenPoint(transform.position).z); Camera.main.WorldToScreenPoint(transform.position).z);
Vector3 move = Camera.main.ScreenToWorldPoint(screenPosition); Vector3 move = Camera.main.ScreenToWorldPoint(screenPosition);
move.z = transform.position.z; move.z = transform.position.z;
transform.position = move; transform.position = move;
@@ -141,10 +150,12 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
{ {
return; return;
} }
if (IsInDialogue) if (IsInDialogue)
{ {
return; return;
} }
isDragging = false; isDragging = false;
image.raycastTarget = true; image.raycastTarget = true;
// 通知 DialogueManager 结束拖拽 // 通知 DialogueManager 结束拖拽
@@ -183,7 +194,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
//transform.rotation = startRotation; //transform.rotation = startRotation;
initialSocket.InsertPlug(this); initialSocket.InsertPlug(this);
OnPlugInserted?.Invoke(this); // 触发插入事件 OnPlugInserted?.Invoke(this); // 触发插入事件
plugSprite.enabled =false; // Make the plug sprite disappear when it is inserted into the initial socket. plugSprite.enabled =
false; // Make the plug sprite disappear when it is inserted into the initial socket.
}); });
} }
} }
@@ -194,4 +206,4 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
float snappingRange = 1.0f; // You might need to adjust this for WorldSpace Canvas float snappingRange = 1.0f; // You might need to adjust this for WorldSpace Canvas
Gizmos.DrawWireSphere(transform.position, snappingRange); Gizmos.DrawWireSphere(transform.position, snappingRange);
} }
} }
+18 -21
View File
@@ -6,7 +6,7 @@ public class Socket : MonoBehaviour, ISocket
{ {
public bool IsAvailable { get; private set; } = true; public bool IsAvailable { get; private set; } = true;
public Vector2 InsertionPoint => transform.position; public Vector2 InsertionPoint => transform.position;
private Plug plug=null; private Plug plug = null;
private YarnOption _option; private YarnOption _option;
private bool waitYarnCommand = false; private bool waitYarnCommand = false;
@@ -15,14 +15,11 @@ public class Socket : MonoBehaviour, ISocket
get { return waitYarnCommand; } get { return waitYarnCommand; }
} }
public bool notAlowedDeep=false; public bool notAlowedDeep = false;
[HideInInspector] [HideInInspector] public TargetPointData targetData; // 新增属性
public TargetPointData targetData; // 新增属性
public YarnOption Option public YarnOption Option
{ {
set => _option = value; set => _option = value;
} }
@@ -30,44 +27,44 @@ public class Socket : MonoBehaviour, ISocket
public void Start() public void Start()
{ {
targetData=transform.GetComponent<TargetPointData>(); targetData = transform.GetComponent<TargetPointData>();
} }
public void Update() public void Update()
{ {
if(plug!=null) if (plug != null)
{ {
plug.transform.position=transform.position; plug.transform.position = transform.position;
} }
} }
public void InsertPlug(Plug p) public void InsertPlug(Plug p)
{ {
if (IsAvailable) if (IsAvailable)
{ {
IsAvailable = false; IsAvailable = false;
} }
AudioManager.RandomPlayInteraction("plug_in"); AudioManager.RandomPlayInteraction("plug_in");
plug=p; plug = p;
plug.CableRef.End=plug.transform; plug.CableRef.End = plug.transform;
// 可插入就可以触发对话 // 可插入就可以触发对话
//_option?.SelectOption();
} }
public void RemovePlug(Plug p) public void RemovePlug(Plug p)
{ {
IsAvailable = true; IsAvailable = true;
AudioManager.RandomPlayInteraction("plug_out"); AudioManager.RandomPlayInteraction("plug_out");
//MessageBox.Instance.HandleMessageBoxCommand("null",""); if (plug != null)
if(plug!=null)
{ {
plug.CableRef.End=plug.transform.GetChild(0).transform; plug.CableRef.End = plug.transform.GetChild(0).transform;
plug.currentSocket=null; plug.currentSocket = null;
plug=null; plug = null;
} }
} }
public Vector2 GetPosition() public Vector2 GetPosition()
{ {
return transform.position; return transform.position;
} }
} }
@@ -4,7 +4,7 @@ using System.Collections;
using RainbowArt.CleanFlatUI; using RainbowArt.CleanFlatUI;
using UnityEngine.UI; using UnityEngine.UI;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using DG.Tweening; using DG.Tweening;
using TMPro; using TMPro;
using UnityEditor.Localization.Plugins.XLIFF.V20; using UnityEditor.Localization.Plugins.XLIFF.V20;
using AibisDream; using AibisDream;
@@ -15,6 +15,7 @@ public class OscilloscopeController : MonoBehaviour
public WaveformVisualizer waveformVisualizer; public WaveformVisualizer waveformVisualizer;
public LineRenderer scanLine; public LineRenderer scanLine;
//public SliderCircular phaseSlider; //public SliderCircular phaseSlider;
public Slider phaseSlider; public Slider phaseSlider;
@@ -22,14 +23,14 @@ public class OscilloscopeController : MonoBehaviour
public Button DeepInButton; public Button DeepInButton;
private float phaseShiftMax = Mathf.PI*1.5f; private float phaseShiftMax = Mathf.PI * 1.5f;
private Plug plug; private Plug plug;
private EyeTransitionManager transitionManager; private EyeTransitionManager transitionManager;
private bool setInitSliderValue=false; private bool setInitSliderValue = false;
private float scanSpeed=2f; private float scanSpeed = 2f;
public TMP_Text screenText; public TMP_Text screenText;
@@ -37,22 +38,21 @@ public class OscilloscopeController : MonoBehaviour
void Start() void Start()
{ {
scanLine.startWidth=0.05f; scanLine.startWidth = 0.05f;
scanLine.endWidth=0.05f; scanLine.endWidth = 0.05f;
scanLine.gameObject.SetActive(false); scanLine.gameObject.SetActive(false);
transitionManager = FindObjectOfType<EyeTransitionManager>(); transitionManager = FindObjectOfType<EyeTransitionManager>();
plug = FindObjectOfType<Plug>(); plug = FindObjectOfType<Plug>();
DeepInButton.GetComponent<Button>().onClick.AddListener(DeepIn); DeepInButton.GetComponent<Button>().onClick.AddListener(DeepIn);
screenText.text=""; screenText.text = "";
currentSocket=null; currentSocket = null;
if(plug!=null) if (plug != null)
{ {
plug.OnPlugInserted += HandlePlugInserted; plug.OnPlugInserted += HandlePlugInserted;
plug.OnPlugRemoved += HandlePlugRemoved; plug.OnPlugRemoved += HandlePlugRemoved;
} }
} }
private void HandlePlugInserted(Plug plug) private void HandlePlugInserted(Plug plug)
{ {
// 这里可以处理插入后的波形显示逻辑 // 这里可以处理插入后的波形显示逻辑
@@ -62,187 +62,182 @@ public class OscilloscopeController : MonoBehaviour
private void HandlePlugRemoved() private void HandlePlugRemoved()
{ {
// 这里可以处理移除后的清除波形逻辑 // 这里可以处理移除后的清除波形逻辑
screenText.text=""; screenText.text = "";
Debug.Log("Plug removed from the socket, stopping waveform display."); Debug.Log("Plug removed from the socket, stopping waveform display.");
} }
public void DeepIn() public void DeepIn()
{ {
if (plug == null) if (plug == null)
{ {
Debug.Log("未找到插头"); Debug.Log("未找到插头");
return; return;
} }
currentSocket = plug.currentSocket;
if (currentSocket == null || currentSocket.targetData == null) currentSocket = plug.currentSocket;
{
Debug.Log("未插入任何目标模块"); if (currentSocket == null || currentSocket.targetData == null)
screenText.text="未插入任何目标模块"; {
return; Debug.Log("未插入任何目标模块");
screenText.text = "未插入任何目标模块";
return;
}
string originalString = currentSocket.name;
string trimmedString = originalString.Replace("Socket", "");
string yarnString = "On" + trimmedString + "DeepIn";
if (currentSocket.WaitYarnCommand)
{
// DialogController.Instance.SetVariable("$ViewToDeepIn",trimmedString);
// DialogController.Instance.StartDialogNode("DeepInView");
}
else if (currentSocket.targetData.HasExternalError())
{
transitionManager.SetViewAvailability(trimmedString, true);
DeepInButton.interactable = false;
HandleDeepIn();
}
else
{
StartCoroutine(ScanForError(trimmedString)); // 启动扫描协程
}
} }
string originalString = currentSocket.name; private void DeepInexecution()
string trimmedString = originalString.Replace("Socket", "");
string yarnString = "On"+trimmedString+"DeepIn";
if(currentSocket.WaitYarnCommand)
{ {
// DialogController.Instance.SetVariable("$ViewToDeepIn",trimmedString); string originalString = currentSocket.name;
// DialogController.Instance.StartDialogNode("DeepInView"); string trimmedString = originalString.Replace("Socket", "");
} StartCoroutine(transitionManager.StartTransitionCoroutine(trimmedString));
else if(currentSocket.targetData.HasExternalError()) DeepInButton.interactable = true;
{ phaseSlider.interactable = true;
transitionManager.SetViewAvailability(trimmedString, true);
DeepInButton.interactable=false;
HandleDeepIn();
}
else
{
StartCoroutine(ScanForError(trimmedString)); // 启动扫描协程
}
}
private void DeepInexecution()
{
string originalString = currentSocket.name;
string trimmedString = originalString.Replace("Socket", "");
StartCoroutine(transitionManager.StartTransitionCoroutine(trimmedString));
DeepInButton.interactable=true;
phaseSlider.interactable=true;
//screenText.text="";
plug.Enable_plugInput();
}
private void HandleDeepIn()
{
if(currentSocket.notAlowedDeep)
{
screenText.text="特殊保护,禁止深入模块";
DeepInButton.interactable=true;
phaseSlider.interactable=true;
//screenText.text=""; //screenText.text="";
plug.Enable_plugInput(); plug.Enable_plugInput();
}
else
{
screenText.text="错误找到,开始深入准备";
} }
private void HandleDeepIn()
string originalString = currentSocket.name;
string trimmedString = originalString.Replace("Socket", "");
string yarnString = "On"+trimmedString+"DeepIn";
if(DialogController.Instance.CheckIfNodeExistInCurrentYarnProject(yarnString))
{ {
DialogController.Instance.StartDialogNode(yarnString); if (currentSocket.notAlowedDeep)
if(!currentSocket.notAlowedDeep)
{ {
DialogController.OnDialogueComplete+=DeepInexecution; screenText.text = "特殊保护,禁止深入模块";
} DeepInButton.interactable = true;
} phaseSlider.interactable = true;
else //screenText.text="";
{ plug.Enable_plugInput();
if(!currentSocket.notAlowedDeep) }
else
{ {
DeepInexecution(); screenText.text = "错误找到,开始深入准备";
} }
string originalString = currentSocket.name;
string trimmedString = originalString.Replace("Socket", "");
string yarnString = "On" + trimmedString + "DeepIn";
if (DialogController.Instance.CheckIfNodeExistInCurrentYarnProject(yarnString))
{
DialogController.Instance.StartDialogNode(yarnString);
if (!currentSocket.notAlowedDeep)
{
DialogController.OnDialogueComplete += DeepInexecution;
}
}
else
{
if (!currentSocket.notAlowedDeep)
{
DeepInexecution();
}
}
} }
}
void HandleExternalError() void HandleExternalError()
{ {
scanLine.gameObject.SetActive(false); scanLine.gameObject.SetActive(false);
phaseSlider.interactable = false; phaseSlider.interactable = false;
waveformVisualizer.gameObject.SetActive(false); waveformVisualizer.gameObject.SetActive(false);
screenText.text = "外部错误已关联,可以直接深入"; screenText.text = "外部错误已关联,可以直接深入";
} }
private IEnumerator ScanForError(string trimmedString) private IEnumerator ScanForError(string trimmedString)
{
phaseSlider.interactable=false;
plug.Disable_plugInput();
scanLine.gameObject.SetActive(true);
// 设置扫描线初始位置(左侧)
float startX = -waveformVisualizer.spriteWidth / 2;
float endX = waveformVisualizer.spriteWidth / 2;
float currentX = startX;
// 上下点的位置,x 相同,y 为正负数
Vector3 topPosition = new Vector3(currentX, waveformVisualizer.spriteHeight / 2, 0);
Vector3 bottomPosition = new Vector3(currentX, -waveformVisualizer.spriteHeight / 2, 0);
scanLine.SetPosition(0, topPosition);
scanLine.SetPosition(1, bottomPosition);
//float scanSpeed = waveformVisualizer.scanSpeed;
bool isErrorFound = false;
// 计算目标位置对应的 x 值
float spikeX = (waveformVisualizer.SpikeIndex / (float)waveformVisualizer.samples) * waveformVisualizer.spriteWidth - waveformVisualizer.spriteWidth / 2;
float previousX = currentX;
screenText.text="搜寻中...";
// 从左到右扫描
while (currentX <= endX)
{ {
// 更新扫描线的位置,x 向右移动 phaseSlider.interactable = false;
currentX += Time.deltaTime * scanSpeed; plug.Disable_plugInput();
topPosition.x = currentX; scanLine.gameObject.SetActive(true);
bottomPosition.x = currentX;
// 设置扫描线初始位置(左侧)
float startX = -waveformVisualizer.spriteWidth / 2;
float endX = waveformVisualizer.spriteWidth / 2;
float currentX = startX;
// 上下点的位置,x 相同,y 为正负数
Vector3 topPosition = new Vector3(currentX, waveformVisualizer.spriteHeight / 2, 0);
Vector3 bottomPosition = new Vector3(currentX, -waveformVisualizer.spriteHeight / 2, 0);
scanLine.SetPosition(0, topPosition); scanLine.SetPosition(0, topPosition);
scanLine.SetPosition(1, bottomPosition); scanLine.SetPosition(1, bottomPosition);
// 检查是否跨越了 spikeX //float scanSpeed = waveformVisualizer.scanSpeed;
if (waveformVisualizer.isErrorFind && ((previousX < spikeX && currentX >= spikeX) || (previousX > spikeX && currentX <= spikeX))) bool isErrorFound = false;
// 计算目标位置对应的 x 值
float spikeX =
(waveformVisualizer.SpikeIndex / (float)waveformVisualizer.samples) * waveformVisualizer.spriteWidth -
waveformVisualizer.spriteWidth / 2;
float previousX = currentX;
screenText.text = "搜寻中...";
// 从左到右扫描
while (currentX <= endX)
{ {
isErrorFound = true; // 更新扫描线的位置,x 向右移动
topPosition.x = spikeX; currentX += Time.deltaTime * scanSpeed;
bottomPosition.x = spikeX; topPosition.x = currentX;
bottomPosition.x = currentX;
scanLine.SetPosition(0, topPosition); scanLine.SetPosition(0, topPosition);
scanLine.SetPosition(1, bottomPosition); scanLine.SetPosition(1, bottomPosition);
scanLine.startColor = Color.red; // 检查是否跨越了 spikeX
scanLine.endColor = Color.red; if (waveformVisualizer.isErrorFind && ((previousX < spikeX && currentX >= spikeX) ||
//Debug.Log("找到错误,可以开始深入"); (previousX > spikeX && currentX <= spikeX)))
//screenText.text="找到错误,可以开始深入"; {
yield return new WaitForSeconds(1f); isErrorFound = true;
transitionManager.SetViewAvailability(trimmedString, true); topPosition.x = spikeX;
DeepInButton.interactable=false; bottomPosition.x = spikeX;
HandleDeepIn(); scanLine.SetPosition(0, topPosition);
break; scanLine.SetPosition(1, bottomPosition);
scanLine.startColor = Color.red;
scanLine.endColor = Color.red;
//Debug.Log("找到错误,可以开始深入");
//screenText.text="找到错误,可以开始深入";
yield return new WaitForSeconds(1f);
transitionManager.SetViewAvailability(trimmedString, true);
DeepInButton.interactable = false;
HandleDeepIn();
break;
}
previousX = currentX; // 更新 previousX 为当前的 currentX
yield return null; // 等待下一帧
} }
previousX = currentX; // 更新 previousX 为当前的 currentX if (!isErrorFound)
yield return null; // 等待下一帧 {
Debug.Log("未找到错误,无法深入");
screenText.text = "未找到错误,无法深入";
transitionManager.SetViewAvailability(trimmedString, false);
}
// 扫描完成,停留片刻后隐藏扫描线
yield return new WaitForSeconds(0.1f);
scanLine.gameObject.SetActive(false);
scanLine.startColor = Color.white;
scanLine.endColor = Color.white;
phaseSlider.interactable = true;
plug.Enable_plugInput();
//screenText.text="";
} }
if (!isErrorFound)
{
Debug.Log("未找到错误,无法深入");
screenText.text="未找到错误,无法深入";
transitionManager.SetViewAvailability(trimmedString, false);
}
// 扫描完成,停留片刻后隐藏扫描线
yield return new WaitForSeconds(0.1f);
scanLine.gameObject.SetActive(false);
scanLine.startColor = Color.white;
scanLine.endColor = Color.white;
phaseSlider.interactable=true;
plug.Enable_plugInput();
//screenText.text="";
}
void Update() void Update()
{ {
if (plug != null) if (plug != null)
@@ -254,18 +249,18 @@ private IEnumerator ScanForError(string trimmedString)
var targetData = currentSocket.targetData; var targetData = currentSocket.targetData;
if (targetData != null) if (targetData != null)
{ {
if(targetData.HasExternalError()) if (targetData.HasExternalError())
{ {
screenText.text = "外部错误已关联,可以直接深入";
screenText.text="外部错误已关联,可以直接深入";
return; return;
} }
if(!setInitSliderValue) if (!setInitSliderValue)
{ {
setInitSliderValue=true; setInitSliderValue = true;
phaseSlider.value=targetData.sliderValue; phaseSlider.value = targetData.sliderValue;
} }
waveformVisualizer.waveformType = targetData.waveformType; waveformVisualizer.waveformType = targetData.waveformType;
waveformVisualizer.clarity = 1; waveformVisualizer.clarity = 1;
float phaseShift = 0f; float phaseShift = 0f;
@@ -273,19 +268,18 @@ private IEnumerator ScanForError(string trimmedString)
{ {
float sliderPhase = (phaseSlider.value / 8f) * phaseShiftMax; float sliderPhase = (phaseSlider.value / 8f) * phaseShiftMax;
phaseShift = sliderPhase + targetData.initialRandomPhase; phaseShift = sliderPhase + targetData.initialRandomPhase;
targetData.sliderValue=phaseSlider.value; targetData.sliderValue = phaseSlider.value;
} }
if(phaseSlider.value>0)
if (phaseSlider.value > 0)
{ {
waveformVisualizer.SetPhaseShift(phaseShift); waveformVisualizer.SetPhaseShift(phaseShift);
} }
else else
{ {
waveformVisualizer.SetPhaseShift(0); waveformVisualizer.SetPhaseShift(0);
} }
waveformVisualizer.gameObject.SetActive(true); waveformVisualizer.gameObject.SetActive(true);
if (!targetData.isCorrect) if (!targetData.isCorrect)
@@ -300,16 +294,15 @@ private IEnumerator ScanForError(string trimmedString)
} }
} }
} }
void ResetVisualizer() void ResetVisualizer()
{ {
waveformVisualizer.waveformType = WaveformType.Noise; waveformVisualizer.waveformType = WaveformType.Noise;
waveformVisualizer.clarity = 0; waveformVisualizer.clarity = 0;
waveformVisualizer.ResetWaveform(); waveformVisualizer.ResetWaveform();
waveformVisualizer.gameObject.SetActive(true); waveformVisualizer.gameObject.SetActive(true);
phaseSlider.value=0; phaseSlider.value = 0;
waveformVisualizer.SetPhaseShift(0); waveformVisualizer.SetPhaseShift(0);
setInitSliderValue=false; setInitSliderValue = false;
} }
}
}
@@ -15,40 +15,30 @@ public enum WaveformType
[RequireComponent(typeof(LineRenderer))] [RequireComponent(typeof(LineRenderer))]
public class WaveformVisualizer : MonoBehaviour public class WaveformVisualizer : MonoBehaviour
{ {
[HideInInspector] [HideInInspector] public int samples = 1024;
public int samples = 1024; [HideInInspector] private float amplitude = 0.6f;
[HideInInspector]
private float amplitude = 0.6f;
public float spatialFrequency = 1f; public float spatialFrequency = 1f;
public float temporalFrequency = 0.1f; public float temporalFrequency = 0.1f;
private float targetWaveformNoiseAmplitude = 0.1f; private float targetWaveformNoiseAmplitude = 0.1f;
public float noiseAmplitude = 0.5f; public float noiseAmplitude = 0.5f;
[Range(0f, 1f)] [Range(0f, 1f)] [HideInInspector] public float clarity = 0f;
[HideInInspector]
public float clarity = 0f;
public Color noiseColor = Color.gray; public Color noiseColor = Color.gray;
public Color clearColor = Color.green; public Color clearColor = Color.green;
private LineRenderer lineRenderer; private LineRenderer lineRenderer;
[HideInInspector] [HideInInspector] private SpriteRenderer spriteRenderer;
private SpriteRenderer spriteRenderer; [HideInInspector] public float spriteWidth;
[HideInInspector] [HideInInspector] public float spriteHeight;
public float spriteWidth; [HideInInspector] public float[] waveformData;
[HideInInspector]
public float spriteHeight;
[HideInInspector]
public float[] waveformData;
private float[] noiseData; private float[] noiseData;
[HideInInspector] [HideInInspector] public float[] displayData;
public float[] displayData;
private float[] antiWaveformData; private float[] antiWaveformData;
public int SpikeIndex => spikeIndex; // 使 spikeIndex 可通过属性访问 public int SpikeIndex => spikeIndex; // 使 spikeIndex 可通过属性访问
[HideInInspector] [HideInInspector] public WaveformType waveformType = WaveformType.Sine;
public WaveformType waveformType = WaveformType.Sine;
public float amplitudeModulationFrequency = 0.5f; public float amplitudeModulationFrequency = 0.5f;
public float amplitudeModulationDepth = 0.5f; public float amplitudeModulationDepth = 0.5f;
@@ -58,18 +48,17 @@ public class WaveformVisualizer : MonoBehaviour
private bool isCaptured = false; // 是否已拍照(冻结波形) private bool isCaptured = false; // 是否已拍照(冻结波形)
private int spikeIndex; // 单个突刺位置 private int spikeIndex; // 单个突刺位置
private bool isCorrect=true; private bool isCorrect = true;
private bool isSpikeIndexSet = false; // 标志位,判断 spikeIndex 是否已设置 private bool isSpikeIndexSet = false; // 标志位,判断 spikeIndex 是否已设置
private TargetPointData targetdata; private TargetPointData targetdata;
public bool isErrorFind=false; public bool isErrorFind = false;
private LineRenderer scanLineRenderer; // 新的 LineRenderer private LineRenderer scanLineRenderer; // 新的 LineRenderer
public float scanSpeed = 1f; // 扫描速度 public float scanSpeed = 1f; // 扫描速度
private bool isScanning = false; // 是否正在扫描 private bool isScanning = false; // 是否正在扫描
void Start() void Start()
{ {
lineRenderer = GetComponent<LineRenderer>(); lineRenderer = GetComponent<LineRenderer>();
@@ -100,34 +89,36 @@ public class WaveformVisualizer : MonoBehaviour
void Update() void Update()
{ {
GenerateNoiseData(); GenerateNoiseData();
GenerateWaveformData(); GenerateWaveformData();
if (phaseShift > 0)
{
GenerateAntiWaveformData();
}
for (int i = 0; i < samples; i++)
{
displayData[i] = Mathf.Lerp(noiseData[i], waveformData[i], clarity);
if (phaseShift > 0) if (phaseShift > 0)
{ {
GenerateAntiWaveformData(); displayData[i] += antiWaveformData[i];
} }
for (int i = 0; i < samples; i++) if (!isCorrect)
{ {
displayData[i] = Mathf.Lerp(noiseData[i], waveformData[i], clarity); HandleErrorDisplay(i);
if (phaseShift > 0)
{
displayData[i] += antiWaveformData[i];
}
if (!isCorrect)
{
HandleErrorDisplay(i);
}
displayData[i] = Mathf.Clamp(displayData[i], -spriteHeight / 1.8f, spriteHeight / 1.8f);
} }
if(!isCorrect)
{ displayData[i] = Mathf.Clamp(displayData[i], -spriteHeight / 1.8f, spriteHeight / 1.8f);
CheckError(); }
}
if (!isCorrect)
DrawWaveform(); {
CheckError();
}
DrawWaveform();
} }
void GenerateNoiseData() void GenerateNoiseData()
@@ -146,112 +137,116 @@ public class WaveformVisualizer : MonoBehaviour
float t = (float)i / samples; float t = (float)i / samples;
waveformData[i] = GetWaveformValue(t, 0) * clarity; waveformData[i] = GetWaveformValue(t, 0) * clarity;
} }
if(!isCorrect)
if (!isCorrect)
{ {
GenerateErrorData(); GenerateErrorData();
} }
}
private void GenerateErrorData()
{
if (targetdata.spikeIndex != -1)
{
spikeIndex = targetdata.spikeIndex;
return;
}
if (isSpikeIndexSet) return; // 如果已设置,则不再随机
float threshold = 0.9f; // 80% 的阈值
// 找到波形数据中的最大绝对值
float maxAmplitude = 0f;
for (int i = 0; i < samples; i++)
{
maxAmplitude = Mathf.Max(maxAmplitude, Mathf.Abs(waveformData[i]));
} }
// 计算超过 80% 最大值的阈值 private void GenerateErrorData()
float amplitudeThreshold = maxAmplitude * threshold;
// 找到所有超过阈值的点
List<int> candidateIndices = new List<int>();
for (int i = 0; i < samples; i++)
{ {
if (Mathf.Abs(waveformData[i]) > amplitudeThreshold) if (targetdata.spikeIndex != -1)
{ {
candidateIndices.Add(i); spikeIndex = targetdata.spikeIndex;
return;
}
if (isSpikeIndexSet) return; // 如果已设置,则不再随机
float threshold = 0.9f; // 80% 的阈值
// 找到波形数据中的最大绝对值
float maxAmplitude = 0f;
for (int i = 0; i < samples; i++)
{
maxAmplitude = Mathf.Max(maxAmplitude, Mathf.Abs(waveformData[i]));
}
// 计算超过 80% 最大值的阈值
float amplitudeThreshold = maxAmplitude * threshold;
// 找到所有超过阈值的点
List<int> candidateIndices = new List<int>();
for (int i = 0; i < samples; i++)
{
if (Mathf.Abs(waveformData[i]) > amplitudeThreshold)
{
candidateIndices.Add(i);
}
}
// 随机选择一个满足条件的点作为 spikeIndex
if (candidateIndices.Count > 0)
{
int randomIndex = Random.Range(0, candidateIndices.Count);
spikeIndex = candidateIndices[randomIndex];
isSpikeIndexSet = true; // 标志位设为 true,表示已设置过 spikeIndex
}
else
{
spikeIndex = 0; // 如果没有找到满足条件的点,则默认为 0
isSpikeIndexSet = true; // 即使没有找到满足条件的点,也将标志位设为 true
}
if (targetdata != null)
{
targetdata.spikeIndex = spikeIndex;
} }
} }
// 随机选择一个满足条件的点作为 spikeIndex
if (candidateIndices.Count > 0)
{
int randomIndex = Random.Range(0, candidateIndices.Count);
spikeIndex = candidateIndices[randomIndex];
isSpikeIndexSet = true; // 标志位设为 true,表示已设置过 spikeIndex
}
else
{
spikeIndex = 0; // 如果没有找到满足条件的点,则默认为 0
isSpikeIndexSet = true; // 即使没有找到满足条件的点,也将标志位设为 true
}
if (targetdata != null)
{
targetdata.spikeIndex = spikeIndex;
}
}
public void SetError(TargetPointData target) public void SetError(TargetPointData target)
{ {
isCorrect=false; isCorrect = false;
targetdata=target; targetdata = target;
} }
float GetWaveformValue(float t, float phaseOffset)
{
float time = Time.time * temporalFrequency;
//float amplitudeModulation = 1f + amplitudeModulationDepth * Mathf.Sin(2f * Mathf.PI * amplitudeModulationFrequency * Time.time);
float angle = t * Mathf.PI * 2f * spatialFrequency + phaseOffset;
float value = 0f; float GetWaveformValue(float t, float phaseOffset)
// 计算波形值
switch (waveformType)
{ {
case WaveformType.Sine: float time = Time.time * temporalFrequency;
value = Mathf.Sin(angle); //float amplitudeModulation = 1f + amplitudeModulationDepth * Mathf.Sin(2f * Mathf.PI * amplitudeModulationFrequency * Time.time);
break; float angle = t * Mathf.PI * 2f * spatialFrequency + phaseOffset;
case WaveformType.Square:
value = Mathf.Sign(Mathf.Sin(angle)); float value = 0f;
break;
case WaveformType.Triangle: // 计算波形值
value = Mathf.PingPong(angle / Mathf.PI, 1f) * 2f - 1f; switch (waveformType)
break; {
case WaveformType.Sawtooth: case WaveformType.Sine:
value = ((angle / (Mathf.PI * 2f)) % 1f) * 2f - 1f; // 统一周期为 2π value = Mathf.Sin(angle);
break; break;
case WaveformType.Pulse: case WaveformType.Square:
value = Mathf.PingPong(angle / (Mathf.PI * 2f), 1f) > 0.5f ? 1f : -1f; // 统一周期为 2π value = Mathf.Sign(Mathf.Sin(angle));
break; break;
case WaveformType.Noise: case WaveformType.Triangle:
value = Mathf.PerlinNoise(angle / (Mathf.PI * 2f), Time.time * temporalFrequency) * 2f - 1f; // 统一周期为 2π value = Mathf.PingPong(angle / Mathf.PI, 1f) * 2f - 1f;
break; break;
case WaveformType.Composite: case WaveformType.Sawtooth:
value = Mathf.Sin(angle) + Mathf.Sin(angle * 2f) * 0.5f; // 组合波形也统一周期 value = ((angle / (Mathf.PI * 2f)) % 1f) * 2f - 1f; // 统一周期为 2π
break; break;
default: case WaveformType.Pulse:
value = 0f; value = Mathf.PingPong(angle / (Mathf.PI * 2f), 1f) > 0.5f ? 1f : -1f; // 统一周期为 2π
break; break;
case WaveformType.Noise:
value = Mathf.PerlinNoise(angle / (Mathf.PI * 2f), Time.time * temporalFrequency) * 2f - 1f; // 统一周期为 2π
break;
case WaveformType.Composite:
value = Mathf.Sin(angle) + Mathf.Sin(angle * 2f) * 0.5f; // 组合波形也统一周期
break;
default:
value = 0f;
break;
}
return value * amplitude; // 最终返回波形值
//return value * amplitude * amplitudeModulation; // 最终返回波形值
} }
return value * amplitude; // 最终返回波形值 private void HandleErrorDisplay(int index)
//return value * amplitude * amplitudeModulation; // 最终返回波形值 {
} float amplitudeScale = Mathf.Lerp(0.2f, 1f, clarity);
private void HandleErrorDisplay(int index) int distanceToSpike = Mathf.Abs(spikeIndex - index);
{ if (distanceToSpike <= 20) // 扩大扰动的半径
float amplitudeScale = Mathf.Lerp(0.2f, 1f, clarity);
int distanceToSpike = Mathf.Abs(spikeIndex - index);
if (distanceToSpike <= 20) // 扩大扰动的半径
{ {
float attenuation = 1f - (float)distanceToSpike / 20f; float attenuation = 1f - (float)distanceToSpike / 20f;
attenuation *= 0.9f; // 降低扰动强度 attenuation *= 0.9f; // 降低扰动强度
@@ -259,19 +254,20 @@ private void HandleErrorDisplay(int index)
float randomRange = (Mathf.Abs(baseAmplitude) - amplitude / 3f) * attenuation; float randomRange = (Mathf.Abs(baseAmplitude) - amplitude / 3f) * attenuation;
//isErrorFind = Mathf.Abs(baseAmplitude) < amplitude / 3; //isErrorFind = Mathf.Abs(baseAmplitude) < amplitude / 3;
if (Mathf.Abs(baseAmplitude) < amplitude / 3) if (Mathf.Abs(baseAmplitude) < amplitude / 3)
{ {
float randomOffset = Random.Range(-randomRange, randomRange); float randomOffset = Random.Range(-randomRange, randomRange);
displayData[index] += randomOffset; // 对 Y 值进行随机扰动 displayData[index] += randomOffset; // 对 Y 值进行随机扰动
} }
//displayData[index] += Random.Range(-attenuation * 0.5f, attenuation * 0.5f); // 添加随机扰动 //displayData[index] += Random.Range(-attenuation * 0.5f, attenuation * 0.5f); // 添加随机扰动
} }
} }
private void CheckError()
{ private void CheckError()
isErrorFind=displayData[spikeIndex]<amplitude / 3f; {
} isErrorFind = displayData[spikeIndex] < amplitude / 3f;
}
void GenerateAntiWaveformData() void GenerateAntiWaveformData()
@@ -282,43 +278,45 @@ private void CheckError()
antiWaveformData[i] = -GetWaveformValue(t, phaseShift) * clarity; antiWaveformData[i] = -GetWaveformValue(t, phaseShift) * clarity;
} }
} }
void DrawWaveform()
{ void DrawWaveform()
for (int i = 0; i < samples; i++)
{ {
float x = ((float)i / (samples - 1)) * spriteWidth - (spriteWidth / 2f); for (int i = 0; i < samples; i++)
float amplitudeScale = Mathf.Lerp(0.2f, 1f, clarity); {
float x = ((float)i / (samples - 1)) * spriteWidth - (spriteWidth / 2f);
// 获取波形值 float amplitudeScale = Mathf.Lerp(0.2f, 1f, clarity);
float y = displayData[i] * amplitudeScale * (spriteHeight / 2f);
Vector3 position = new Vector3(x, y, 0); // 获取波形值
lineRenderer.SetPosition(i, position); float y = displayData[i] * amplitudeScale * (spriteHeight / 2f);
Vector3 position = new Vector3(x, y, 0);
lineRenderer.SetPosition(i, position);
}
Color waveColor = Color.Lerp(noiseColor, clearColor, clarity);
lineRenderer.startColor = waveColor;
lineRenderer.endColor = waveColor;
float startWidth = Mathf.Lerp(0.02f, 0.05f, clarity);
lineRenderer.startWidth = startWidth;
lineRenderer.endWidth = startWidth;
} }
Color waveColor = Color.Lerp(noiseColor, clearColor, clarity);
lineRenderer.startColor = waveColor;
lineRenderer.endColor = waveColor;
float startWidth = Mathf.Lerp(0.02f, 0.05f, clarity);
lineRenderer.startWidth = startWidth;
lineRenderer.endWidth = startWidth;
}
// 应用相位偏移 // 应用相位偏移
public void SetPhaseShift(float phaseShiftValue) public void SetPhaseShift(float phaseShiftValue)
{ {
phaseShift = phaseShiftValue; phaseShift = phaseShiftValue;
} }
// 重置波形 // 重置波形
public void ResetWaveform() public void ResetWaveform()
{ {
isCaptured = false; isCaptured = false;
phaseShift = 0f; phaseShift = 0f;
spikeIndex=0; spikeIndex = 0;
isCorrect=true; isCorrect = true;
isSpikeIndexSet = false; isSpikeIndexSet = false;
targetdata=null; targetdata = null;
isErrorFind=false; isErrorFind = false;
} }
} }
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e28cf9e49aab76345a08055d630645da
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+55
View File
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AibisDream.FixSystem
{
public class BodyModule : MonoBehaviour
{
#region
private const string ModulePicObjName = "Module Pic";
private const string SocketObjName = "Socket";
private GameObject _modulePic;
public Socket Socket { get; private set; }
#endregion
public Vector3 SocketPos => Socket.transform.position;
// 模块基本数据
[SerializeField]
public BodyModuleData moduleData;
private void Awake()
{
// 获取组件索引
InitReference();
}
private void InitReference()
{
_modulePic = transform.Find(ModulePicObjName).gameObject;
Socket = transform.Find(SocketObjName).GetComponent<Socket>();
}
}
[Serializable]
public struct BodyModuleData
{
public WaveformType waveformType;
public EyeTransitionManager.ViewState viewState;
public int cameraSize;
public Vector2 cameraPos;
public string audioName;
public string soundName;
public List<string> modulePicList;
public Vector3 modulePos;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 485fe5a69106f8146a3ef9ca070f306d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,98 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace AibisDream.FixSystem
{
public class BodyModuleSystem : MonoBehaviour
{
public BodyModule[] BodyModules { get; private set; }
public CableSystem CableSystem { get; private set; }
#region
public UnityEvent<Socket> PlugInEvent => CableSystem.plugInEvent;
public UnityEvent<Socket> PlugOutEvent => CableSystem.plugOutEvent;
public UnityEvent PlugStartDrag => CableSystem.plugStartDrag;
public UnityEvent PlugEndDrag => CableSystem.plugEndDrag;
#endregion
[SerializeField]
public BodyModuleSystemConfig config = BodyModuleSystemConfig.GeneDefaultConfig();
private void Awake()
{
InitComponentRefs();
}
private void InitComponentRefs()
{
BodyModules = transform.GetComponentsInChildren<BodyModule>();
CableSystem = transform.Find("Cable System").GetComponent<CableSystem>();
}
/// <summary>
/// 寻找最接近的Module
/// </summary>
/// <param name="sourcePos">源位置</param>
/// <param name="targetModule">最近的Module</param>
/// <returns>是否能找到目标范围内的Module</returns>
public bool TryFindClosestSocket(Vector3 sourcePos, out BodyModule targetModule)
{
var closestDistance = Mathf.Infinity;
BodyModule closestModule = null;
// 寻找最接近的BodyModule
foreach (var bodyModule in BodyModules)
{
float tempDistance = Vector3.Distance(sourcePos, bodyModule.SocketPos);
if (tempDistance < closestDistance)
{
closestDistance = tempDistance;
closestModule = bodyModule;
}
}
// 判断距离是否在目标范围内,在的话就返回,不在的话返回个空的
if (closestDistance < config.plugSnappingRange && closestModule)
{
targetModule = closestModule;
return true;
}
else
{
targetModule = null;
return false;
}
}
/// <summary>
/// 插线系统是否插在插槽里
/// </summary>
/// <returns></returns>
public bool IsPlugInSocket()
{
return CableSystem.curSocket != null;
}
[Serializable]
public struct BodyModuleSystemConfig
{
public float plugSnappingRange;
public static BodyModuleSystemConfig GeneDefaultConfig()
{
return new BodyModuleSystemConfig
{
plugSnappingRange = 1f
};
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9290bcfb4cf7b6846b60dcd0851a5091
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+123
View File
@@ -0,0 +1,123 @@
using System;
using UnityEngine;
namespace AibisDream.FixSystem
{
[RequireComponent(typeof(LineRenderer))]
public class Cable : MonoBehaviour
{
private Transform _start;
private Transform _end;
private LineRenderer _lineRenderer;
private Vector3[] _points;
private CableSystem _cableSystem;
[SerializeField]
private CableConfig config = CableConfig.GeneDefaultConfig();
private void Start()
{
InitComponentRefs();
InitPoints();
}
private void InitComponentRefs()
{
_cableSystem = transform.parent.GetComponent<CableSystem>();
_lineRenderer = GetComponent<LineRenderer>();
_lineRenderer.positionCount = config.resolution;
// 连线起止点
_start = _cableSystem.CableRootPos;
_end = _cableSystem.PlugRef.transform;
}
private void InitPoints()
{
_points = new Vector3[config.resolution];
for (int i = 0; i < config.resolution; i++)
{
float t = i / (float)(config.resolution - 1);
_points[i] = Vector3.Lerp(_start.position, _end.position, t);
}
}
private void FixedUpdate()
{
DrawLine();
}
void DrawLine()
{
var points = UpdateRope();
for (int i = 0; i < config.resolution; i++)
{
_lineRenderer.SetPosition(i, points[i] + Vector3.forward * -.3f);
}
}
Vector3[] UpdateRope()
{
float t = Mathf.InverseLerp(config.dstMin, config.dstMax, (_start.position - _end.position).magnitude);
float F = Mathf.Lerp(config.forceMin, config.forceMax, t);
_points[0] = _start.position;
_points[^1] = _end.position;
for (int ik = 0; ik < config.k; ik++)
{
for (int i = 1; i < _points.Length - 1; i++)
{
Vector3 offsetPrev = _points[i - 1] - _points[i];
Vector3 offsetNext = _points[i + 1] - _points[i];
Vector3 velocity = offsetPrev.normalized * (offsetPrev.magnitude * F) +
offsetNext.normalized * (offsetNext.magnitude * F);
_points[i] += velocity * Time.deltaTime / config.k;
}
for (int i = 1; i < _points.Length - 1; i++)
{
_points[i] += Vector3.down * (9.8f * Time.deltaTime) / config.k;
}
}
return _points;
}
/// <summary>
/// 为线缆设置末端点
/// </summary>
/// <param name="endPos">末端点</param>
public void SetEndPos(Transform endPos)
{
_end = endPos;
}
}
[Serializable]
public struct CableConfig
{
public int resolution;
public float dstMin;
public float dstMax;
public float forceMin;
public float forceMax;
public int k;
public static CableConfig GeneDefaultConfig()
{
return new CableConfig()
{
resolution = 10,
dstMin = 0.1f,
dstMax = 1.0f,
forceMin = 0.1f,
forceMax = 150f,
k = 10
};
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ae3259f7b7344d67800eb8718a16dcc4
timeCreated: 1730993890
+126
View File
@@ -0,0 +1,126 @@
using System;
using UnityEngine;
using UnityEngine.Events;
using Yarn.Unity;
namespace AibisDream.FixSystem
{
public class CableSystem : MonoBehaviour
{
#region
public Plug PlugRef { get; private set; }
public Cable CableRef { get; private set; }
public Transform CableRootPos { get; private set; }
public Socket InitSocket { get; private set; }
public BodyModuleSystem BodyModuleSystem { get; private set; }
private BodyModule[] _bodyModules;
#endregion
#region
public bool isInDialog = false;
public bool isActive = true;
[HideInInspector] public Socket curSocket;
#endregion
#region
public UnityEvent<Socket> plugInEvent;
public UnityEvent<Socket> plugOutEvent;
public UnityEvent plugStartDrag;
public UnityEvent plugEndDrag;
#endregion
public Vector3 InitSocketPos => InitSocket.transform.position;
private void Awake()
{
InitComponentRefs();
}
private void Start()
{
InitSystem();
}
private void OnEnable()
{
DialogController.OnDialogueStart += HandleDialogueStart;
DialogController.OnDialogueComplete += HandleDialogueComplete;
}
private void OnDisable()
{
DialogController.OnDialogueStart -= HandleDialogueStart;
DialogController.OnDialogueComplete -= HandleDialogueComplete;
}
private void InitComponentRefs()
{
PlugRef = transform.Find("Plug").GetComponent<Plug>();
CableRef = transform.Find("Cable").GetComponent<Cable>();
CableRootPos = transform.Find("Cable Root Pos").transform;
InitSocket = transform.Find("Init Socket").GetComponent<Socket>();
BodyModuleSystem = transform.parent.GetComponent<BodyModuleSystem>();
}
private void InitSystem()
{
PlugRef.InitPlug(InitSocket);
}
/// <summary>
/// 寻找最接近的Module
/// </summary>
/// <param name="sourcePos">源位置</param>
/// <param name="targetModule">最近的Module</param>
/// <returns>是否能找到目标范围内的Module</returns>
public bool TryFindClosestSocket(Vector3 sourcePos, out BodyModule targetModule)
{
return BodyModuleSystem.TryFindClosestSocket(sourcePos, out targetModule);
}
#region
private void HandleDialogueStart()
{
isInDialog = true;
}
private void HandleDialogueComplete()
{
isInDialog = false;
}
[YarnCommand("Disable_plugInput")]
public void Disable_plugInput()
{
isActive = false;
}
[YarnCommand("Enable_plugInput")]
public void Enable_plugInput()
{
isActive = true;
}
/// <summary>
/// 查询插线系统是否可用
/// </summary>
/// <returns></returns>
public bool IsPlugAvailable()
{
return isActive && !isInDialog;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 587f3ee69d7c47d291e4e488f9ca3090
timeCreated: 1731039298
@@ -0,0 +1,31 @@
using UnityEngine;
namespace AibisDream.FixSystem
{
public class OscilloscopeSystem : MonoBehaviour
{
#region
private OscilloscopeViewer _oscilloscopeViewer;
private BodyModuleSystem _bodyModuleSystem;
#endregion
public void InitComponentRefs()
{
_oscilloscopeViewer = transform.Find("Oscilloscope Viewer").GetComponent<OscilloscopeViewer>();
}
public void DeepIn()
{
// 插线系统不正常就返回
if (!_bodyModuleSystem.IsPlugInSocket())
{
_oscilloscopeViewer.ShowScreenMessage("未插入任何目标模块");
return;
}
//
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a2e20b111511460a8f3a151bd470da9d
timeCreated: 1731328037
@@ -0,0 +1,92 @@
using System;
using TMPro;
using UnityEngine;
namespace AibisDream.FixSystem
{
public class OscilloscopeViewer : MonoBehaviour
{
private const float PhaseShiftMax = Mathf.PI * 1.5f;
private const float ScanSpeed = 2f;
#region
private WaveformVisualizer _waveformVisualizerRef;
private LineRenderer _scanLineRef;
private TMP_Text _screenText;
private BodyModuleSystem _bodyModuleSystem;
#endregion
private void Awake()
{
InitComponentRefs();
}
/// <summary>
/// 初始化组件索引
/// </summary>
private void InitComponentRefs()
{
_waveformVisualizerRef = transform.Find("Waveform Visualizer").GetComponent<WaveformVisualizer>();
_scanLineRef = transform.Find("Scan Line").GetComponent<LineRenderer>();
_screenText = transform.Find("Screen Message").GetComponent<TMP_Text>();
// TODO System这种组件可以搞一个IOC容器来访问
_bodyModuleSystem = FindObjectOfType<BodyModuleSystem>();
// 对部分值进行初始化
_scanLineRef.startWidth = 0.05f;
_scanLineRef.endWidth = 0.05f;
_scanLineRef.gameObject.SetActive(false);
_screenText.text = "";
}
/// <summary>
/// 显示消息
/// </summary>
/// <param name="message"></param>
public void ShowScreenMessage(string message)
{
_screenText.text = message;
}
/// <summary>
/// 清除消息
/// </summary>
public void ClearScreenMessage()
{
_screenText.text = "";
}
#region
private void OnEnable()
{
RegisterEvent();
}
private void OnDisable()
{
UnregisterEvent();
}
private void RegisterEvent()
{
// TODO 当前是靠Plug触发事件的,但我觉得应该由Socket触发
// _bodyModuleSystem.PlugInEvent.AddListener(OnPlugInEvent);
// _bodyModuleSystem.PlugOutEvent.AddListener(OnPlugOutEvent);
}
private void UnregisterEvent()
{
// TODO 当前是靠Plug触发事件的,但我觉得应该由Socket触发
// _bodyModuleSystem.PlugInEvent.RemoveListener(OnPlugInEvent);
// _bodyModuleSystem.PlugOutEvent.RemoveListener(OnPlugOutEvent);
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d3e8630f1e6849dd82fa2df4def283da
timeCreated: 1731314656
+145
View File
@@ -0,0 +1,145 @@
using AibisDream.Utility;
using DG.Tweening;
using UnityEngine;
using UnityEngine.EventSystems;
namespace AibisDream.FixSystem
{
public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler
{
#region
private Vector3 _startPos;
private Vector3 _startRotate;
private readonly Vector3 _pickupOffset = new(0, 0, 0);
private readonly Quaternion _pickupRotationOffset = Quaternion.Euler(0, 0, 30);
#endregion
#region
private CableSystem _cableSystem;
private SpriteRenderer _sprite;
#endregion
private bool _isDragging;
private void Awake()
{
InitComponentRef();
}
private void InitComponentRef()
{
_cableSystem = transform.parent.GetComponent<CableSystem>();
_sprite = GetComponent<SpriteRenderer>();
}
public void InitPlug(Socket initSocket)
{
InsertSocket(initSocket);
}
/// <summary>
/// 插入某个socket
/// </summary>
/// <param name="targetSocket">目标socket</param>
private void InsertSocket(Socket targetSocket)
{
// 修改插头位置
transform.position = targetSocket.transform.position;
_cableSystem.CableRef.SetEndPos(transform);
// 处理插槽插入
targetSocket.PlugIn();
AudioManager.RandomPlayInteraction("plug_in");
_sprite.enabled = false;
// 触发事件
_cableSystem.plugInEvent?.Invoke(targetSocket);
_cableSystem.curSocket = targetSocket;
}
/// <summary>
/// 从某个Socket拔出来
/// </summary>
private void PullUpSocket()
{
_cableSystem.curSocket?.PlugOut();
AudioManager.RandomPlayInteraction("plug_out");
_sprite.enabled = true;
_cableSystem.curSocket = null;
// 触发事件
_cableSystem.plugOutEvent?.Invoke(_cableSystem.curSocket);
}
public void OnDrag(PointerEventData eventData)
{
// 系统被锁定就返回
if (!_cableSystem.IsPlugAvailable()) return;
// 未被拖拽也返回
if (!_isDragging) return;
// 这一行感觉不需要,毕竟传递的是引用
// _cableSystem.CableRef.SetEndPos(transform);
transform.position = CommonUtil.GetMouseWorldPos(eventData.position, transform);
}
public void OnPointerDown(PointerEventData eventData)
{
// 系统被锁定就返回
if (!_cableSystem.IsPlugAvailable()) return;
// 开启拖拽
_isDragging = true;
// 进行插拔动作
if (_cableSystem.curSocket) PullUpSocket();
_cableSystem.plugStartDrag?.Invoke();
// 调整插头形状
AdjustPlugPos();
}
public void OnPointerUp(PointerEventData eventData)
{
// 系统被锁定就返回
if (!_cableSystem.IsPlugAvailable()) return;
// 停止拖拽
_isDragging = false;
// 寻找可吸附的Module
if (_cableSystem.TryFindClosestSocket(transform.position, out var targetModule))
{
// 找到了就插入目标Module
InsertSocket(targetModule.Socket);
_cableSystem.plugEndDrag?.Invoke();
}
else
{
// 没找到就插回初始Socket,需要播动画
transform.DOMove(_cableSystem.InitSocketPos, 0.1f).OnComplete(() =>
{
InsertSocket(_cableSystem.InitSocket);
_cableSystem.plugEndDrag?.Invoke();
});
}
}
private void AdjustPlugPos()
{
transform.position += _pickupOffset;
transform.rotation = _pickupRotationOffset;
}
void OnDrawGizmosSelected()
{
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(transform.position, 0.5f);
}
}
}
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eceaf3bcec07439d8391175331323e3c
timeCreated: 1731043337
+30
View File
@@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AibisDream.FixSystem
{
public interface ISocket
{
public bool IsAvailable { get; }
public void PlugIn();
public void PlugOut();
}
public class Socket : MonoBehaviour, ISocket
{
public bool IsAvailable { get; private set; }
public void PlugIn()
{
Debug.Log("Plug In");
}
public void PlugOut()
{
Debug.Log("Plug Out");
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14ffdfdc63be167489dc01c0b661c1ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
<<<<<<<< HEAD:Assets/Scripts/Framework/LifeCycle.meta <<<<<<<< HEAD:Assets/Scripts/Framework/LifeCycle.meta
guid: 3e1e2a81dd2780b4694d103dddd3a53e guid: e83cc72ae645d204ba5edddce2e36596
folderAsset: yes folderAsset: yes
======== ========
guid: 39db4a518afdbd74f8c0100de0f68c74 guid: 39db4a518afdbd74f8c0100de0f68c74
+17
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
namespace AibisDream.Utility namespace AibisDream.Utility
{ {
@@ -8,6 +9,8 @@ namespace AibisDream.Utility
{ {
private const float Epsilon = 1e-5f; private const float Epsilon = 1e-5f;
private static Camera _mainCam;
/// <summary> /// <summary>
/// 判断为0 /// 判断为0
/// </summary> /// </summary>
@@ -59,6 +62,20 @@ namespace AibisDream.Utility
_ => targetOil _ => targetOil
}; };
} }
/// <summary>
/// 获取鼠标在世界中的位置
/// </summary>
/// <param name="mousePoint">鼠标界面位置</param>
/// <param name="transform">物体形状</param>
/// <returns>世界位置</returns>
public static Vector3 GetMouseWorldPos(Vector3 mousePoint, Transform transform)
{
if (!_mainCam) _mainCam = Camera.main;
mousePoint.z = _mainCam.WorldToScreenPoint(transform.position).z;
return _mainCam.ScreenToWorldPoint(mousePoint);
}
} }
} }