босс
This commit is contained in:
1 parent
76b6566e46
commit
11d290d572
49 files changed
+2562
-587
No files matched your search
+3
-3
@@ -162,9 +162,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
+3
-3
@@ -144,9 +144,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition2: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition3: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
+3
-3
@@ -147,9 +147,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition2: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition3: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
+3
-3
@@ -162,9 +162,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
+3
-3
@@ -149,9 +149,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
+3
-3
@@ -148,9 +148,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition2: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition3: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
@@ -110,9 +110,9 @@ Material:
|
||||
- _Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
|
||||
@@ -87,9 +87,9 @@ Material:
|
||||
- _BaseColor: {r: 0.015, g: 0.015, b: 0.02, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition2: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _EchoPosition3: {r: 0.8146084, g: 1.18, b: 30.06276, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7af213749bf7d8545a574025643ac52f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+12
-408
@@ -272,81 +272,6 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 640, y: 220}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &28648154
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 28648155}
|
||||
- component: {fileID: 28648157}
|
||||
- component: {fileID: 28648156}
|
||||
m_Layer: 0
|
||||
m_Name: Crosshair_H
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &28648155
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 28648154}
|
||||
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: 476238123}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 220, y: 1.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &28648156
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 28648154}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.85, b: 0.1, a: 0.25}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &28648157
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 28648154}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &49175960
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1315,81 +1240,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 359650858}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &369535200
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 369535201}
|
||||
- component: {fileID: 369535203}
|
||||
- component: {fileID: 369535202}
|
||||
m_Layer: 0
|
||||
m_Name: Radar_BeaconDot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &369535201
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 369535200}
|
||||
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: 476238123}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 14, y: 14}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &369535202
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 369535200}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.92, b: 0.2, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &369535203
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 369535200}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &380986619
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1682,12 +1532,7 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2124938209}
|
||||
- {fileID: 1573194001}
|
||||
- {fileID: 28648155}
|
||||
- {fileID: 2100556429}
|
||||
- {fileID: 369535201}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1908515134}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
@@ -1707,17 +1552,17 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 27669377a9e37834c888101dec6dc187, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::MenuEcholocationRadar
|
||||
maxSimultaneousWaves: 4
|
||||
waveMaxRadius: 1600
|
||||
waveSpeed: 240
|
||||
waveSpawnInterval: 1.7
|
||||
initialThickness: 14
|
||||
maxThickness: 52
|
||||
waveBaseColor: {r: 1, g: 0.85, b: 0.1, a: 0.85}
|
||||
waveCoreColor: {r: 1, g: 0.98, b: 0.55, a: 1}
|
||||
beaconColor: {r: 1, g: 0.88, b: 0.15, a: 1}
|
||||
radarBeaconDot: {fileID: 369535202}
|
||||
radarReticle: {fileID: 2124938211}
|
||||
maxSimultaneousWaves: 3
|
||||
waveMaxRadius: 1800
|
||||
waveSpeed: 180
|
||||
waveSpawnInterval: 2.4
|
||||
initialThickness: 110
|
||||
maxThickness: 360
|
||||
waveBaseColor: {r: 1, g: 0.82, b: 0.18, a: 0.4}
|
||||
waveCoreColor: {r: 1, g: 0.94, b: 0.5, a: 0.65}
|
||||
beaconColor: {r: 1, g: 0.88, b: 0.2, a: 0.85}
|
||||
radarBeaconDot: {fileID: 0}
|
||||
radarReticle: {fileID: 0}
|
||||
--- !u!1 &479211098
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5508,81 +5353,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1559811256}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1573194000
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1573194001}
|
||||
- component: {fileID: 1573194003}
|
||||
- component: {fileID: 1573194002}
|
||||
m_Layer: 0
|
||||
m_Name: Radar_ReticleInner
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1573194001
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1573194000}
|
||||
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: 476238123}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 90, y: 90}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1573194002
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1573194000}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.85, b: 0.1, a: 0.08}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1573194003
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1573194000}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1593550058
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -7844,81 +7614,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2094966548}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2100556428
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2100556429}
|
||||
- component: {fileID: 2100556431}
|
||||
- component: {fileID: 2100556430}
|
||||
m_Layer: 0
|
||||
m_Name: Crosshair_V
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2100556429
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100556428}
|
||||
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: 476238123}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1.5, y: 220}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2100556430
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100556428}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.85, b: 0.1, a: 0.25}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &2100556431
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100556428}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2119819752
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -8009,97 +7704,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2119819752}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2124938208
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2124938209}
|
||||
- component: {fileID: 2124938212}
|
||||
- component: {fileID: 2124938211}
|
||||
- component: {fileID: 2124938210}
|
||||
m_Layer: 0
|
||||
m_Name: Radar_ReticleOuter
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2124938209
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2124938208}
|
||||
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: 476238123}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 180, y: 180}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2124938210
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2124938208}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Outline
|
||||
m_EffectColor: {r: 1, g: 0.85, b: 0.1, a: 0.35}
|
||||
m_EffectDistance: {x: 1.5, y: -1.5}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!114 &2124938211
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2124938208}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0.85, b: 0.1, a: 0.2}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &2124938212
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2124938208}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2126875622
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,139 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Токсичная лужа ядовитой слизи босса, оставшаяся после попадания плевка.
|
||||
/// Наносит периодический урон игроку при нахождении в зоне поражения и шипит.
|
||||
/// </summary>
|
||||
public class AcidPool : MonoBehaviour
|
||||
{
|
||||
public float damagePerSecond = 5f;
|
||||
public float lifetime = 4.5f;
|
||||
public float radius = 0.85f;
|
||||
|
||||
private float timer = 0f;
|
||||
private PlayerHealth playerInPool = null;
|
||||
private Light poolLight;
|
||||
private System.Collections.Generic.List<Transform> visualSplatterPieces = new System.Collections.Generic.List<Transform>();
|
||||
|
||||
public static AcidPool Create(Vector3 position, float poolLifetime = 4.5f, float poolRadius = 0.85f)
|
||||
{
|
||||
GameObject go = new GameObject("Acid_Saliva_Splatter");
|
||||
go.transform.position = position;
|
||||
|
||||
AcidPool pool = go.AddComponent<AcidPool>();
|
||||
pool.lifetime = poolLifetime;
|
||||
pool.radius = poolRadius;
|
||||
return pool;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Сферический триггер для обнаружения игрока
|
||||
SphereCollider sc = gameObject.AddComponent<SphereCollider>();
|
||||
sc.isTrigger = true;
|
||||
sc.radius = radius;
|
||||
|
||||
// Кислотно-зеленый токсичный материал слюны: влажный, глянцевый
|
||||
Material salivaMat = new Material(Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Standard"));
|
||||
salivaMat.color = new Color(0.28f, 0.9f, 0.18f, 0.75f);
|
||||
salivaMat.EnableKeyword("_EMISSION");
|
||||
salivaMat.SetColor("_EmissionColor", new Color(0.15f, 0.7f, 0.1f) * 1.1f);
|
||||
if (salivaMat.HasProperty("_Smoothness")) salivaMat.SetFloat("_Smoothness", 0.95f);
|
||||
|
||||
// 1. Центральное влажное пятно слюны (ультратонкое, как реальный след жидкости)
|
||||
GameObject mainPuddle = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
|
||||
mainPuddle.name = "Saliva_Center";
|
||||
mainPuddle.transform.SetParent(transform, false);
|
||||
mainPuddle.transform.localPosition = new Vector3(0f, 0.005f, 0f);
|
||||
mainPuddle.transform.localScale = new Vector3(radius * 0.9f, 0.002f, radius * 0.9f);
|
||||
Destroy(mainPuddle.GetComponent<Collider>());
|
||||
mainPuddle.GetComponent<Renderer>().material = salivaMat;
|
||||
visualSplatterPieces.Add(mainPuddle.transform);
|
||||
|
||||
// 2. Мелкие органические капли-брызги вокруг центра (клякса превращается в естественный всплеск слюны)
|
||||
Vector2[] splashOffsets = new Vector2[]
|
||||
{
|
||||
new Vector2(0.42f, 0.25f),
|
||||
new Vector2(-0.38f, 0.32f),
|
||||
new Vector2(0.15f, -0.45f),
|
||||
new Vector2(-0.42f, -0.22f),
|
||||
new Vector2(0.50f, -0.18f)
|
||||
};
|
||||
|
||||
for (int i = 0; i < splashOffsets.Length; i++)
|
||||
{
|
||||
GameObject splash = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
|
||||
splash.name = $"Saliva_Droplet_{i + 1}";
|
||||
splash.transform.SetParent(transform, false);
|
||||
splash.transform.localPosition = new Vector3(splashOffsets[i].x * radius, 0.005f, splashOffsets[i].y * radius);
|
||||
float dropScale = Random.Range(0.14f, 0.24f) * radius;
|
||||
splash.transform.localScale = new Vector3(dropScale, 0.002f, dropScale * Random.Range(0.85f, 1.35f));
|
||||
Destroy(splash.GetComponent<Collider>());
|
||||
splash.GetComponent<Renderer>().material = salivaMat;
|
||||
visualSplatterPieces.Add(splash.transform);
|
||||
}
|
||||
|
||||
// 3. Мягкий биолюминесцентный свет пятна
|
||||
GameObject lightObj = new GameObject("AcidLight");
|
||||
lightObj.transform.SetParent(transform, false);
|
||||
lightObj.transform.localPosition = new Vector3(0f, 0.15f, 0f);
|
||||
poolLight = lightObj.AddComponent<Light>();
|
||||
poolLight.type = LightType.Point;
|
||||
poolLight.color = new Color(0.3f, 1.0f, 0.2f);
|
||||
poolLight.intensity = 0.75f;
|
||||
poolLight.range = 1.8f;
|
||||
|
||||
// Звук шипения кислоты
|
||||
GameAudioSynthesizer.PlayAcidHiss();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
timer += Time.deltaTime;
|
||||
|
||||
// Нанесение периодического урона игроку в луже
|
||||
if (playerInPool != null)
|
||||
{
|
||||
playerInPool.TakeDamage(damagePerSecond * Time.deltaTime);
|
||||
}
|
||||
|
||||
// Плавное испарение слюны в конце жизни
|
||||
float remaining = lifetime - timer;
|
||||
if (remaining <= 1.0f)
|
||||
{
|
||||
float scaleRatio = Mathf.Clamp01(remaining);
|
||||
foreach (var piece in visualSplatterPieces)
|
||||
{
|
||||
if (piece != null)
|
||||
{
|
||||
piece.localScale = new Vector3(piece.localScale.x * scaleRatio, 0.002f, piece.localScale.z * scaleRatio);
|
||||
}
|
||||
}
|
||||
if (poolLight != null) poolLight.intensity = 0.75f * scaleRatio;
|
||||
}
|
||||
|
||||
if (timer >= lifetime)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player") || other.GetComponentInParent<PlayerMovement>() != null)
|
||||
{
|
||||
playerInPool = other.GetComponentInParent<PlayerHealth>();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player") || other.GetComponentInParent<PlayerMovement>() != null)
|
||||
{
|
||||
if (playerInPool == other.GetComponentInParent<PlayerHealth>())
|
||||
{
|
||||
playerInPool = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b314eae641d5ab440968e39daa5fc032
|
||||
@@ -0,0 +1,192 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Снаряд ядовитого био-плевка Босса. Летит к игроку, при контакте наносит прямой урон,
|
||||
/// создает расширяющуюся акустическую волну эхолокации и оставляет токсичную кислотную лужу.
|
||||
/// </summary>
|
||||
public class AcidProjectile : MonoBehaviour
|
||||
{
|
||||
public float speed = 19f;
|
||||
public float directDamage = 18f;
|
||||
public float maxLifetime = 5f;
|
||||
public bool isMainGlobule = true;
|
||||
|
||||
private Vector3 moveDirection;
|
||||
private float lifeTimer = 0f;
|
||||
private bool hasImpacted = false;
|
||||
|
||||
public static AcidProjectile Spawn(Vector3 startPos, Vector3 targetPos, float projSpeed = 19f, float damage = 18f, bool isMain = true, float spreadAngle = 0f)
|
||||
{
|
||||
GameObject go = new GameObject(isMain ? "Boss_Saliva_Globule" : "Boss_Saliva_Droplet");
|
||||
go.transform.position = startPos;
|
||||
|
||||
Vector3 dir = (targetPos - startPos);
|
||||
dir.y += 0.22f; // небольшая естественная баллистическая дуга плевка
|
||||
if (spreadAngle > 0.01f)
|
||||
{
|
||||
float pitch = Random.Range(-spreadAngle, spreadAngle);
|
||||
float yaw = Random.Range(-spreadAngle, spreadAngle);
|
||||
dir = Quaternion.Euler(pitch, yaw, 0f) * dir;
|
||||
}
|
||||
|
||||
Vector3 normDir = dir.normalized;
|
||||
go.transform.rotation = Quaternion.LookRotation(normDir);
|
||||
|
||||
float baseScale = isMain ? 1f : 0.65f;
|
||||
|
||||
// 1. Формируем анатомическую вытянутую каплю слюны (а не плоскую кляксу)
|
||||
// Основное каплевидное тело (вытянутое вдоль направления полета Z)
|
||||
GameObject body = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
body.name = "Saliva_Body";
|
||||
body.transform.SetParent(go.transform, false);
|
||||
body.transform.localScale = new Vector3(0.08f, 0.08f, 0.34f) * baseScale;
|
||||
body.transform.localPosition = Vector3.zero;
|
||||
|
||||
// Переднее утолщение капли слюны
|
||||
GameObject head = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
head.name = "Saliva_Head";
|
||||
head.transform.SetParent(go.transform, false);
|
||||
head.transform.localScale = new Vector3(0.11f, 0.11f, 0.14f) * baseScale;
|
||||
head.transform.localPosition = new Vector3(0f, 0f, 0.11f * baseScale);
|
||||
|
||||
// Хвостовая мелкая капелька слизи
|
||||
GameObject tail = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
tail.name = "Saliva_Tail";
|
||||
tail.transform.SetParent(go.transform, false);
|
||||
tail.transform.localScale = new Vector3(0.05f, 0.05f, 0.08f) * baseScale;
|
||||
tail.transform.localPosition = new Vector3(0f, 0f, -0.20f * baseScale);
|
||||
|
||||
Destroy(body.GetComponent<Collider>());
|
||||
Destroy(head.GetComponent<Collider>());
|
||||
Destroy(tail.GetComponent<Collider>());
|
||||
|
||||
// Органический материал токсичной слюны: влажный, глянцевый, полупрозрачный
|
||||
Material salivaMat = new Material(Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Standard"));
|
||||
salivaMat.color = new Color(0.35f, 0.95f, 0.2f, 0.85f);
|
||||
salivaMat.EnableKeyword("_EMISSION");
|
||||
salivaMat.SetColor("_EmissionColor", new Color(0.2f, 0.85f, 0.15f) * 1.3f);
|
||||
if (salivaMat.HasProperty("_Smoothness")) salivaMat.SetFloat("_Smoothness", 0.94f);
|
||||
|
||||
body.GetComponent<Renderer>().material = salivaMat;
|
||||
head.GetComponent<Renderer>().material = salivaMat;
|
||||
tail.GetComponent<Renderer>().material = salivaMat;
|
||||
|
||||
// 2. След летящей слюны (TrailRenderer) — нить тягучей слизи за летящим плевком
|
||||
TrailRenderer trail = go.AddComponent<TrailRenderer>();
|
||||
trail.time = 0.20f;
|
||||
trail.startWidth = 0.09f * baseScale;
|
||||
trail.endWidth = 0.005f;
|
||||
trail.minVertexDistance = 0.04f;
|
||||
|
||||
Material trailMat = new Material(Shader.Find("Sprites/Default") ?? Shader.Find("Universal Render Pipeline/Unlit"));
|
||||
trailMat.color = new Color(0.4f, 0.95f, 0.25f, 0.7f);
|
||||
trail.material = trailMat;
|
||||
|
||||
Gradient grad = new Gradient();
|
||||
grad.SetKeys(
|
||||
new GradientColorKey[] { new GradientColorKey(new Color(0.4f, 1f, 0.25f), 0f), new GradientColorKey(new Color(0.25f, 0.85f, 0.15f), 1f) },
|
||||
new GradientAlphaKey[] { new GradientAlphaKey(0.75f, 0f), new GradientAlphaKey(0.0f, 1f) }
|
||||
);
|
||||
trail.colorGradient = grad;
|
||||
|
||||
// 3. Мягкая подсветка капли в полете
|
||||
GameObject lightObj = new GameObject("SalivaGlow");
|
||||
lightObj.transform.SetParent(go.transform, false);
|
||||
Light l = lightObj.AddComponent<Light>();
|
||||
l.type = LightType.Point;
|
||||
l.color = new Color(0.35f, 1.0f, 0.25f);
|
||||
l.intensity = isMain ? 0.9f : 0.5f;
|
||||
l.range = isMain ? 2.0f : 1.2f;
|
||||
|
||||
// 4. Коллайдер-триггер на корневом объекте
|
||||
SphereCollider col = go.AddComponent<SphereCollider>();
|
||||
col.isTrigger = true;
|
||||
col.radius = 0.13f * baseScale;
|
||||
|
||||
AcidProjectile proj = go.AddComponent<AcidProjectile>();
|
||||
proj.speed = projSpeed;
|
||||
proj.directDamage = damage;
|
||||
proj.isMainGlobule = isMain;
|
||||
proj.moveDirection = normDir;
|
||||
|
||||
return proj;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (hasImpacted) return;
|
||||
|
||||
lifeTimer += Time.deltaTime;
|
||||
if (lifeTimer >= maxLifetime)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
// Перемещение снаряда вперед с естественной баллистикой
|
||||
moveDirection += Vector3.down * (4.0f * Time.deltaTime);
|
||||
transform.position += moveDirection.normalized * (speed * Time.deltaTime);
|
||||
|
||||
// Поворот по вектору движения, чтобы капля летела кончиком вперед
|
||||
if (moveDirection.sqrMagnitude > 0.001f)
|
||||
{
|
||||
transform.rotation = Quaternion.LookRotation(moveDirection);
|
||||
}
|
||||
|
||||
// SphereCast вперед для точной регистрации удара на высокой скорости
|
||||
if (Physics.SphereCast(transform.position, 0.12f, moveDirection, out RaycastHit hit, speed * Time.deltaTime, ~0, QueryTriggerInteraction.Ignore))
|
||||
{
|
||||
OnHit(hit.collider, hit.point);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (hasImpacted) return;
|
||||
if (other.GetComponentInParent<TitanBossAI>() != null) return;
|
||||
if (other.name.Contains("Saliva") || other.name.Contains("Acid")) return;
|
||||
|
||||
OnHit(other, transform.position);
|
||||
}
|
||||
|
||||
private void OnHit(Collider hitCollider, Vector3 impactPoint)
|
||||
{
|
||||
if (hasImpacted) return;
|
||||
hasImpacted = true;
|
||||
|
||||
// 1. Урон игроку при прямом попадании
|
||||
PlayerHealth player = hitCollider.GetComponentInParent<PlayerHealth>();
|
||||
if (player != null)
|
||||
{
|
||||
player.TakeDamage(directDamage);
|
||||
Debug.Log($"<color=green>[Босс] Плевок слюны попал в игрока! Нанесено {directDamage} урона.</color>");
|
||||
}
|
||||
|
||||
// 2. Волна эхолокации в месте удара (жидкость ударяется о поверхность и разлетается брызгами)
|
||||
if (EchoTrigger.Instance != null && isMainGlobule)
|
||||
{
|
||||
Vector3 echoPos = impactPoint;
|
||||
if (Physics.Raycast(impactPoint + Vector3.up * 0.5f, Vector3.down, out RaycastHit floorHit, 4f))
|
||||
{
|
||||
echoPos = floorHit.point + Vector3.up * 0.05f;
|
||||
}
|
||||
EchoTrigger.Instance.TriggerExternalWave(echoPos, 14f, 1.8f);
|
||||
}
|
||||
|
||||
// 3. Создание органического всплеска слюны на полу
|
||||
if (isMainGlobule)
|
||||
{
|
||||
Vector3 poolPos = impactPoint;
|
||||
if (Physics.Raycast(impactPoint + Vector3.up * 0.5f, Vector3.down, out RaycastHit fHit, 5f))
|
||||
{
|
||||
poolPos = fHit.point;
|
||||
}
|
||||
AcidPool.Create(poolPos, poolLifetime: 4.5f, poolRadius: 0.85f);
|
||||
}
|
||||
|
||||
// 4. Звук смачного шлепка слюны о поверхность
|
||||
GameAudioSynthesizer.PlayAcidImpact();
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4b1284fcd03cb541b889710748457aa
|
||||
@@ -0,0 +1,68 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Полноэкранный визуальный эффект акустического ослепления (подавления чувств).
|
||||
/// Активируется во время крика Босса: полностью затемняет экран и гасит эхолокацию.
|
||||
/// </summary>
|
||||
public class AcousticJammerOverlay : MonoBehaviour
|
||||
{
|
||||
private Image overlayImage;
|
||||
private CanvasGroup canvasGroup;
|
||||
|
||||
private float currentAlpha = 0f;
|
||||
|
||||
public static AcousticJammerOverlay Create(Transform hudCanvas)
|
||||
{
|
||||
var old = hudCanvas.Find("AcousticJammerOverlay");
|
||||
if (old != null) DestroyImmediate(old.gameObject);
|
||||
|
||||
GameObject root = new GameObject("AcousticJammerOverlay", typeof(RectTransform), typeof(CanvasGroup));
|
||||
root.transform.SetParent(hudCanvas, false);
|
||||
|
||||
RectTransform rt = root.GetComponent<RectTransform>();
|
||||
rt.anchorMin = Vector2.zero;
|
||||
rt.anchorMax = Vector2.one;
|
||||
rt.sizeDelta = Vector2.zero;
|
||||
|
||||
// Черный экран с легким темно-багровым оттенком
|
||||
GameObject imgObj = new GameObject("VignetteBlackout", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
imgObj.transform.SetParent(root.transform, false);
|
||||
RectTransform imgRt = imgObj.GetComponent<RectTransform>();
|
||||
imgRt.anchorMin = Vector2.zero;
|
||||
imgRt.anchorMax = Vector2.one;
|
||||
imgRt.sizeDelta = Vector2.zero;
|
||||
|
||||
Image img = imgObj.GetComponent<Image>();
|
||||
img.color = new Color(0.01f, 0.005f, 0.005f, 0.98f);
|
||||
img.raycastTarget = false;
|
||||
|
||||
AcousticJammerOverlay overlay = root.AddComponent<AcousticJammerOverlay>();
|
||||
overlay.overlayImage = img;
|
||||
overlay.canvasGroup = root.GetComponent<CanvasGroup>();
|
||||
overlay.canvasGroup.alpha = 0f;
|
||||
overlay.canvasGroup.blocksRaycasts = false;
|
||||
overlay.canvasGroup.interactable = false;
|
||||
|
||||
return overlay;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (canvasGroup == null) canvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
bool isBlinded = EchoTrigger.Instance != null && EchoTrigger.Instance.IsBlinded;
|
||||
float targetAlpha = isBlinded ? 1f : 0f;
|
||||
float speed = isBlinded ? 14f : 3.5f; // Мгновенно ослепляет, плавно возвращает зрение
|
||||
|
||||
currentAlpha = Mathf.MoveTowards(currentAlpha, targetAlpha, speed * Time.deltaTime);
|
||||
|
||||
if (canvasGroup != null)
|
||||
{
|
||||
canvasGroup.alpha = currentAlpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2035ce02f06d82c438ae1be3ac0862f1
|
||||
@@ -0,0 +1,136 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Контроллер арены босса на 2-м уровне.
|
||||
/// Блокирует двери отсека при входе игрока (карантинный локдаун) и не выпускает
|
||||
/// до тех пор, пока босс не будет побежден или пока игрок не погибнет.
|
||||
/// </summary>
|
||||
public class BossArenaController : MonoBehaviour
|
||||
{
|
||||
[Header("Ссылки на объекты арены")]
|
||||
public TitanBossAI bossAI;
|
||||
public GameObject blastDoorRoot;
|
||||
public Collider blastDoorCollider;
|
||||
public Light emergencyLight;
|
||||
|
||||
[Header("Состояние арены")]
|
||||
public bool isLockdownActive = false;
|
||||
public bool isBossDefeated = false;
|
||||
|
||||
private Vector3 doorOpenPos;
|
||||
private Vector3 doorClosedPos;
|
||||
private Coroutine doorMoveCoroutine;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (blastDoorRoot != null)
|
||||
{
|
||||
doorClosedPos = blastDoorRoot.transform.position;
|
||||
doorOpenPos = doorClosedPos + Vector3.up * 4.2f;
|
||||
// Изначально ворота открыты, чтобы игрок мог войти
|
||||
blastDoorRoot.transform.position = doorOpenPos;
|
||||
if (blastDoorCollider != null) blastDoorCollider.enabled = false;
|
||||
}
|
||||
|
||||
if (emergencyLight != null)
|
||||
{
|
||||
emergencyLight.color = new Color(0.2f, 0.8f, 0.4f); // Зеленый дежурный свет до боя
|
||||
emergencyLight.intensity = 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (isLockdownActive || isBossDefeated) return;
|
||||
|
||||
if (other.CompareTag("Player") || other.GetComponentInParent<PlayerMovement>() != null)
|
||||
{
|
||||
InitiateLockdown();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitiateLockdown()
|
||||
{
|
||||
if (isLockdownActive || isBossDefeated) return;
|
||||
isLockdownActive = true;
|
||||
|
||||
Debug.Log("<color=red>[Арена Босса] КАРАНТИННАЯ БЛОКИРОВКА: ВХОД ЗАПЕРТ!</color>");
|
||||
|
||||
// Звук тревоги и герметизации
|
||||
GameAudioSynthesizer.PlayLockdownAlarm();
|
||||
|
||||
// Закрываем гермоворота
|
||||
if (blastDoorRoot != null)
|
||||
{
|
||||
if (doorMoveCoroutine != null) StopCoroutine(doorMoveCoroutine);
|
||||
doorMoveCoroutine = StartCoroutine(RoutineMoveDoor(doorClosedPos, true));
|
||||
}
|
||||
|
||||
// Включаем пульсирующий аварийный красный свет
|
||||
if (emergencyLight != null)
|
||||
{
|
||||
emergencyLight.color = new Color(1.0f, 0.15f, 0.15f);
|
||||
emergencyLight.intensity = 2.8f;
|
||||
}
|
||||
|
||||
// Будим босса
|
||||
if (bossAI != null)
|
||||
{
|
||||
bossAI.WakeUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnBossDefeated()
|
||||
{
|
||||
if (isBossDefeated) return;
|
||||
isBossDefeated = true;
|
||||
isLockdownActive = false;
|
||||
|
||||
Debug.Log("<color=green>[Арена Босса] БОСС УНИЧТОЖЕН: ВОРОТА РАЗБЛОКИРОВАНЫ!</color>");
|
||||
|
||||
// Звук разблокировки гидравлики
|
||||
GameAudioSynthesizer.PlayDoorHydraulic();
|
||||
|
||||
// Открываем ворота
|
||||
if (blastDoorRoot != null)
|
||||
{
|
||||
if (doorMoveCoroutine != null) StopCoroutine(doorMoveCoroutine);
|
||||
doorMoveCoroutine = StartCoroutine(RoutineMoveDoor(doorOpenPos, false));
|
||||
}
|
||||
|
||||
// Возвращаем свет в спокойный зеленый/бирюзовый
|
||||
if (emergencyLight != null)
|
||||
{
|
||||
emergencyLight.color = new Color(0.2f, 1.0f, 0.5f);
|
||||
emergencyLight.intensity = 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator RoutineMoveDoor(Vector3 targetPos, bool enableColliderAtEnd)
|
||||
{
|
||||
if (blastDoorCollider != null)
|
||||
{
|
||||
if (enableColliderAtEnd) blastDoorCollider.enabled = true;
|
||||
else blastDoorCollider.enabled = false;
|
||||
}
|
||||
|
||||
float duration = 1.0f;
|
||||
float elapsed = 0f;
|
||||
Vector3 start = blastDoorRoot.transform.position;
|
||||
|
||||
while (elapsed < duration)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
float t = Mathf.SmoothStep(0f, 1f, elapsed / duration);
|
||||
blastDoorRoot.transform.position = Vector3.Lerp(start, targetPos, t);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
blastDoorRoot.transform.position = targetPos;
|
||||
if (enableColliderAtEnd && blastDoorCollider != null)
|
||||
{
|
||||
blastDoorCollider.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1808e83064e2103478613dd1583f2b8e
|
||||
@@ -0,0 +1,192 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Шкала здоровья Босса вверху посередине экрана.
|
||||
/// Показывает имя босса, текущее/максимальное здоровье и плавное заполнение полосы.
|
||||
/// </summary>
|
||||
public class BossHealthBarUI : MonoBehaviour
|
||||
{
|
||||
private static BossHealthBarUI _instance;
|
||||
public static BossHealthBarUI Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
_instance = FindAnyObjectByType<BossHealthBarUI>(FindObjectsInactive.Include);
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
[Header("Элементы интерфейса")]
|
||||
public GameObject rootPanel;
|
||||
public Text bossTitleText;
|
||||
public Text bossSubText;
|
||||
public Image fillBar;
|
||||
public Text healthValueText;
|
||||
public CanvasGroup canvasGroup;
|
||||
|
||||
private float targetFill = 1f;
|
||||
private float currentFill = 1f;
|
||||
private bool isVisible = false;
|
||||
|
||||
public static BossHealthBarUI Create(Transform hudCanvas)
|
||||
{
|
||||
var old = hudCanvas.Find("BossHealthBarPanel");
|
||||
if (old != null) DestroyImmediate(old.gameObject);
|
||||
|
||||
Font defaultFont = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
|
||||
// 1. Корневой объект
|
||||
GameObject root = new GameObject("BossHealthBarPanel", typeof(RectTransform), typeof(CanvasGroup));
|
||||
root.transform.SetParent(hudCanvas, false);
|
||||
|
||||
RectTransform rootRt = root.GetComponent<RectTransform>();
|
||||
rootRt.anchorMin = new Vector2(0.5f, 1.0f);
|
||||
rootRt.anchorMax = new Vector2(0.5f, 1.0f);
|
||||
rootRt.pivot = new Vector2(0.5f, 1.0f);
|
||||
rootRt.anchoredPosition = new Vector2(0f, -22f);
|
||||
rootRt.sizeDelta = new Vector2(560f, 62f);
|
||||
|
||||
// 2. Фон контейнера
|
||||
Image bgImg = root.AddComponent<Image>();
|
||||
bgImg.color = new Color(0.04f, 0.04f, 0.05f, 0.92f);
|
||||
|
||||
Outline outline = root.AddComponent<Outline>();
|
||||
outline.effectColor = new Color(1.0f, 0.25f, 0.25f, 0.65f);
|
||||
outline.effectDistance = new Vector2(1.5f, -1.5f);
|
||||
|
||||
// 3. Заголовок босса
|
||||
GameObject titleObj = new GameObject("BossTitle", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
titleObj.transform.SetParent(root.transform, false);
|
||||
RectTransform titleRt = titleObj.GetComponent<RectTransform>();
|
||||
titleRt.anchorMin = new Vector2(0f, 0.62f);
|
||||
titleRt.anchorMax = new Vector2(1f, 1.0f);
|
||||
titleRt.offsetMin = new Vector2(15f, 0f);
|
||||
titleRt.offsetMax = new Vector2(-15f, -4f);
|
||||
|
||||
Text titleText = titleObj.GetComponent<Text>();
|
||||
titleText.font = defaultFont;
|
||||
titleText.fontSize = 15;
|
||||
titleText.fontStyle = FontStyle.Bold;
|
||||
titleText.alignment = TextAnchor.MiddleCenter;
|
||||
titleText.color = new Color(1.0f, 0.3f, 0.3f, 1.0f);
|
||||
titleText.text = "ТИП-0: АЛЬФА-МУТАНТ (ПАТРИАРХ)";
|
||||
|
||||
// 4. Фон полосы здоровья
|
||||
GameObject barBgObj = new GameObject("BarBackground", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
barBgObj.transform.SetParent(root.transform, false);
|
||||
RectTransform barBgRt = barBgObj.GetComponent<RectTransform>();
|
||||
barBgRt.anchorMin = new Vector2(0f, 0.16f);
|
||||
barBgRt.anchorMax = new Vector2(1f, 0.54f);
|
||||
barBgRt.offsetMin = new Vector2(14f, 0f);
|
||||
barBgRt.offsetMax = new Vector2(-14f, 0f);
|
||||
|
||||
Image barBgImg = barBgObj.GetComponent<Image>();
|
||||
barBgImg.color = new Color(0.18f, 0.05f, 0.05f, 0.95f);
|
||||
|
||||
// 5. Заполнение полосы (красный градиент)
|
||||
GameObject fillObj = new GameObject("BarFill", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
fillObj.transform.SetParent(barBgObj.transform, false);
|
||||
RectTransform fillRt = fillObj.GetComponent<RectTransform>();
|
||||
fillRt.anchorMin = Vector2.zero;
|
||||
fillRt.anchorMax = Vector2.one;
|
||||
fillRt.sizeDelta = Vector2.zero;
|
||||
|
||||
Image fillImg = fillObj.GetComponent<Image>();
|
||||
fillImg.type = Image.Type.Filled;
|
||||
fillImg.fillMethod = Image.FillMethod.Horizontal;
|
||||
fillImg.fillOrigin = (int)Image.OriginHorizontal.Left;
|
||||
fillImg.color = new Color(0.95f, 0.2f, 0.2f, 1.0f);
|
||||
|
||||
// 6. Текст числового значения HP
|
||||
GameObject hpTxtObj = new GameObject("HealthText", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
hpTxtObj.transform.SetParent(barBgObj.transform, false);
|
||||
RectTransform hpTxtRt = hpTxtObj.GetComponent<RectTransform>();
|
||||
hpTxtRt.anchorMin = Vector2.zero;
|
||||
hpTxtRt.anchorMax = Vector2.one;
|
||||
hpTxtRt.sizeDelta = Vector2.zero;
|
||||
|
||||
Text hpTxt = hpTxtObj.GetComponent<Text>();
|
||||
hpTxt.font = defaultFont;
|
||||
hpTxt.fontSize = 13;
|
||||
hpTxt.fontStyle = FontStyle.Bold;
|
||||
hpTxt.alignment = TextAnchor.MiddleCenter;
|
||||
hpTxt.color = Color.white;
|
||||
hpTxt.text = "500 / 500";
|
||||
|
||||
BossHealthBarUI barUI = root.AddComponent<BossHealthBarUI>();
|
||||
barUI.rootPanel = root;
|
||||
barUI.bossTitleText = titleText;
|
||||
barUI.fillBar = fillImg;
|
||||
barUI.healthValueText = hpTxt;
|
||||
barUI.canvasGroup = root.GetComponent<CanvasGroup>();
|
||||
barUI.canvasGroup.alpha = 0f;
|
||||
barUI.canvasGroup.blocksRaycasts = false;
|
||||
barUI.canvasGroup.interactable = false;
|
||||
|
||||
root.SetActive(false);
|
||||
return barUI;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
if (canvasGroup == null) canvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Плавное заполнение полосы
|
||||
currentFill = Mathf.MoveTowards(currentFill, targetFill, 2.5f * Time.deltaTime);
|
||||
if (fillBar != null)
|
||||
{
|
||||
fillBar.fillAmount = currentFill;
|
||||
}
|
||||
|
||||
// Плавный альфа-фейд
|
||||
if (canvasGroup != null)
|
||||
{
|
||||
float targetAlpha = isVisible ? 1f : 0f;
|
||||
canvasGroup.alpha = Mathf.MoveTowards(canvasGroup.alpha, targetAlpha, 4f * Time.deltaTime);
|
||||
|
||||
if (!isVisible && canvasGroup.alpha <= 0.01f && gameObject.activeSelf)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowBoss(string name, float current, float max)
|
||||
{
|
||||
if (bossTitleText != null) bossTitleText.text = name;
|
||||
targetFill = Mathf.Clamp01(current / max);
|
||||
currentFill = targetFill;
|
||||
if (fillBar != null) fillBar.fillAmount = currentFill;
|
||||
if (healthValueText != null) healthValueText.text = $"{Mathf.CeilToInt(current)} / {Mathf.CeilToInt(max)}";
|
||||
|
||||
gameObject.SetActive(true);
|
||||
isVisible = true;
|
||||
}
|
||||
|
||||
public void UpdateHealth(float current, float max)
|
||||
{
|
||||
targetFill = Mathf.Clamp01(current / max);
|
||||
if (healthValueText != null) healthValueText.text = $"{Mathf.Max(0, Mathf.CeilToInt(current))} / {Mathf.CeilToInt(max)}";
|
||||
|
||||
if (current <= 0f)
|
||||
{
|
||||
HideBoss(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void HideBoss(bool instant = false)
|
||||
{
|
||||
isVisible = false;
|
||||
if (instant)
|
||||
{
|
||||
if (canvasGroup != null) canvasGroup.alpha = 0f;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e942543155cd404e9091784c06ad005
|
||||
@@ -39,6 +39,7 @@ public class CameraFollow : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
Vector3 angles = transform.eulerAngles;
|
||||
pitch = angles.x;
|
||||
yaw = angles.y;
|
||||
@@ -52,6 +53,17 @@ public class CameraFollow : MonoBehaviour
|
||||
|
||||
// Исключаем слой Ignore Raycast (слой 2) из проверки стен
|
||||
collisionLayers &= ~(1 << 2);
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
Quaternion rot = Quaternion.Euler(pitch, yaw, 0f);
|
||||
Vector3 targetFocus = target.position + (Vector3.up * height);
|
||||
Vector3 rightOffset = rot * Vector3.right * shoulderOffset;
|
||||
Vector3 desiredOrigin = targetFocus + rightOffset;
|
||||
Vector3 backDir = -(rot * Vector3.forward);
|
||||
transform.position = desiredOrigin + (backDir * distance);
|
||||
transform.rotation = rot;
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
|
||||
@@ -50,6 +50,24 @@ public class EchoTrigger : MonoBehaviour
|
||||
[Header("Реакция мутантов")]
|
||||
public bool alertMutants = true;
|
||||
|
||||
[Header("Акустическое ослепление (Босс)")]
|
||||
private float blindnessTimer = 0f;
|
||||
public bool IsBlinded => blindnessTimer > 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Полностью глушит эхолокацию: шум шагов, выстрелы и броски не создают волн
|
||||
/// </summary>
|
||||
public void ApplyBlindness(float duration)
|
||||
{
|
||||
blindnessTimer = Mathf.Max(blindnessTimer, duration);
|
||||
for (int i = 0; i < MAX_WAVES; i++)
|
||||
{
|
||||
waveActive[i] = false;
|
||||
SetFloatOnAllEchoMaterials("_EchoRadius" + (i + 1), 0f);
|
||||
SetFloatOnAllEchoMaterials("_EchoOpacity" + (i + 1), 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Пул из 3 одновременных волн
|
||||
private const int MAX_WAVES = 3;
|
||||
private float[] waveRadii = new float[MAX_WAVES];
|
||||
@@ -219,6 +237,15 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (blindnessTimer > 0f)
|
||||
{
|
||||
blindnessTimer -= Time.deltaTime;
|
||||
for (int i = 0; i < MAX_WAVES; i++)
|
||||
{
|
||||
SetFloatOnAllEchoMaterials("_EchoOpacity" + (i + 1), 0f);
|
||||
}
|
||||
}
|
||||
|
||||
HandleStepDetection();
|
||||
HandleManualEchoPulse();
|
||||
UpdateWaveShaderProgress();
|
||||
@@ -226,6 +253,8 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
void HandleManualEchoPulse()
|
||||
{
|
||||
if (IsBlinded) return;
|
||||
|
||||
// Возможность выпустить эхолокационный импульс (Space, Q или ПКМ)
|
||||
var keyboard = Keyboard.current;
|
||||
var mouse = Mouse.current;
|
||||
@@ -443,6 +472,8 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
public void TriggerExternalWave(Vector3 position, float targetMax, float targetIntensity)
|
||||
{
|
||||
if (IsBlinded) return;
|
||||
|
||||
if (allEchoMaterials.Count == 0)
|
||||
{
|
||||
CollectAllEchoMaterials();
|
||||
|
||||
@@ -0,0 +1,755 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Unity.AI.Navigation;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public static class Level2SceneBuilder
|
||||
{
|
||||
[MenuItem("Tools/Synthesia/Build Level 2 (SubLevel Complex)")]
|
||||
public static void BuildLevel2Scene()
|
||||
{
|
||||
Debug.Log("<color=cyan>[Level 2] Начало сборки 2-го уровня...</color>");
|
||||
|
||||
// 1. Открываем SampleScene как шаблон
|
||||
string samplePath = "Assets/Scenes/SampleScene.unity";
|
||||
string level2Path = "Assets/Scenes/Level2.unity";
|
||||
|
||||
var scene = EditorSceneManager.OpenScene(samplePath, OpenSceneMode.Single);
|
||||
|
||||
// 2. Сохраняем сцену под новым именем Level2.unity
|
||||
bool savedAs = EditorSceneManager.SaveScene(scene, level2Path);
|
||||
if (!savedAs)
|
||||
{
|
||||
Debug.LogError("[Level 2] Не удалось сохранить сцену как Level2.unity!");
|
||||
return;
|
||||
}
|
||||
|
||||
scene = EditorSceneManager.OpenScene(level2Path, OpenSceneMode.Single);
|
||||
|
||||
// 3. Очищаем объекты 1-го уровня
|
||||
string[] toRemove = new string[] {
|
||||
"Laboratory_Complex",
|
||||
"Cosmic_Retro_Laboratory",
|
||||
"Elevator_Level2_Zone",
|
||||
"StoryNotes_Container",
|
||||
"Enemies",
|
||||
"StoryManager",
|
||||
"SubLevel2_Complex",
|
||||
"Enemies_Level2"
|
||||
};
|
||||
|
||||
foreach (var name in toRemove)
|
||||
{
|
||||
var go = GameObject.Find(name);
|
||||
if (go != null) Undo.DestroyObjectImmediate(go);
|
||||
}
|
||||
|
||||
// Удаляем старые тестовые коробки патронов
|
||||
var allBoxes = Object.FindObjectsByType<AmmoPickup>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
foreach (var b in allBoxes)
|
||||
{
|
||||
Undo.DestroyObjectImmediate(b.gameObject);
|
||||
}
|
||||
|
||||
// 4. Загрузка материалов и префабов
|
||||
Material echoMat = AssetDatabase.LoadAssetAtPath<Material>("Assets/EchoCloudMat.mat");
|
||||
if (echoMat == null) echoMat = AssetDatabase.LoadAssetAtPath<Material>("Assets/EchoMat.mat");
|
||||
|
||||
GameObject mutantPrefab = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/Prefabs/Mutant.prefab");
|
||||
Font defaultFont = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
|
||||
// 5. Создаем контейнер SubLevel2_Complex
|
||||
GameObject level2Root = new GameObject("SubLevel2_Complex");
|
||||
level2Root.transform.position = Vector3.zero;
|
||||
|
||||
// Позиционируем игрока в стартовом лифте прибытия (0, 0.1, -22)
|
||||
GameObject playerGo = GameObject.FindWithTag("Player");
|
||||
if (playerGo == null) playerGo = GameObject.Find("Player");
|
||||
if (playerGo != null)
|
||||
{
|
||||
playerGo.transform.position = new Vector3(0f, 0.15f, -22f);
|
||||
playerGo.transform.rotation = Quaternion.identity;
|
||||
}
|
||||
|
||||
// --- ГЕОМЕТРИЯ 2-ГО УРОВНЯ ---
|
||||
// А. Шахта лифта прибытия (Arrival Chamber): (0, 0, -22), размер 6x6
|
||||
BuildRoom(level2Root.transform, "Room_ArrivalElevator", new Vector3(0f, 0f, -22f), new Vector3(6f, 0.2f, 6f), 3.8f, echoMat,
|
||||
hasNorthDoor: true, hasSouthDoor: false, hasWestDoor: false, hasEastDoor: false);
|
||||
|
||||
// Рама лифта прибытия
|
||||
BuildElevatorShaft(level2Root.transform, new Vector3(0f, 0f, -22.5f), echoMat);
|
||||
|
||||
// Б. Южный шлюзовой коридор: (0, 0, -12.5), размер 4x13
|
||||
BuildCorridor(level2Root.transform, "Corridor_South", new Vector3(0f, 0f, -12.5f), new Vector3(4f, 0.2f, 13f), 3.8f, echoMat, isNS: true);
|
||||
|
||||
// В. Центральный узел (Central Hub): (0, 0, 0), размер 12x12
|
||||
BuildRoom(level2Root.transform, "Room_CentralHub", new Vector3(0f, 0f, 0f), new Vector3(12f, 0.2f, 12f), 3.8f, echoMat,
|
||||
hasNorthDoor: true, hasSouthDoor: true, hasWestDoor: true, hasEastDoor: true);
|
||||
|
||||
// Колонны в Центральном узле
|
||||
BuildPillar(level2Root.transform, new Vector3(-3.5f, 1.9f, -3.5f), new Vector3(1.2f, 3.8f, 1.2f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(3.5f, 1.9f, -3.5f), new Vector3(1.2f, 3.8f, 1.2f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(-3.5f, 1.9f, 3.5f), new Vector3(1.2f, 3.8f, 1.2f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(3.5f, 1.9f, 3.5f), new Vector3(1.2f, 3.8f, 1.2f), echoMat);
|
||||
|
||||
// Г. Западный сектор: Крио-изолятор и виварий (-17, 0, 0), размер 14x14
|
||||
BuildCorridor(level2Root.transform, "Corridor_West", new Vector3(-8f, 0f, 0f), new Vector3(4f, 0.2f, 4f), 3.8f, echoMat, isNS: false);
|
||||
BuildRoom(level2Root.transform, "Room_CryoIsolation", new Vector3(-17f, 0f, 0f), new Vector3(14f, 0.2f, 14f), 3.8f, echoMat,
|
||||
hasNorthDoor: false, hasSouthDoor: false, hasWestDoor: false, hasEastDoor: true);
|
||||
|
||||
// Д. Восточный сектор: Био-синтез и химические реакторы (17, 0, 0), размер 14x14
|
||||
BuildCorridor(level2Root.transform, "Corridor_East", new Vector3(8f, 0f, 0f), new Vector3(4f, 0.2f, 4f), 3.8f, echoMat, isNS: false);
|
||||
BuildRoom(level2Root.transform, "Room_BioSynthesis", new Vector3(17f, 0f, 0f), new Vector3(14f, 0.2f, 14f), 3.8f, echoMat,
|
||||
hasNorthDoor: false, hasSouthDoor: false, hasWestDoor: true, hasEastDoor: false);
|
||||
|
||||
// Е. Северный переход к архиву и реактору (0, 0, 9), размер 4x6
|
||||
BuildCorridor(level2Root.transform, "Corridor_North", new Vector3(0f, 0f, 9f), new Vector3(4f, 0.2f, 6f), 3.8f, echoMat, isNS: true);
|
||||
|
||||
// Ж. Сектор архивов и серверной (-11, 0, 15), размер 10x10
|
||||
BuildCorridor(level2Root.transform, "Corridor_ArchivesBranch", new Vector3(-4.5f, 0f, 9f), new Vector3(5f, 0.2f, 4f), 3.8f, echoMat, isNS: false);
|
||||
BuildRoom(level2Root.transform, "Room_SecurityArchives", new Vector3(-11f, 0f, 15f), new Vector3(10f, 0.2f, 10f), 3.8f, echoMat,
|
||||
hasNorthDoor: false, hasSouthDoor: true, hasWestDoor: false, hasEastDoor: false);
|
||||
|
||||
// З. Главный реакторный отсек и эвакуационный шлюз (0, 0, 26), просторная арена 26x26 м
|
||||
BuildRoom(level2Root.transform, "Room_ReactorAirlock", new Vector3(0f, 0f, 26f), new Vector3(26f, 0.2f, 26f), 4.5f, echoMat,
|
||||
hasNorthDoor: false, hasSouthDoor: true, hasWestDoor: false, hasEastDoor: false);
|
||||
|
||||
// Массивные реакторные колонны-укрытия на арене босса
|
||||
BuildPillar(level2Root.transform, new Vector3(-6.5f, 2.25f, 20f), new Vector3(1.6f, 4.5f, 1.6f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(6.5f, 2.25f, 20f), new Vector3(1.6f, 4.5f, 1.6f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(-6.5f, 2.25f, 31f), new Vector3(1.6f, 4.5f, 1.6f), echoMat);
|
||||
BuildPillar(level2Root.transform, new Vector3(6.5f, 2.25f, 31f), new Vector3(1.6f, 4.5f, 1.6f), echoMat);
|
||||
|
||||
// Финальный терминал эвакуации и шлюз на севере арены (0, 0, 38.2)
|
||||
BuildFinalEscapeAirlock(level2Root.transform, new Vector3(0f, 0f, 38.2f), echoMat);
|
||||
|
||||
// Атмосферное аварийное освещение (тусклые маяки)
|
||||
BuildBeacon(level2Root.transform, new Vector3(0f, 2.5f, -22f), new Color(0.2f, 0.6f, 0.9f), 1.8f, 8f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(0f, 2.8f, 0f), new Color(1.0f, 0.75f, 0.2f), 2.2f, 12f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(-17f, 2.8f, 0f), new Color(0.1f, 0.8f, 0.9f), 1.8f, 10f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(17f, 2.8f, 0f), new Color(1.0f, 0.45f, 0.1f), 1.8f, 10f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(-11f, 2.5f, 15f), new Color(0.3f, 0.8f, 0.4f), 1.5f, 8f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(-8f, 3.2f, 22f), new Color(1.0f, 0.2f, 0.2f), 2.2f, 14f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(8f, 3.2f, 22f), new Color(1.0f, 0.2f, 0.2f), 2.2f, 14f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(-8f, 3.2f, 31f), new Color(1.0f, 0.2f, 0.2f), 2.2f, 14f);
|
||||
BuildBeacon(level2Root.transform, new Vector3(8f, 3.2f, 31f), new Color(1.0f, 0.2f, 0.2f), 2.2f, 14f);
|
||||
|
||||
// Патроны на уровне 2
|
||||
CreateAmmoBox(new Vector3(-18f, 0.3f, 4f), 14);
|
||||
CreateAmmoBox(new Vector3(18f, 0.3f, -4f), 21);
|
||||
CreateAmmoBox(new Vector3(-12f, 0.3f, 16f), 14);
|
||||
|
||||
// Физические предметы для бросков (отвлечение мутантов)
|
||||
CreateThrowableProp(new Vector3(-2f, 0.5f, -2f), "Distraction_Flask_1");
|
||||
CreateThrowableProp(new Vector3(2f, 0.5f, -1f), "Distraction_Flask_2");
|
||||
CreateThrowableProp(new Vector3(-16f, 0.5f, 2f), "Distraction_Flask_3");
|
||||
CreateThrowableProp(new Vector3(16f, 0.5f, 2f), "Distraction_Flask_4");
|
||||
|
||||
// 6. Противники и Босс Уровня 2
|
||||
GameObject enemiesContainer = new GameObject("Enemies_Level2");
|
||||
if (mutantPrefab != null)
|
||||
{
|
||||
SpawnMutant(mutantPrefab, enemiesContainer.transform, new Vector3(0f, 0.1f, 3f), "Mutant_Central_Hub");
|
||||
SpawnMutant(mutantPrefab, enemiesContainer.transform, new Vector3(-17f, 0.1f, 0f), "Mutant_CryoVault");
|
||||
SpawnMutant(mutantPrefab, enemiesContainer.transform, new Vector3(17f, 0.1f, 0f), "Mutant_BioCore");
|
||||
SpawnMutant(mutantPrefab, enemiesContainer.transform, new Vector3(-11f, 0.1f, 15f), "Mutant_Archives");
|
||||
|
||||
// Уникальный Босс 2-го уровня в центре расширенной реакторной арены
|
||||
GameObject bossObj = SpawnTitanBoss(mutantPrefab, enemiesContainer.transform, new Vector3(0f, 0.15f, 28f), "Titan_Boss_Alpha");
|
||||
BuildBossArenaLockdown(level2Root.transform, new Vector3(0f, 0f, 13f), echoMat, bossObj);
|
||||
|
||||
// Боеприпасы и тактические колбы на арене босса
|
||||
CreateAmmoBox(new Vector3(-9.5f, 0.3f, 18f), 21);
|
||||
CreateAmmoBox(new Vector3(9.5f, 0.3f, 18f), 21);
|
||||
CreateAmmoBox(new Vector3(-9.5f, 0.3f, 32f), 21);
|
||||
CreateAmmoBox(new Vector3(9.5f, 0.3f, 32f), 14);
|
||||
CreateThrowableProp(new Vector3(-6.5f, 0.5f, 25f), "Arena_Distraction_Flask_1");
|
||||
CreateThrowableProp(new Vector3(6.5f, 0.5f, 25f), "Arena_Distraction_Flask_2");
|
||||
CreateThrowableProp(new Vector3(0f, 0.5f, 34f), "Arena_Distraction_Flask_3");
|
||||
}
|
||||
|
||||
// 7. Настройка UI (Финальная победа, полоса здоровья босса, оверлей ослепления)
|
||||
SetupFinalVictoryUI();
|
||||
|
||||
// 8. Настраиваем и запекаем NavMesh для Уровня 2
|
||||
BakeLevel2NavMesh();
|
||||
|
||||
// 9. Регистрация сцены в Build Settings
|
||||
RegisterSceneInBuildSettings(level2Path);
|
||||
|
||||
// 10. Сохранение сцены
|
||||
EditorSceneManager.MarkSceneDirty(scene);
|
||||
EditorSceneManager.SaveScene(scene);
|
||||
|
||||
Debug.Log("<color=green>[Level 2] Сборка 2-го уровня полностью завершена!</color>");
|
||||
}
|
||||
|
||||
private static void BuildRoom(Transform parent, string name, Vector3 center, Vector3 floorSize, float height, Material mat,
|
||||
bool hasNorthDoor, bool hasSouthDoor, bool hasWestDoor, bool hasEastDoor)
|
||||
{
|
||||
GameObject room = new GameObject(name);
|
||||
room.transform.SetParent(parent);
|
||||
room.transform.position = center;
|
||||
|
||||
// Пол
|
||||
GameObject floor = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
floor.name = "Floor";
|
||||
floor.transform.SetParent(room.transform);
|
||||
floor.transform.localPosition = Vector3.zero;
|
||||
floor.transform.localScale = floorSize;
|
||||
if (mat != null) floor.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Потолок
|
||||
GameObject roof = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
roof.name = "Ceiling";
|
||||
roof.transform.SetParent(room.transform);
|
||||
roof.transform.localPosition = new Vector3(0f, height, 0f);
|
||||
roof.transform.localScale = floorSize;
|
||||
if (mat != null) roof.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
float halfX = floorSize.x * 0.5f;
|
||||
float halfZ = floorSize.z * 0.5f;
|
||||
float wallThick = 0.35f;
|
||||
|
||||
// Северная стена
|
||||
BuildWallWithDoor(room.transform, new Vector3(0f, height * 0.5f, halfZ), floorSize.x, height, wallThick, hasNorthDoor, mat, false);
|
||||
// Южная стена
|
||||
BuildWallWithDoor(room.transform, new Vector3(0f, height * 0.5f, -halfZ), floorSize.x, height, wallThick, hasSouthDoor, mat, false);
|
||||
// Западная стена
|
||||
BuildWallWithDoor(room.transform, new Vector3(-halfX, height * 0.5f, 0f), floorSize.z, height, wallThick, hasWestDoor, mat, true);
|
||||
// Восточная стена
|
||||
BuildWallWithDoor(room.transform, new Vector3(halfX, height * 0.5f, 0f), floorSize.z, height, wallThick, hasEastDoor, mat, true);
|
||||
}
|
||||
|
||||
private static void BuildWallWithDoor(Transform parent, Vector3 pos, float length, float height, float thick, bool hasDoor, Material mat, bool rotate90)
|
||||
{
|
||||
Quaternion rot = rotate90 ? Quaternion.Euler(0f, 90f, 0f) : Quaternion.identity;
|
||||
|
||||
if (!hasDoor)
|
||||
{
|
||||
GameObject wall = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
wall.name = "SolidWall";
|
||||
wall.transform.SetParent(parent);
|
||||
wall.transform.localPosition = pos;
|
||||
wall.transform.localRotation = rot;
|
||||
wall.transform.localScale = new Vector3(length, height, thick);
|
||||
if (mat != null) wall.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
else
|
||||
{
|
||||
float doorWidth = 3.6f;
|
||||
float sideWidth = Mathf.Max((length - doorWidth) * 0.5f, 0.5f);
|
||||
|
||||
// Левый сегмент
|
||||
GameObject leftPart = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
leftPart.name = "Wall_PartL";
|
||||
leftPart.transform.SetParent(parent);
|
||||
Vector3 offsetL = rotate90 ? new Vector3(0f, 0f, -(doorWidth + sideWidth) * 0.5f) : new Vector3(-(doorWidth + sideWidth) * 0.5f, 0f, 0f);
|
||||
leftPart.transform.localPosition = pos + offsetL;
|
||||
leftPart.transform.localRotation = rot;
|
||||
leftPart.transform.localScale = new Vector3(sideWidth, height, thick);
|
||||
if (mat != null) leftPart.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Правый сегмент
|
||||
GameObject rightPart = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
rightPart.name = "Wall_PartR";
|
||||
rightPart.transform.SetParent(parent);
|
||||
Vector3 offsetR = rotate90 ? new Vector3(0f, 0f, (doorWidth + sideWidth) * 0.5f) : new Vector3((doorWidth + sideWidth) * 0.5f, 0f, 0f);
|
||||
rightPart.transform.localPosition = pos + offsetR;
|
||||
rightPart.transform.localRotation = rot;
|
||||
rightPart.transform.localScale = new Vector3(sideWidth, height, thick);
|
||||
if (mat != null) rightPart.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Верхняя перемычка
|
||||
GameObject topLintel = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
topLintel.name = "Wall_TopLintel";
|
||||
topLintel.transform.SetParent(parent);
|
||||
Vector3 offsetTop = new Vector3(0f, height * 0.38f, 0f);
|
||||
topLintel.transform.localPosition = pos + offsetTop;
|
||||
topLintel.transform.localRotation = rot;
|
||||
topLintel.transform.localScale = new Vector3(doorWidth, height * 0.25f, thick);
|
||||
if (mat != null) topLintel.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
}
|
||||
|
||||
private static void BuildCorridor(Transform parent, string name, Vector3 pos, Vector3 floorSize, float height, Material mat, bool isNS)
|
||||
{
|
||||
GameObject corr = new GameObject(name);
|
||||
corr.transform.SetParent(parent);
|
||||
corr.transform.position = pos;
|
||||
|
||||
GameObject floor = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
floor.name = "Floor";
|
||||
floor.transform.SetParent(corr.transform);
|
||||
floor.transform.localPosition = Vector3.zero;
|
||||
floor.transform.localScale = floorSize;
|
||||
if (mat != null) floor.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
GameObject roof = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
roof.name = "Ceiling";
|
||||
roof.transform.SetParent(corr.transform);
|
||||
roof.transform.localPosition = new Vector3(0f, height, 0f);
|
||||
roof.transform.localScale = floorSize;
|
||||
if (mat != null) roof.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
float thick = 0.35f;
|
||||
if (isNS)
|
||||
{
|
||||
// Стены слева и справа
|
||||
float halfW = floorSize.x * 0.5f;
|
||||
GameObject wL = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
wL.name = "Wall_L";
|
||||
wL.transform.SetParent(corr.transform);
|
||||
wL.transform.localPosition = new Vector3(-halfW, height * 0.5f, 0f);
|
||||
wL.transform.localScale = new Vector3(thick, height, floorSize.z);
|
||||
if (mat != null) wL.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
GameObject wR = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
wR.name = "Wall_R";
|
||||
wR.transform.SetParent(corr.transform);
|
||||
wR.transform.localPosition = new Vector3(halfW, height * 0.5f, 0f);
|
||||
wR.transform.localScale = new Vector3(thick, height, floorSize.z);
|
||||
if (mat != null) wR.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Стены спереди и сзади
|
||||
float halfL = floorSize.z * 0.5f;
|
||||
GameObject wN = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
wN.name = "Wall_N";
|
||||
wN.transform.SetParent(corr.transform);
|
||||
wN.transform.localPosition = new Vector3(0f, height * 0.5f, halfL);
|
||||
wN.transform.localScale = new Vector3(floorSize.x, height, thick);
|
||||
if (mat != null) wN.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
GameObject wS = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
wS.name = "Wall_S";
|
||||
wS.transform.SetParent(corr.transform);
|
||||
wS.transform.localPosition = new Vector3(0f, height * 0.5f, -halfL);
|
||||
wS.transform.localScale = new Vector3(floorSize.x, height, thick);
|
||||
if (mat != null) wS.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
}
|
||||
|
||||
private static void BuildPillar(Transform parent, Vector3 pos, Vector3 size, Material mat)
|
||||
{
|
||||
GameObject p = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
p.name = "Structural_Pillar";
|
||||
p.transform.SetParent(parent);
|
||||
p.transform.localPosition = pos;
|
||||
p.transform.localScale = size;
|
||||
if (mat != null) p.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
|
||||
private static void BuildElevatorShaft(Transform parent, Vector3 pos, Material mat)
|
||||
{
|
||||
GameObject shaft = new GameObject("Arrival_Elevator_Shaft");
|
||||
shaft.transform.SetParent(parent);
|
||||
shaft.transform.position = pos;
|
||||
|
||||
Vector3[] corners = new Vector3[] {
|
||||
new Vector3(-2.2f, 1.9f, -2.2f),
|
||||
new Vector3(2.2f, 1.9f, -2.2f),
|
||||
new Vector3(-2.2f, 1.9f, 2.2f),
|
||||
new Vector3(2.2f, 1.9f, 2.2f)
|
||||
};
|
||||
|
||||
for (int i = 0; i < corners.Length; i++)
|
||||
{
|
||||
GameObject col = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
col.name = $"Shaft_Pillar_{i}";
|
||||
col.transform.SetParent(shaft.transform);
|
||||
col.transform.localPosition = corners[i];
|
||||
col.transform.localScale = new Vector3(0.25f, 3.8f, 0.25f);
|
||||
if (mat != null) col.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
}
|
||||
}
|
||||
|
||||
private static void BuildFinalEscapeAirlock(Transform parent, Vector3 pos, Material mat)
|
||||
{
|
||||
GameObject airlock = new GameObject("Final_Escape_Airlock_Zone");
|
||||
airlock.transform.SetParent(parent);
|
||||
airlock.transform.position = pos;
|
||||
|
||||
// Массивная стальная рама шлюза
|
||||
GameObject hatch = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
hatch.name = "Airlock_BlastDoor";
|
||||
hatch.transform.SetParent(airlock.transform);
|
||||
hatch.transform.localPosition = new Vector3(0f, 2.1f, 0f);
|
||||
hatch.transform.localScale = new Vector3(5f, 4.2f, 0.8f);
|
||||
if (mat != null) hatch.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Консоль управления шлюзом (терминал)
|
||||
GameObject console = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
console.name = "FinalExit_Terminal_Console";
|
||||
console.transform.SetParent(airlock.transform);
|
||||
console.transform.localPosition = new Vector3(0f, 0.6f, -2.5f);
|
||||
console.transform.localScale = new Vector3(0.9f, 1.2f, 0.5f);
|
||||
if (mat != null) console.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Экран терминала
|
||||
GameObject screen = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
screen.name = "Terminal_Screen";
|
||||
screen.transform.SetParent(console.transform);
|
||||
screen.transform.localPosition = new Vector3(0f, 0.35f, 0.05f);
|
||||
screen.transform.localRotation = Quaternion.Euler(25f, 0f, 0f);
|
||||
screen.transform.localScale = new Vector3(0.7f, 0.4f, 0.15f);
|
||||
if (mat != null) screen.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
// Световой маяк
|
||||
GameObject lightObj = new GameObject("Airlock_StatusLight");
|
||||
lightObj.transform.SetParent(console.transform);
|
||||
lightObj.transform.localPosition = new Vector3(0f, 0.75f, 0f);
|
||||
Light sl = lightObj.AddComponent<Light>();
|
||||
sl.type = LightType.Point;
|
||||
sl.color = new Color(1f, 0.35f, 0.1f);
|
||||
sl.intensity = 2.5f;
|
||||
sl.range = 6f;
|
||||
|
||||
// Скрипт финала
|
||||
var terminalComp = console.AddComponent<FinalExitTerminal>();
|
||||
terminalComp.statusLight = sl;
|
||||
terminalComp.screenRenderer = screen.GetComponent<MeshRenderer>();
|
||||
terminalComp.interactionDistance = 3.5f;
|
||||
}
|
||||
|
||||
private static void BuildBeacon(Transform parent, Vector3 pos, Color color, float intensity, float range)
|
||||
{
|
||||
GameObject beacon = new GameObject("Emergency_Beacon");
|
||||
beacon.transform.SetParent(parent);
|
||||
beacon.transform.position = pos;
|
||||
|
||||
Light l = beacon.AddComponent<Light>();
|
||||
l.type = LightType.Point;
|
||||
l.color = color;
|
||||
l.intensity = intensity;
|
||||
l.range = range;
|
||||
}
|
||||
|
||||
private static void CreateAmmoBox(Vector3 pos, int count)
|
||||
{
|
||||
GameObject box = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
box.name = $"AmmoBox_({count})";
|
||||
box.transform.position = pos;
|
||||
box.transform.localScale = new Vector3(0.6f, 0.35f, 0.45f);
|
||||
|
||||
var pickup = box.AddComponent<AmmoPickup>();
|
||||
pickup.ammoAmount = count;
|
||||
pickup.pickupOnTouch = true;
|
||||
}
|
||||
|
||||
private static void CreateThrowableProp(Vector3 pos, string name)
|
||||
{
|
||||
GameObject prop = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
|
||||
prop.name = name;
|
||||
prop.transform.position = pos;
|
||||
prop.transform.localScale = new Vector3(0.3f, 0.35f, 0.3f);
|
||||
|
||||
var rb = prop.AddComponent<Rigidbody>();
|
||||
rb.mass = 2.5f;
|
||||
|
||||
prop.layer = LayerMask.NameToLayer("Default");
|
||||
}
|
||||
|
||||
private static void SpawnMutant(GameObject prefab, Transform parent, Vector3 pos, string name)
|
||||
{
|
||||
GameObject mutant = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
|
||||
if (mutant == null) mutant = Object.Instantiate(prefab);
|
||||
mutant.name = name;
|
||||
mutant.transform.SetParent(parent);
|
||||
mutant.transform.position = pos;
|
||||
}
|
||||
|
||||
private static GameObject SpawnTitanBoss(GameObject prefab, Transform parent, Vector3 pos, string name)
|
||||
{
|
||||
GameObject boss = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
|
||||
if (boss == null) boss = Object.Instantiate(prefab);
|
||||
boss.name = name;
|
||||
boss.transform.SetParent(parent);
|
||||
boss.transform.position = pos;
|
||||
boss.transform.localScale = new Vector3(1.75f, 1.75f, 1.75f); // Массивный титан
|
||||
|
||||
// Удаляем обычный BlindMutantAI, чтобы боссом управлял специализированный TitanBossAI
|
||||
var standardAI = boss.GetComponent<BlindMutantAI>();
|
||||
if (standardAI != null) Object.DestroyImmediate(standardAI);
|
||||
|
||||
// Настраиваем здоровье босса на 200 HP
|
||||
var health = boss.GetComponent<MutantHealth>();
|
||||
if (health == null) health = boss.AddComponent<MutantHealth>();
|
||||
health.maxHealth = 200f;
|
||||
|
||||
// Добавляем специализированный интеллект босса
|
||||
var titanAI = boss.GetComponent<TitanBossAI>();
|
||||
if (titanAI == null) titanAI = boss.AddComponent<TitanBossAI>();
|
||||
titanAI.walkSpeed = 2.8f;
|
||||
titanAI.runSpeed = 4.6f;
|
||||
titanAI.meleeDamage = 18f;
|
||||
titanAI.meleeCooldown = 2.2f;
|
||||
titanAI.spitDamage = 14f;
|
||||
titanAI.spitCooldown = 8.5f;
|
||||
|
||||
// Настраиваем NavMeshAgent под габариты босса
|
||||
var agent = boss.GetComponent<UnityEngine.AI.NavMeshAgent>();
|
||||
if (agent != null)
|
||||
{
|
||||
agent.speed = 2.8f;
|
||||
agent.radius = 0.85f;
|
||||
agent.height = 3.0f;
|
||||
agent.stoppingDistance = 2.4f;
|
||||
agent.acceleration = 10f;
|
||||
}
|
||||
|
||||
// Подсветка биолюминесценции босса (багровое свечение)
|
||||
GameObject bossGlow = new GameObject("Titan_Bioluminescence");
|
||||
bossGlow.transform.SetParent(boss.transform);
|
||||
bossGlow.transform.localPosition = new Vector3(0f, 1.8f, 0f);
|
||||
Light glowLight = bossGlow.AddComponent<Light>();
|
||||
glowLight.type = LightType.Point;
|
||||
glowLight.color = new Color(0.95f, 0.15f, 0.2f);
|
||||
glowLight.range = 7.5f;
|
||||
glowLight.intensity = 2.4f;
|
||||
|
||||
return boss;
|
||||
}
|
||||
|
||||
private static void BuildBossArenaLockdown(Transform parent, Vector3 entrancePos, Material echoMat, GameObject bossObj)
|
||||
{
|
||||
GameObject arenaRoot = new GameObject("BossArena_LockdownManager");
|
||||
arenaRoot.transform.SetParent(parent);
|
||||
arenaRoot.transform.position = entrancePos;
|
||||
|
||||
// 1. Гермоворота (Blast Door) на входе в реакторную комнату (pos = 0, 0, 13)
|
||||
// Вход шириной 3.6м, высотой 4.2м
|
||||
GameObject doorObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
doorObj.name = "BlastDoor_Quarantine";
|
||||
doorObj.transform.SetParent(arenaRoot.transform);
|
||||
doorObj.transform.position = entrancePos + new Vector3(0f, 2.1f, 0f);
|
||||
doorObj.transform.localScale = new Vector3(3.8f, 4.2f, 0.45f);
|
||||
if (echoMat != null) doorObj.GetComponent<MeshRenderer>().sharedMaterial = echoMat;
|
||||
|
||||
// Добавляем NavMeshObstacle для предотвращения прохода через закрытую дверь
|
||||
var obstacle = doorObj.AddComponent<UnityEngine.AI.NavMeshObstacle>();
|
||||
obstacle.carving = true;
|
||||
obstacle.size = new Vector3(3.8f, 4.2f, 0.45f);
|
||||
|
||||
// 2. Сигнальная лампа карантина над дверью
|
||||
GameObject lampObj = new GameObject("Quarantine_EmergencyLight");
|
||||
lampObj.transform.SetParent(arenaRoot.transform);
|
||||
lampObj.transform.position = entrancePos + new Vector3(0f, 3.8f, 0.8f);
|
||||
|
||||
Light alertLight = lampObj.AddComponent<Light>();
|
||||
alertLight.type = LightType.Point;
|
||||
alertLight.color = new Color(0.2f, 0.85f, 0.35f); // До боя дежурный зеленоватый свет
|
||||
alertLight.range = 10f;
|
||||
alertLight.intensity = 1.8f;
|
||||
|
||||
// 3. Зона триггера блокировки (сразу за дверью внутри комнаты)
|
||||
GameObject triggerObj = new GameObject("Trigger_LockdownArea");
|
||||
triggerObj.transform.SetParent(arenaRoot.transform);
|
||||
triggerObj.transform.position = entrancePos + new Vector3(0f, 1.5f, 2.8f);
|
||||
|
||||
BoxCollider col = triggerObj.AddComponent<BoxCollider>();
|
||||
col.isTrigger = true;
|
||||
col.size = new Vector3(5.5f, 3.5f, 3.5f);
|
||||
|
||||
var rb = triggerObj.AddComponent<Rigidbody>();
|
||||
rb.isKinematic = true;
|
||||
|
||||
// Навешиваем BossArenaController прямо на триггер
|
||||
var arenaCtrl = triggerObj.AddComponent<BossArenaController>();
|
||||
arenaCtrl.blastDoorRoot = doorObj;
|
||||
arenaCtrl.blastDoorCollider = doorObj.GetComponent<Collider>();
|
||||
arenaCtrl.emergencyLight = alertLight;
|
||||
|
||||
if (bossObj != null)
|
||||
{
|
||||
var titanAI = bossObj.GetComponent<TitanBossAI>();
|
||||
arenaCtrl.bossAI = titanAI;
|
||||
if (titanAI != null)
|
||||
{
|
||||
titanAI.arenaController = arenaCtrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetupFinalVictoryUI()
|
||||
{
|
||||
GameObject hudCanvas = GameObject.Find("HUD_Canvas");
|
||||
if (hudCanvas == null) return;
|
||||
|
||||
// Создаем полосу здоровья босса (скрыта по умолчанию)
|
||||
BossHealthBarUI.Create(hudCanvas.transform);
|
||||
|
||||
// Создаем оверлей акустического ослепления босса (скрыт по умолчанию)
|
||||
AcousticJammerOverlay.Create(hudCanvas.transform);
|
||||
|
||||
// Проверяем, существует ли уже панель победы
|
||||
var old = hudCanvas.transform.Find("FinalVictoryPanel");
|
||||
if (old != null) Undo.DestroyObjectImmediate(old.gameObject);
|
||||
|
||||
// Корневая панель
|
||||
GameObject root = new GameObject("FinalVictoryPanel", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
|
||||
root.transform.SetParent(hudCanvas.transform, false);
|
||||
RectTransform rt = root.GetComponent<RectTransform>();
|
||||
rt.anchorMin = Vector2.zero;
|
||||
rt.anchorMax = Vector2.one;
|
||||
rt.sizeDelta = Vector2.zero;
|
||||
|
||||
Image bg = root.GetComponent<Image>();
|
||||
bg.color = new Color(0.02f, 0.02f, 0.03f, 0.95f);
|
||||
|
||||
// Карточка
|
||||
GameObject card = new GameObject("VictoryCard", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Outline));
|
||||
card.transform.SetParent(root.transform, false);
|
||||
RectTransform cardRt = card.GetComponent<RectTransform>();
|
||||
cardRt.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
cardRt.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
cardRt.pivot = new Vector2(0.5f, 0.5f);
|
||||
cardRt.sizeDelta = new Vector2(680f, 440f);
|
||||
|
||||
Image cardImg = card.GetComponent<Image>();
|
||||
cardImg.color = new Color(0.06f, 0.06f, 0.07f, 1f);
|
||||
|
||||
Outline cardOutline = card.GetComponent<Outline>();
|
||||
cardOutline.effectColor = new Color(0.2f, 0.9f, 0.5f, 0.8f);
|
||||
cardOutline.effectDistance = new Vector2(2f, -2f);
|
||||
|
||||
// Заголовок
|
||||
GameObject titleObj = new GameObject("Title", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
titleObj.transform.SetParent(card.transform, false);
|
||||
RectTransform titleRt = titleObj.GetComponent<RectTransform>();
|
||||
titleRt.anchorMin = new Vector2(0f, 1f);
|
||||
titleRt.anchorMax = new Vector2(1f, 1f);
|
||||
titleRt.pivot = new Vector2(0.5f, 1f);
|
||||
titleRt.anchoredPosition = new Vector2(0f, -25f);
|
||||
titleRt.sizeDelta = new Vector2(620f, 45f);
|
||||
|
||||
Text titleTxt = titleObj.GetComponent<Text>();
|
||||
titleTxt.text = "МИССИЯ ВЫПОЛНЕНА // ЭВАКУАЦИЯ УСПЕШНА!";
|
||||
titleTxt.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
titleTxt.fontSize = 22;
|
||||
titleTxt.fontStyle = FontStyle.Bold;
|
||||
titleTxt.alignment = TextAnchor.MiddleCenter;
|
||||
titleTxt.color = new Color(0.2f, 1.0f, 0.5f, 1.0f);
|
||||
|
||||
// Описание
|
||||
GameObject descObj = new GameObject("Description", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
descObj.transform.SetParent(card.transform, false);
|
||||
RectTransform descRt = descObj.GetComponent<RectTransform>();
|
||||
descRt.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
descRt.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
descRt.pivot = new Vector2(0.5f, 0.5f);
|
||||
descRt.anchoredPosition = new Vector2(0f, 15f);
|
||||
descRt.sizeDelta = new Vector2(580f, 140f);
|
||||
|
||||
Text descTxt = descObj.GetComponent<Text>();
|
||||
descTxt.text = "Вы успешно преодолели Сектор глубоких исследований, обошли слепых мутантов и активировали аварийный гермошлюз.\n\nКомплекс 'Synthesia' запечатан. Вы выбрались на поверхность живым!";
|
||||
descTxt.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
descTxt.fontSize = 16;
|
||||
descTxt.lineSpacing = 1.3f;
|
||||
descTxt.alignment = TextAnchor.MiddleCenter;
|
||||
descTxt.color = new Color(0.9f, 0.9f, 0.9f, 0.95f);
|
||||
|
||||
// Кнопка В главное меню
|
||||
GameObject btnMenuObj = new GameObject("MainMenuButton", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button));
|
||||
btnMenuObj.transform.SetParent(card.transform, false);
|
||||
RectTransform btnMenuRt = btnMenuObj.GetComponent<RectTransform>();
|
||||
btnMenuRt.anchorMin = new Vector2(0.5f, 0f);
|
||||
btnMenuRt.anchorMax = new Vector2(0.5f, 0f);
|
||||
btnMenuRt.pivot = new Vector2(0.5f, 0f);
|
||||
btnMenuRt.anchoredPosition = new Vector2(-150f, 30f);
|
||||
btnMenuRt.sizeDelta = new Vector2(260f, 48f);
|
||||
|
||||
Image btnMenuImg = btnMenuObj.GetComponent<Image>();
|
||||
btnMenuImg.color = new Color(0.18f, 0.18f, 0.20f, 1f);
|
||||
Button btnMenu = btnMenuObj.GetComponent<Button>();
|
||||
|
||||
GameObject menuTxtObj = new GameObject("Text", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
menuTxtObj.transform.SetParent(btnMenuObj.transform, false);
|
||||
RectTransform menuTxtRt = menuTxtObj.GetComponent<RectTransform>();
|
||||
menuTxtRt.anchorMin = Vector2.zero;
|
||||
menuTxtRt.anchorMax = Vector2.one;
|
||||
menuTxtRt.sizeDelta = Vector2.zero;
|
||||
Text mTxt = menuTxtObj.GetComponent<Text>();
|
||||
mTxt.text = "В ГЛАВНОЕ МЕНЮ";
|
||||
mTxt.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
mTxt.fontSize = 15;
|
||||
mTxt.fontStyle = FontStyle.Bold;
|
||||
mTxt.alignment = TextAnchor.MiddleCenter;
|
||||
mTxt.color = Color.white;
|
||||
|
||||
// Кнопка Начать заново
|
||||
GameObject btnRestartObj = new GameObject("RestartButton", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button));
|
||||
btnRestartObj.transform.SetParent(card.transform, false);
|
||||
RectTransform btnRestartRt = btnRestartObj.GetComponent<RectTransform>();
|
||||
btnRestartRt.anchorMin = new Vector2(0.5f, 0f);
|
||||
btnRestartRt.anchorMax = new Vector2(0.5f, 0f);
|
||||
btnRestartRt.pivot = new Vector2(0.5f, 0f);
|
||||
btnRestartRt.anchoredPosition = new Vector2(150f, 30f);
|
||||
btnRestartRt.sizeDelta = new Vector2(260f, 48f);
|
||||
|
||||
Image btnRestartImg = btnRestartObj.GetComponent<Image>();
|
||||
btnRestartImg.color = new Color(0.2f, 0.85f, 0.45f, 1f);
|
||||
Button btnRestart = btnRestartObj.GetComponent<Button>();
|
||||
|
||||
GameObject resTxtObj = new GameObject("Text", typeof(RectTransform), typeof(CanvasRenderer), typeof(Text));
|
||||
resTxtObj.transform.SetParent(btnRestartObj.transform, false);
|
||||
RectTransform resTxtRt = resTxtObj.GetComponent<RectTransform>();
|
||||
resTxtRt.anchorMin = Vector2.zero;
|
||||
resTxtRt.anchorMax = Vector2.one;
|
||||
resTxtRt.sizeDelta = Vector2.zero;
|
||||
Text rTxt = resTxtObj.GetComponent<Text>();
|
||||
rTxt.text = "ИГРАТЬ ЗАНОВО";
|
||||
rTxt.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
rTxt.fontSize = 15;
|
||||
rTxt.fontStyle = FontStyle.Bold;
|
||||
rTxt.alignment = TextAnchor.MiddleCenter;
|
||||
rTxt.color = new Color(0.05f, 0.05f, 0.05f, 1f);
|
||||
|
||||
// Компонент FinalVictoryUI
|
||||
var victoryComp = hudCanvas.GetComponent<FinalVictoryUI>();
|
||||
if (victoryComp == null) victoryComp = hudCanvas.AddComponent<FinalVictoryUI>();
|
||||
|
||||
var flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;
|
||||
victoryComp.GetType().GetField("victoryPanelRoot", flags)?.SetValue(victoryComp, root);
|
||||
victoryComp.GetType().GetField("mainMenuButton", flags)?.SetValue(victoryComp, btnMenu);
|
||||
victoryComp.GetType().GetField("restartButton", flags)?.SetValue(victoryComp, btnRestart);
|
||||
|
||||
root.SetActive(false);
|
||||
}
|
||||
|
||||
private static void BakeLevel2NavMesh()
|
||||
{
|
||||
var surface = Object.FindAnyObjectByType<NavMeshSurface>();
|
||||
if (surface == null)
|
||||
{
|
||||
GameObject sGo = new GameObject("NavMesh_Surface_Level2");
|
||||
surface = sGo.AddComponent<NavMeshSurface>();
|
||||
}
|
||||
|
||||
surface.collectObjects = CollectObjects.All;
|
||||
surface.useGeometry = NavMeshCollectGeometry.PhysicsColliders;
|
||||
surface.BuildNavMesh();
|
||||
Debug.Log("<color=green>[Level 2] NavMesh успешно запечен для Уровня 2!</color>");
|
||||
}
|
||||
|
||||
private static void RegisterSceneInBuildSettings(string scenePath)
|
||||
{
|
||||
var currentScenes = EditorBuildSettings.scenes;
|
||||
foreach (var s in currentScenes)
|
||||
{
|
||||
if (s.path == scenePath) return; // уже добавлена
|
||||
}
|
||||
|
||||
var newScenes = new EditorBuildSettingsScene[currentScenes.Length + 1];
|
||||
for (int i = 0; i < currentScenes.Length; i++)
|
||||
{
|
||||
newScenes[i] = currentScenes[i];
|
||||
}
|
||||
newScenes[newScenes.Length - 1] = new EditorBuildSettingsScene(scenePath, true);
|
||||
EditorBuildSettings.scenes = newScenes;
|
||||
Debug.Log($"<color=cyan>[BuildSettings] Сцена {scenePath} зарегистрирована в Build Settings!</color>");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03c19aecad26f9f409e2c51a57561f54
|
||||
@@ -301,40 +301,18 @@ public static class LevelStoryBuilder
|
||||
trackerObj.transform.SetParent(hudRoot, false);
|
||||
|
||||
RectTransform rt = trackerObj.AddComponent<RectTransform>();
|
||||
rt.anchorMin = new Vector2(1.0f, 1.0f);
|
||||
rt.anchorMax = new Vector2(1.0f, 1.0f);
|
||||
rt.pivot = new Vector2(1.0f, 1.0f);
|
||||
rt.anchoredPosition = new Vector2(-25f, -25f);
|
||||
rt.sizeDelta = new Vector2(260f, 68f);
|
||||
|
||||
Image bg = trackerObj.AddComponent<Image>();
|
||||
bg.color = new Color(0.04f, 0.04f, 0.04f, 0.88f);
|
||||
|
||||
Outline outline = trackerObj.AddComponent<Outline>();
|
||||
outline.effectColor = new Color(1.0f, 0.85f, 0.1f, 0.5f);
|
||||
outline.effectDistance = new Vector2(1f, -1f);
|
||||
|
||||
GameObject labelObj = new GameObject("Label");
|
||||
labelObj.transform.SetParent(trackerObj.transform, false);
|
||||
RectTransform labelRt = labelObj.AddComponent<RectTransform>();
|
||||
labelRt.anchorMin = new Vector2(0f, 0.6f);
|
||||
labelRt.anchorMax = new Vector2(1f, 1f);
|
||||
labelRt.offsetMin = new Vector2(10f, 0f);
|
||||
labelRt.offsetMax = new Vector2(-10f, -4f);
|
||||
|
||||
Text labelTxt = labelObj.AddComponent<Text>();
|
||||
labelTxt.font = defaultUiFont;
|
||||
labelTxt.fontSize = 13;
|
||||
labelTxt.fontStyle = FontStyle.Bold;
|
||||
labelTxt.alignment = TextAnchor.MiddleCenter;
|
||||
labelTxt.color = new Color(1.0f, 0.85f, 0.1f, 0.9f);
|
||||
labelTxt.text = "КОД ЛИФТА (УРОВЕНЬ 2):";
|
||||
rt.anchorMin = new Vector2(0f, 1.0f);
|
||||
rt.anchorMax = new Vector2(0f, 1.0f);
|
||||
rt.pivot = new Vector2(0f, 1.0f);
|
||||
rt.anchoredPosition = new Vector2(35f, -35f);
|
||||
rt.sizeDelta = new Vector2(210f, 50f);
|
||||
|
||||
Text[] slotTexts = new Text[4];
|
||||
Image[] slotBorders = new Image[4];
|
||||
|
||||
float startX = 25f;
|
||||
float spacing = 55f;
|
||||
float slotSize = 44f;
|
||||
float spacing = 52f;
|
||||
float startX = slotSize * 0.5f;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -342,11 +320,11 @@ public static class LevelStoryBuilder
|
||||
slotObj.transform.SetParent(trackerObj.transform, false);
|
||||
|
||||
RectTransform slotRt = slotObj.AddComponent<RectTransform>();
|
||||
slotRt.anchorMin = new Vector2(0f, 0f);
|
||||
slotRt.anchorMax = new Vector2(0f, 0.6f);
|
||||
slotRt.anchorMin = new Vector2(0f, 0.5f);
|
||||
slotRt.anchorMax = new Vector2(0f, 0.5f);
|
||||
slotRt.pivot = new Vector2(0.5f, 0.5f);
|
||||
slotRt.anchoredPosition = new Vector2(startX + i * spacing + 20f, 20f);
|
||||
slotRt.sizeDelta = new Vector2(42f, 32f);
|
||||
slotRt.anchoredPosition = new Vector2(startX + i * spacing, 0f);
|
||||
slotRt.sizeDelta = new Vector2(slotSize, slotSize);
|
||||
|
||||
Image slotBg = slotObj.AddComponent<Image>();
|
||||
slotBg.color = new Color(0.08f, 0.08f, 0.08f, 0.95f);
|
||||
@@ -365,7 +343,7 @@ public static class LevelStoryBuilder
|
||||
|
||||
Text st = txtObj.AddComponent<Text>();
|
||||
st.font = handwrittenFont;
|
||||
st.fontSize = 20;
|
||||
st.fontSize = 22;
|
||||
st.fontStyle = FontStyle.Bold;
|
||||
st.alignment = TextAnchor.MiddleCenter;
|
||||
st.color = new Color(0.45f, 0.45f, 0.45f, 0.7f);
|
||||
|
||||
@@ -89,50 +89,19 @@ public static class MainMenuSceneBuilder
|
||||
new Vector2(280f, 280f), new Vector2(-140f, 140f));
|
||||
|
||||
MenuEcholocationRadar echoRadar = radarRoot.AddComponent<MenuEcholocationRadar>();
|
||||
echoRadar.maxSimultaneousWaves = 4;
|
||||
echoRadar.waveMaxRadius = 1600f; // Расходится на весь экран
|
||||
echoRadar.waveSpeed = 240f;
|
||||
echoRadar.waveSpawnInterval = 1.7f;
|
||||
echoRadar.initialThickness = 14f;
|
||||
echoRadar.maxThickness = 52f;
|
||||
echoRadar.waveBaseColor = new Color(1.00f, 0.85f, 0.10f, 0.85f); // Яркий желтый
|
||||
echoRadar.waveCoreColor = new Color(1.00f, 0.98f, 0.55f, 1.00f); // Светло-желтое ядро
|
||||
echoRadar.beaconColor = new Color(1.00f, 0.88f, 0.15f, 1.00f);
|
||||
echoRadar.maxSimultaneousWaves = 3;
|
||||
echoRadar.waveMaxRadius = 1800f; // Расходится на весь экран
|
||||
echoRadar.waveSpeed = 180f;
|
||||
echoRadar.waveSpawnInterval = 2.4f;
|
||||
echoRadar.initialThickness = 110f;
|
||||
echoRadar.maxThickness = 360f;
|
||||
echoRadar.waveBaseColor = new Color(1.00f, 0.82f, 0.18f, 0.40f); // Теплая янтарная дымка
|
||||
echoRadar.waveCoreColor = new Color(1.00f, 0.94f, 0.50f, 0.65f); // Мягкое золотистое ядро
|
||||
echoRadar.beaconColor = new Color(1.00f, 0.88f, 0.20f, 0.85f);
|
||||
|
||||
// Визуальный корпус излучателя (Желтые концентрические кольца)
|
||||
GameObject reticleOuter = CreateImage("Radar_ReticleOuter", radarRoot.transform,
|
||||
new Color(1.00f, 0.85f, 0.10f, 0.20f),
|
||||
new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||
new Vector2(180f, 180f), Vector2.zero);
|
||||
Outline reticleOutline = reticleOuter.AddComponent<Outline>();
|
||||
reticleOutline.effectColor = new Color(1.00f, 0.85f, 0.10f, 0.35f);
|
||||
reticleOutline.effectDistance = new Vector2(1.5f, -1.5f);
|
||||
|
||||
CreateImage("Radar_ReticleInner", radarRoot.transform,
|
||||
new Color(1.00f, 0.85f, 0.10f, 0.08f),
|
||||
new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||
new Vector2(90f, 90f), Vector2.zero);
|
||||
|
||||
// Крестовина сонара
|
||||
CreateImage("Crosshair_H", radarRoot.transform,
|
||||
new Color(1.00f, 0.85f, 0.10f, 0.25f),
|
||||
new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||
new Vector2(220f, 1.5f), Vector2.zero);
|
||||
|
||||
CreateImage("Crosshair_V", radarRoot.transform,
|
||||
new Color(1.00f, 0.85f, 0.10f, 0.25f),
|
||||
new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||
new Vector2(1.5f, 220f), Vector2.zero);
|
||||
|
||||
// Пульсирующая точка в центре
|
||||
GameObject beaconObj = CreateImage("Radar_BeaconDot", radarRoot.transform,
|
||||
new Color(1.00f, 0.92f, 0.20f, 1.0f),
|
||||
new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||
new Vector2(14f, 14f), Vector2.zero);
|
||||
echoRadar.radarBeaconDot = beaconObj.GetComponent<Image>();
|
||||
echoRadar.radarReticle = reticleOuter.GetComponent<Image>();
|
||||
|
||||
// (Никакого лишнего текста в радаре нет)
|
||||
// Без лишних рамок/квадратов в углу — только чистые волны эхолокации
|
||||
echoRadar.radarBeaconDot = null;
|
||||
echoRadar.radarReticle = null;
|
||||
|
||||
// ==========================================
|
||||
// 7. НАЗВАНИЕ ИГРЫ: "Synthesia" В ЦЕНТРЕ (РУКОПИСНЫЙ ШРИФТ)
|
||||
|
||||
@@ -257,13 +257,18 @@ public class ElevatorKeypadUI : MonoBehaviour
|
||||
|
||||
private IEnumerator RoutineSuccessTransition()
|
||||
{
|
||||
yield return new WaitForSecondsRealtime(1.8f);
|
||||
CloseKeypad();
|
||||
SetStatus("ДОСТУП РАЗРЕШЕН! СПУСК НА УРОВЕНЬ 2...", successStatusColor);
|
||||
yield return new WaitForSecondsRealtime(1.2f);
|
||||
|
||||
if (LevelSuccessUI.Instance != null)
|
||||
{
|
||||
LevelSuccessUI.Instance.ShowSuccessScreen();
|
||||
}
|
||||
|
||||
yield return new WaitForSecondsRealtime(1.2f);
|
||||
|
||||
Time.timeScale = 1f;
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene("Level2");
|
||||
}
|
||||
|
||||
private void UpdateDisplay()
|
||||
|
||||
@@ -147,6 +147,11 @@ public class ElevatorTerminal : MonoBehaviour
|
||||
{
|
||||
LevelSuccessUI.Instance.ShowSuccessScreen();
|
||||
}
|
||||
else
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene("Level2");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
/// <summary>
|
||||
/// Финальный терминал аварийной эвакуации на 2-м уровне.
|
||||
/// При взаимодействии по клавише [E] запускает процедуру открытия эвакуационного шлюза и победный экран.
|
||||
/// </summary>
|
||||
public class FinalExitTerminal : MonoBehaviour
|
||||
{
|
||||
[Header("Настройки")]
|
||||
public float interactionDistance = 3.5f;
|
||||
public Light statusLight;
|
||||
public MeshRenderer screenRenderer;
|
||||
|
||||
private bool isActivated = false;
|
||||
private static Transform cachedPlayer;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
LocatePlayer();
|
||||
if (statusLight != null)
|
||||
{
|
||||
statusLight.color = new Color(1f, 0.4f, 0.1f); // Оранжевый аварийный
|
||||
}
|
||||
|
||||
var col = GetComponent<Collider>();
|
||||
if (col == null)
|
||||
{
|
||||
var sc = gameObject.AddComponent<SphereCollider>();
|
||||
sc.isTrigger = true;
|
||||
sc.radius = interactionDistance;
|
||||
}
|
||||
}
|
||||
|
||||
private Transform LocatePlayer()
|
||||
{
|
||||
if (cachedPlayer != null) return cachedPlayer;
|
||||
var pm = Object.FindAnyObjectByType<PlayerMovement>();
|
||||
if (pm != null) { cachedPlayer = pm.transform; return cachedPlayer; }
|
||||
var pTag = GameObject.FindWithTag("Player");
|
||||
if (pTag != null) { cachedPlayer = pTag.transform; return cachedPlayer; }
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (isActivated) return;
|
||||
if (Time.timeScale == 0f) return;
|
||||
|
||||
Transform player = LocatePlayer();
|
||||
if (player == null) return;
|
||||
|
||||
float dist = Vector3.Distance(transform.position, player.position);
|
||||
if (dist <= interactionDistance)
|
||||
{
|
||||
var keyboard = Keyboard.current;
|
||||
if (keyboard != null && (keyboard.eKey.wasPressedThisFrame || keyboard.enterKey.wasPressedThisFrame))
|
||||
{
|
||||
ActivateExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (isActivated) return;
|
||||
if (Time.timeScale == 0f) return;
|
||||
|
||||
if (other.CompareTag("Player") || other.GetComponentInParent<PlayerMovement>() != null)
|
||||
{
|
||||
var keyboard = Keyboard.current;
|
||||
if (keyboard != null && (keyboard.eKey.wasPressedThisFrame || keyboard.enterKey.wasPressedThisFrame))
|
||||
{
|
||||
ActivateExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ActivateExit()
|
||||
{
|
||||
if (isActivated) return;
|
||||
|
||||
// Проверяем, жив ли босс
|
||||
var boss = Object.FindAnyObjectByType<TitanBossAI>();
|
||||
if (boss != null && boss.CurrentState != TitanBossAI.BossState.Dead)
|
||||
{
|
||||
GameAudioSynthesizer.PlayErrorCode();
|
||||
Debug.Log("<color=red>[FinalExit] ОШИБКА: Шлюз заблокирован протоколом карантина! Устраните Альфа-Мутанта.</color>");
|
||||
return;
|
||||
}
|
||||
|
||||
isActivated = true;
|
||||
|
||||
if (statusLight != null)
|
||||
{
|
||||
statusLight.color = new Color(0.2f, 1f, 0.4f); // Зеленый
|
||||
statusLight.intensity = 4.0f;
|
||||
}
|
||||
|
||||
GameAudioSynthesizer.PlaySuccessChime();
|
||||
|
||||
var victoryUI = Object.FindAnyObjectByType<FinalVictoryUI>(FindObjectsInactive.Include);
|
||||
if (victoryUI != null)
|
||||
{
|
||||
victoryUI.ShowVictoryScreen();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("<color=green>[FinalExit] Эвакуационный шлюз открыт! Игра завершена!</color>");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b75606c2085ed84cb2faaf3dede82e8
|
||||
@@ -0,0 +1,75 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Финальный экран победы при успешном завершении игры на 2-м уровне.
|
||||
/// </summary>
|
||||
public class FinalVictoryUI : MonoBehaviour
|
||||
{
|
||||
private static FinalVictoryUI _instance;
|
||||
public static FinalVictoryUI Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = Object.FindAnyObjectByType<FinalVictoryUI>(FindObjectsInactive.Include);
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
[Header("Корневая панель")]
|
||||
[SerializeField] private GameObject victoryPanelRoot;
|
||||
|
||||
public bool IsOpen => victoryPanelRoot != null && victoryPanelRoot.activeInHierarchy;
|
||||
|
||||
[Header("Кнопки")]
|
||||
[SerializeField] private Button restartButton;
|
||||
[SerializeField] private Button mainMenuButton;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
if (victoryPanelRoot == null)
|
||||
victoryPanelRoot = gameObject;
|
||||
|
||||
if (restartButton != null)
|
||||
{
|
||||
restartButton.onClick.RemoveAllListeners();
|
||||
restartButton.onClick.AddListener(OnRestartGameClicked);
|
||||
}
|
||||
|
||||
if (mainMenuButton != null)
|
||||
{
|
||||
mainMenuButton.onClick.RemoveAllListeners();
|
||||
mainMenuButton.onClick.AddListener(OnMainMenuClicked);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowVictoryScreen()
|
||||
{
|
||||
if (!gameObject.activeSelf) gameObject.SetActive(true);
|
||||
if (victoryPanelRoot != null)
|
||||
victoryPanelRoot.SetActive(true);
|
||||
|
||||
Time.timeScale = 0f;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Cursor.visible = true;
|
||||
|
||||
GameAudioSynthesizer.PlaySuccessChime();
|
||||
}
|
||||
|
||||
private void OnRestartGameClicked()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
SceneManager.LoadScene("SampleScene"); // Начать с 1-го уровня
|
||||
}
|
||||
|
||||
private void OnMainMenuClicked()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
SceneManager.LoadScene("MainMenu");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5f8453456c9d1244b7055a84924499c
|
||||
@@ -120,6 +120,188 @@ public static class GameAudioSynthesizer
|
||||
PlayOneShot(clip, 0.4f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Звук сочного плевка слюны изо рта (хлёсткий выброс сжатого воздуха и мокрый хлопок)
|
||||
/// </summary>
|
||||
public static void PlayAcidSpitSound()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 0.28f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / samples;
|
||||
// Фаза 1: резкий хлёсткий хлопок воздуха пасти
|
||||
float popEnv = Mathf.Exp(-t * 22f);
|
||||
float popTone = Mathf.Sin(2f * Mathf.PI * Mathf.Lerp(650f, 160f, t) * ((float)i / sampleRate));
|
||||
|
||||
// Фаза 2: свист и шипение вылетающей тягучей жидкости
|
||||
float hissEnv = Mathf.Sin(t * Mathf.PI) * Mathf.Exp(-t * 4.5f);
|
||||
float hissNoise = ((float)rnd.NextDouble() * 2f - 1f) * 0.42f;
|
||||
|
||||
// Фаза 3: влажное клокотание
|
||||
float wetBubble = Mathf.Sin(2f * Mathf.PI * 90f * ((float)i / sampleRate)) * 0.25f;
|
||||
|
||||
data[i] = (popTone * 0.7f * popEnv) + (hissNoise + wetBubble) * hissEnv;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("SalivaSpit", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.75f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Звук смачного шлепка слюны о поверхность и шипения токсина
|
||||
/// </summary>
|
||||
public static void PlayAcidImpact()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 0.32f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / samples;
|
||||
// Резкий мокрый шлепок в начале
|
||||
float slapEnv = Mathf.Exp(-t * 18f);
|
||||
float slap = ((float)rnd.NextDouble() * 2f - 1f) * 0.65f + Mathf.Sin(2f * Mathf.PI * 130f * ((float)i / sampleRate)) * 0.35f;
|
||||
|
||||
// Последующее шипение кислоты
|
||||
float sizzleEnv = (1f - t) * Mathf.Exp(-t * 3.5f);
|
||||
float sizzle = ((float)rnd.NextDouble() * 2f - 1f) * 0.35f;
|
||||
|
||||
data[i] = (slap * slapEnv) + (sizzle * sizzleEnv * 0.6f);
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("SalivaImpact", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.8f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Звук шипения кислоты на полу
|
||||
/// </summary>
|
||||
public static void PlayAcidHiss()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 0.5f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / samples;
|
||||
float env = 1f - t;
|
||||
float hiss = ((float)rnd.NextDouble() * 2f - 1f) * 0.22f;
|
||||
data[i] = hiss * env;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("AcidHiss", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.35f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Оглушительный ультразвуковой крик босса, вызывающий акустическое ослепление
|
||||
/// </summary>
|
||||
public static void PlayAcousticScreech()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 1.5f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / sampleRate;
|
||||
float env = Mathf.Clamp01(t / 0.15f) * Mathf.Pow(1f - (float)i / samples, 0.8f);
|
||||
float lowRumble = Mathf.Sin(2f * Mathf.PI * 65f * t) * 0.5f;
|
||||
float screechFreq = Mathf.Lerp(1600f, 2800f, Mathf.PingPong(t * 3f, 1f));
|
||||
float screech = Mathf.Sin(2f * Mathf.PI * screechFreq * t) * 0.35f;
|
||||
float distortion = ((float)rnd.NextDouble() * 2f - 1f) * 0.2f;
|
||||
data[i] = Mathf.Clamp((lowRumble + screech + distortion) * env, -1f, 1f) * 0.8f;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("AcousticScreech", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.85f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Глухой рев босса при пробуждении
|
||||
/// </summary>
|
||||
public static void PlayBossRoar()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 1.8f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / sampleRate;
|
||||
float env = Mathf.Clamp01(t / 0.2f) * Mathf.Pow(1f - (float)i / samples, 0.7f);
|
||||
float pitch = Mathf.Lerp(120f, 50f, (float)i / samples);
|
||||
float roar = Mathf.Sin(2f * Mathf.PI * pitch * t) * 0.6f;
|
||||
float growl = Mathf.Sin(2f * Mathf.PI * (pitch * 0.5f) * t) * 0.4f;
|
||||
float noise = ((float)rnd.NextDouble() * 2f - 1f) * 0.25f;
|
||||
data[i] = Mathf.Clamp((roar + growl + noise) * env, -1f, 1f) * 0.9f;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("BossRoar", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.9f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Сигнал тревоги и карантинной блокировки
|
||||
/// </summary>
|
||||
public static void PlayLockdownAlarm()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 0.9f);
|
||||
float[] data = new float[samples];
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / sampleRate;
|
||||
float freq = Mathf.Sin(2f * Mathf.PI * 2.5f * t) > 0f ? 880f : 660f;
|
||||
float env = 1f - ((float)i / samples);
|
||||
data[i] = Mathf.Sin(2f * Mathf.PI * freq * t) * env * 0.5f;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("LockdownAlarm", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.6f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Звук гидравлических ворот / разблокировки шлюза
|
||||
/// </summary>
|
||||
public static void PlayDoorHydraulic()
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
int samples = (int)(sampleRate * 0.8f);
|
||||
float[] data = new float[samples];
|
||||
System.Random rnd = new System.Random();
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
float t = (float)i / samples;
|
||||
float env = Mathf.Sin(t * Mathf.PI);
|
||||
float steam = ((float)rnd.NextDouble() * 2f - 1f) * 0.25f;
|
||||
float lowClank = Mathf.Sin(2f * Mathf.PI * 90f * ((float)i / sampleRate)) * 0.35f;
|
||||
data[i] = (steam + lowClank) * env;
|
||||
}
|
||||
|
||||
AudioClip clip = AudioClip.Create("DoorHydraulic", samples, 1, sampleRate, false);
|
||||
clip.SetData(data, 0);
|
||||
PlayOneShot(clip, 0.65f);
|
||||
}
|
||||
|
||||
private static AudioClip CreateToneClip(float frequency, float duration, float volume)
|
||||
{
|
||||
int sampleRate = 44100;
|
||||
|
||||
@@ -54,17 +54,26 @@ public class LevelSuccessUI : MonoBehaviour
|
||||
if (successPanelRoot != null)
|
||||
successPanelRoot.SetActive(true);
|
||||
|
||||
Time.timeScale = 0f;
|
||||
Time.timeScale = 1f;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Cursor.visible = true;
|
||||
|
||||
GameAudioSynthesizer.PlaySuccessChime();
|
||||
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(RoutineAutoTransition());
|
||||
}
|
||||
|
||||
private void OnNextLevelClicked()
|
||||
private System.Collections.IEnumerator RoutineAutoTransition()
|
||||
{
|
||||
yield return new WaitForSecondsRealtime(2.0f);
|
||||
OnNextLevelClicked();
|
||||
}
|
||||
|
||||
public void OnNextLevelClicked()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||
SceneManager.LoadScene("Level2");
|
||||
}
|
||||
|
||||
private void OnMainMenuClicked()
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Процедурный рендерер объемных, мягких облачных волн эхолокации для Главного Меню.
|
||||
/// Формирует многослойный шлейф с плавным гауссовым рассеиванием и органическими пульсациями,
|
||||
/// в точности повторяя эффект стелс-эхолокации из геймплея.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(CanvasRenderer))]
|
||||
public class MenuEchoWaveRenderer : MaskableGraphic
|
||||
{
|
||||
[Range(24, 120)]
|
||||
[Range(36, 120)]
|
||||
public int segments = 72;
|
||||
|
||||
[Tooltip("Текущий радиус кольца в пикселях")]
|
||||
[Tooltip("Текущий радиус волны в пикселях")]
|
||||
public float radius = 0f;
|
||||
|
||||
[Tooltip("Толщина светящейся полосы волны")]
|
||||
public float thickness = 28f;
|
||||
[Tooltip("Широкая полоса рассеивания тумана")]
|
||||
public float thickness = 180f;
|
||||
|
||||
[Tooltip("Яркость/прозрачность волны (0 - 1)")]
|
||||
[Tooltip("Общая прозрачность волны (0 - 1)")]
|
||||
[Range(0f, 1f)]
|
||||
public float waveAlpha = 1f;
|
||||
|
||||
[Header("Цвета свечения")]
|
||||
public Color waveColor = new Color(0.00f, 0.90f, 1.0f, 1.0f); // Неоновый циан
|
||||
public Color coreColor = new Color(0.40f, 1.00f, 0.95f, 1.0f); // Яркое ядро
|
||||
[Header("Цветовая палитра тумана")]
|
||||
public Color waveColor = new Color(1.00f, 0.82f, 0.20f, 0.40f); // Рассеянный золотой туман
|
||||
public Color coreColor = new Color(1.00f, 0.94f, 0.50f, 0.70f); // Мягкое ядро свечения
|
||||
|
||||
public void SetWave(float currentRadius, float currentThickness, float currentAlpha, Color baseColor, Color highlightColor)
|
||||
{
|
||||
@@ -35,50 +39,73 @@ public class MenuEchoWaveRenderer : MaskableGraphic
|
||||
protected override void OnPopulateMesh(VertexHelper vh)
|
||||
{
|
||||
vh.Clear();
|
||||
if (radius <= 0.5f || thickness <= 0.5f || waveAlpha <= 0.001f) return;
|
||||
if (radius <= 1f || thickness <= 1f || waveAlpha <= 0.002f) return;
|
||||
|
||||
float halfThick = thickness * 0.5f;
|
||||
float rInner = Mathf.Max(0f, radius - halfThick);
|
||||
float rCenter = radius;
|
||||
float rOuter = radius + halfThick;
|
||||
// Коэффициенты распределения слоев для мягкого профиля "облака"
|
||||
// 6 колец = 5 полос плавного спада (хвост тумана -> ядро -> мягкий передний фронт)
|
||||
float[] ringOffsets = new float[] { -0.65f, -0.32f, -0.05f, 0.15f, 0.38f, 0.60f };
|
||||
float[] ringAlphas = new float[] { 0.00f, 0.30f, 0.65f, 0.75f, 0.25f, 0.00f };
|
||||
|
||||
Color edgeCol = new Color(waveColor.r, waveColor.g, waveColor.b, 0f);
|
||||
Color midCol = new Color(coreColor.r, coreColor.g, coreColor.b, coreColor.a * waveAlpha);
|
||||
int ringCount = ringOffsets.Length;
|
||||
Color[] ringColors = new Color[ringCount];
|
||||
|
||||
for (int r = 0; r < ringCount; r++)
|
||||
{
|
||||
float t = (float)r / (ringCount - 1);
|
||||
// Плавное смешивание базового цвета дымки и ядра
|
||||
Color col = Color.Lerp(waveColor, coreColor, Mathf.Sin(t * Mathf.PI));
|
||||
col.a = ringAlphas[r] * waveAlpha;
|
||||
ringColors[r] = col;
|
||||
}
|
||||
|
||||
float angleStep = 360f / segments;
|
||||
|
||||
// Предварительный буфер для двух шагов угла (текущий и следующий)
|
||||
Vector2[] pts1 = new Vector2[ringCount];
|
||||
Vector2[] pts2 = new Vector2[ringCount];
|
||||
|
||||
CalculateRingPoints(0f, ringOffsets, pts1);
|
||||
|
||||
for (int i = 0; i < segments; i++)
|
||||
{
|
||||
float a1 = i * angleStep * Mathf.Deg2Rad;
|
||||
float a2 = (i + 1) * angleStep * Mathf.Deg2Rad;
|
||||
CalculateRingPoints(a2, ringOffsets, pts2);
|
||||
|
||||
Vector2 dir1 = new Vector2(Mathf.Cos(a1), Mathf.Sin(a1));
|
||||
Vector2 dir2 = new Vector2(Mathf.Cos(a2), Mathf.Sin(a2));
|
||||
// Соединяем соседние кольца квадами (2 треугольника на слой)
|
||||
for (int r = 0; r < ringCount - 1; r++)
|
||||
{
|
||||
int vIdx = vh.currentVertCount;
|
||||
|
||||
Vector2 pIn1 = dir1 * rInner;
|
||||
Vector2 pIn2 = dir2 * rInner;
|
||||
Vector2 pMid1 = dir1 * rCenter;
|
||||
Vector2 pMid2 = dir2 * rCenter;
|
||||
Vector2 pOut1 = dir1 * rOuter;
|
||||
Vector2 pOut2 = dir2 * rOuter;
|
||||
vh.AddVert(pts1[r], ringColors[r], Vector2.zero);
|
||||
vh.AddVert(pts1[r + 1], ringColors[r + 1], Vector2.zero);
|
||||
vh.AddVert(pts2[r + 1], ringColors[r + 1], Vector2.zero);
|
||||
vh.AddVert(pts2[r], ringColors[r], Vector2.zero);
|
||||
|
||||
// 1. Полоса: от внутреннего прозрачного края к яркому центру
|
||||
int idx1 = vh.currentVertCount;
|
||||
vh.AddVert(pIn1, edgeCol, Vector2.zero);
|
||||
vh.AddVert(pMid1, midCol, Vector2.zero);
|
||||
vh.AddVert(pMid2, midCol, Vector2.zero);
|
||||
vh.AddVert(pIn2, edgeCol, Vector2.zero);
|
||||
vh.AddTriangle(idx1, idx1 + 1, idx1 + 2);
|
||||
vh.AddTriangle(idx1, idx1 + 2, idx1 + 3);
|
||||
vh.AddTriangle(vIdx, vIdx + 1, vIdx + 2);
|
||||
vh.AddTriangle(vIdx, vIdx + 2, vIdx + 3);
|
||||
}
|
||||
|
||||
// 2. Полоса: от яркого центра к внешнему прозрачному краю
|
||||
int idx2 = vh.currentVertCount;
|
||||
vh.AddVert(pMid1, midCol, Vector2.zero);
|
||||
vh.AddVert(pOut1, edgeCol, Vector2.zero);
|
||||
vh.AddVert(pOut2, edgeCol, Vector2.zero);
|
||||
vh.AddVert(pMid2, midCol, Vector2.zero);
|
||||
vh.AddTriangle(idx2, idx2 + 1, idx2 + 2);
|
||||
vh.AddTriangle(idx2, idx2 + 2, idx2 + 3);
|
||||
// Переносим точки для следующего шага
|
||||
for (int r = 0; r < ringCount; r++)
|
||||
{
|
||||
pts1[r] = pts2[r];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateRingPoints(float radAngle, float[] offsets, Vector2[] outPts)
|
||||
{
|
||||
Vector2 dir = new Vector2(Mathf.Cos(radAngle), Mathf.Sin(radAngle));
|
||||
|
||||
// Органическая деформация облака: легкие акустические неровности и клубы
|
||||
float billow1 = Mathf.Sin(radAngle * 4f + radius * 0.015f) * (thickness * 0.07f);
|
||||
float billow2 = Mathf.Cos(radAngle * 7f - radius * 0.010f) * (thickness * 0.04f);
|
||||
float organicRadius = radius + billow1 + billow2;
|
||||
|
||||
for (int r = 0; r < offsets.Length; r++)
|
||||
{
|
||||
float ringR = Mathf.Max(0f, organicRadius + offsets[r] * thickness);
|
||||
outPts[r] = dir * ringR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,18 +3,18 @@ using UnityEngine.UI;
|
||||
|
||||
public class MenuEcholocationRadar : MonoBehaviour
|
||||
{
|
||||
[Header("Настройки волн эхолокации")]
|
||||
public int maxSimultaneousWaves = 4;
|
||||
public float waveMaxRadius = 1400f;
|
||||
public float waveSpeed = 220f;
|
||||
public float waveSpawnInterval = 1.6f;
|
||||
public float initialThickness = 16f;
|
||||
public float maxThickness = 48f;
|
||||
[Header("Настройки волн эхолокации (Мягкие облака)")]
|
||||
public int maxSimultaneousWaves = 3;
|
||||
public float waveMaxRadius = 1800f;
|
||||
public float waveSpeed = 180f;
|
||||
public float waveSpawnInterval = 2.4f;
|
||||
public float initialThickness = 110f;
|
||||
public float maxThickness = 360f;
|
||||
|
||||
[Header("Цветовая палитра волн (Dark Sci-Fi - Yellow)")]
|
||||
public Color waveBaseColor = new Color(1.00f, 0.85f, 0.10f, 0.85f); // Неоновый желтый
|
||||
public Color waveCoreColor = new Color(1.00f, 0.98f, 0.55f, 1.00f); // Яркое ядро
|
||||
public Color beaconColor = new Color(1.00f, 0.88f, 0.15f, 1.00f);
|
||||
[Header("Цветовая палитра волн (Мягкий золотистый туман)")]
|
||||
public Color waveBaseColor = new Color(1.00f, 0.82f, 0.18f, 0.40f); // Теплая янтарная дымка
|
||||
public Color waveCoreColor = new Color(1.00f, 0.94f, 0.50f, 0.65f); // Мягкое золотистое ядро
|
||||
public Color beaconColor = new Color(1.00f, 0.88f, 0.20f, 0.85f);
|
||||
|
||||
[Header("Радарный маяк (В углу экрана)")]
|
||||
public Image radarBeaconDot;
|
||||
@@ -85,13 +85,13 @@ public class MenuEcholocationRadar : MonoBehaviour
|
||||
w.radius += waveSpeed * dt;
|
||||
float progress = Mathf.Clamp01(w.radius / waveMaxRadius);
|
||||
|
||||
// Плавное появление (Fade-in) в начале и плавное растворение (Fade-out) к краю экрана
|
||||
float fadeIn = Mathf.SmoothStep(0f, 1f, progress / 0.15f);
|
||||
float fadeOut = Mathf.Pow(1f - progress, 1.4f);
|
||||
// Плавное появление (Fade-in) в начале и глубокое мягкое растворение (Fade-out)
|
||||
float fadeIn = Mathf.SmoothStep(0f, 1f, progress / 0.18f);
|
||||
float fadeOut = Mathf.Pow(1f - progress, 1.25f);
|
||||
float alpha = fadeIn * fadeOut;
|
||||
|
||||
// Расширение полосы с увеличением радиуса (физика дисперсии звуковой волны)
|
||||
float currentThickness = Mathf.Lerp(initialThickness, maxThickness, progress);
|
||||
// Расширение полосы с увеличением радиуса (мягкое рассеивание облака тумана)
|
||||
float currentThickness = Mathf.Lerp(initialThickness, maxThickness, Mathf.Sqrt(progress));
|
||||
|
||||
w.renderer.SetWave(w.radius, currentThickness, alpha, waveBaseColor, waveCoreColor);
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@ public class MutantHealth : MonoBehaviour
|
||||
public bool IsDead => currentHealth <= 0;
|
||||
public float CurrentHealth => currentHealth;
|
||||
|
||||
public System.Action<float, float> OnHealthChanged;
|
||||
public System.Action OnDied;
|
||||
|
||||
private BlindMutantAI mutantAI;
|
||||
|
||||
void Awake()
|
||||
@@ -23,6 +26,8 @@ public class MutantHealth : MonoBehaviour
|
||||
currentHealth -= damage;
|
||||
Debug.Log($"Мутант получил урон: {damage}! Осталось: {currentHealth}");
|
||||
|
||||
OnHealthChanged?.Invoke(currentHealth, maxHealth);
|
||||
|
||||
if (mutantAI != null && attacker != null)
|
||||
{
|
||||
mutantAI.OnDamagedByPlayer(attacker);
|
||||
@@ -37,6 +42,7 @@ public class MutantHealth : MonoBehaviour
|
||||
private void Die()
|
||||
{
|
||||
Debug.Log("МУТАНТ УМЕР!");
|
||||
OnDied?.Invoke();
|
||||
var anim = GetComponentInChildren<Animator>();
|
||||
if (anim != null)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ public class PauseMenu : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
AutoWireUI();
|
||||
}
|
||||
|
||||
@@ -69,6 +70,7 @@ public class PauseMenu : MonoBehaviour
|
||||
if (NoteViewerUI.Instance != null && NoteViewerUI.Instance.IsOpen) return;
|
||||
if (ElevatorKeypadUI.Instance != null && ElevatorKeypadUI.Instance.IsOpen) return;
|
||||
if (LevelSuccessUI.Instance != null && LevelSuccessUI.Instance.IsOpen) return;
|
||||
if (FinalVictoryUI.Instance != null && FinalVictoryUI.Instance.IsOpen) return;
|
||||
|
||||
bool togglePause = false;
|
||||
var keyboard = Keyboard.current;
|
||||
|
||||
@@ -59,9 +59,8 @@ public class PlayerAmmoUI : MonoBehaviour
|
||||
|
||||
if (statusText != null)
|
||||
{
|
||||
statusText.gameObject.SetActive(true);
|
||||
statusText.text = "[2] ВЗЯТЬ ОРУЖИЕ";
|
||||
statusText.color = normalColor;
|
||||
statusText.text = "";
|
||||
statusText.gameObject.SetActive(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -118,9 +117,8 @@ public class PlayerAmmoUI : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
statusText.gameObject.SetActive(true);
|
||||
statusText.text = "[1] УБРАТЬ ОРУЖИЕ";
|
||||
statusText.color = new Color(0.85f, 0.85f, 0.85f, 0.75f);
|
||||
statusText.text = "";
|
||||
statusText.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ public class PlayerGun : MonoBehaviour
|
||||
public Transform casingExitPoint; // Точка выброса гильзы
|
||||
|
||||
[Header("Экипировка оружия")]
|
||||
[Tooltip("Находится ли оружие сейчас в руках")]
|
||||
public bool isGunEquipped = false; // По умолчанию убрано в кобуру (в руках кулаки)
|
||||
public bool isGunEquipped = true; // По умолчанию оружие сразу в руках
|
||||
public bool hasGun = true; // Есть ли у игрока огнестрел
|
||||
public AudioClip equipSound; // Звук доставания оружия
|
||||
public AudioClip holsterSound; // Звук убирания оружия
|
||||
|
||||
@@ -32,6 +32,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
controller = GetComponent<CharacterController>();
|
||||
if (cam == null && Camera.main != null)
|
||||
cam = Camera.main.transform;
|
||||
|
||||
@@ -0,0 +1,450 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
/// <summary>
|
||||
/// Искусственный интеллект уникального Босса 2-го уровня («Тип-0: Альфа-Мутант / Патриарх»).
|
||||
/// Механики:
|
||||
/// 1. Мощная рукопашная атака (40 урона) вблизи.
|
||||
/// 2. Дальняя атака: кислотный плевок с созданием волны эхолокации при ударе и ядовитой лужи.
|
||||
/// 3. Акустическое ослепление (Blackout Screech): оглушающий крик, полностью блокирующий эхолокацию на 4.5с.
|
||||
/// 4. Изолированная комната-арена с карантинной блокировкой дверей до победы над боссом.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(NavMeshAgent))]
|
||||
[RequireComponent(typeof(MutantHealth))]
|
||||
public class TitanBossAI : MonoBehaviour
|
||||
{
|
||||
[Header("Идентификация босса")]
|
||||
public string bossDisplayName = "ТИП-0: АЛЬФА-МУТАНТ (ПАТРИАРХ)";
|
||||
|
||||
[Header("Параметры движения")]
|
||||
public float walkSpeed = 2.8f;
|
||||
public float runSpeed = 4.6f;
|
||||
public float stoppingDistance = 2.0f;
|
||||
|
||||
[Header("Ближний бой")]
|
||||
public float meleeRange = 2.4f;
|
||||
public float meleeDamage = 18f;
|
||||
public float meleeCooldown = 2.2f;
|
||||
private float nextMeleeTime = 0f;
|
||||
|
||||
[Header("Дальний бой (Кислотный плевок)")]
|
||||
public float spitMinDistance = 5.0f;
|
||||
public float spitCooldown = 8.5f;
|
||||
public float spitDamage = 14f;
|
||||
private float nextSpitTime = 0f;
|
||||
|
||||
[Header("Акустическое ослепление (Крик слепоты)")]
|
||||
public float screechCooldown = 17f;
|
||||
public float blindnessDuration = 4.5f;
|
||||
private float nextScreechTime = 0f;
|
||||
private bool hasEnragedBelowHalf = false;
|
||||
|
||||
[Header("Ссылки на компоненты")]
|
||||
public Transform mouthSpawnPoint;
|
||||
public BossArenaController arenaController;
|
||||
|
||||
private NavMeshAgent agent;
|
||||
private Animator animator;
|
||||
private MutantHealth health;
|
||||
private Transform player;
|
||||
private PlayerHealth playerHealth;
|
||||
|
||||
public enum BossState { Dormant, Roaring, Combat, Screeching, Spitting, Dead }
|
||||
public BossState CurrentState { get; private set; } = BossState.Dormant;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
agent = GetComponent<NavMeshAgent>();
|
||||
animator = GetComponentInChildren<Animator>();
|
||||
health = GetComponent<MutantHealth>();
|
||||
|
||||
// Увеличиваем здоровье босса (200 HP)
|
||||
health.maxHealth = 200f;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Игрок
|
||||
GameObject pObj = GameObject.FindWithTag("Player") ?? GameObject.Find("Player");
|
||||
if (pObj != null)
|
||||
{
|
||||
player = pObj.transform;
|
||||
playerHealth = pObj.GetComponent<PlayerHealth>();
|
||||
}
|
||||
|
||||
if (agent != null)
|
||||
{
|
||||
agent.speed = walkSpeed;
|
||||
agent.stoppingDistance = stoppingDistance;
|
||||
agent.isStopped = true;
|
||||
|
||||
if (!agent.isOnNavMesh)
|
||||
{
|
||||
if (NavMesh.SamplePosition(transform.position, out NavMeshHit hit, 5.0f, NavMesh.AllAreas))
|
||||
{
|
||||
agent.Warp(hit.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Подписываемся на события здоровья
|
||||
if (health != null)
|
||||
{
|
||||
health.OnHealthChanged += HandleHealthChanged;
|
||||
health.OnDied += HandleDeath;
|
||||
}
|
||||
|
||||
// Назначаем точку рта для плевка прямо в пасти головы монстра
|
||||
if (mouthSpawnPoint == null)
|
||||
{
|
||||
Transform headBone = null;
|
||||
foreach (var t in GetComponentsInChildren<Transform>())
|
||||
{
|
||||
if (t.name == "head") { headBone = t; break; }
|
||||
}
|
||||
|
||||
GameObject mouth = new GameObject("MouthPoint");
|
||||
if (headBone != null)
|
||||
{
|
||||
mouth.transform.SetParent(headBone, false);
|
||||
// Смещение в пасть монстра относительно кости головы
|
||||
mouth.transform.localPosition = new Vector3(-0.08f, 0.25f, 0.32f);
|
||||
}
|
||||
else
|
||||
{
|
||||
mouth.transform.SetParent(transform, false);
|
||||
mouth.transform.localPosition = new Vector3(0f, 2.75f, 0.55f);
|
||||
}
|
||||
mouthSpawnPoint = mouth.transform;
|
||||
}
|
||||
|
||||
nextSpitTime = Time.time + 4f;
|
||||
nextScreechTime = Time.time + 12f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Вызывается триггером комнаты, когда игрок заходит на арену и двери блокируются
|
||||
/// </summary>
|
||||
public void WakeUp()
|
||||
{
|
||||
if (CurrentState != BossState.Dormant) return;
|
||||
|
||||
StartCoroutine(RoutineWakeUpRoar());
|
||||
}
|
||||
|
||||
private IEnumerator RoutineWakeUpRoar()
|
||||
{
|
||||
CurrentState = BossState.Roaring;
|
||||
|
||||
// Поворачиваемся к игроку
|
||||
if (player != null)
|
||||
{
|
||||
Vector3 lookDir = (player.position - transform.position);
|
||||
lookDir.y = 0;
|
||||
if (lookDir.sqrMagnitude > 0.01f) transform.rotation = Quaternion.LookRotation(lookDir);
|
||||
}
|
||||
|
||||
// Рев пробуждения
|
||||
GameAudioSynthesizer.PlayBossRoar();
|
||||
|
||||
// Отображаем здоровье на экране
|
||||
if (BossHealthBarUI.Instance != null && health != null)
|
||||
{
|
||||
BossHealthBarUI.Instance.ShowBoss(bossDisplayName, health.CurrentHealth, health.maxHealth);
|
||||
}
|
||||
|
||||
// Создаем мощную волну эхолокации от рева
|
||||
if (EchoTrigger.Instance != null)
|
||||
{
|
||||
EchoTrigger.Instance.TriggerExternalWave(transform.position, 28f, 3.5f);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(1.8f);
|
||||
|
||||
if (CurrentState != BossState.Dead)
|
||||
{
|
||||
CurrentState = BossState.Combat;
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (CurrentState == BossState.Dormant || CurrentState == BossState.Dead)
|
||||
{
|
||||
UpdateAnimationSpeed(0f);
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentState == BossState.Roaring || CurrentState == BossState.Screeching || CurrentState == BossState.Spitting)
|
||||
{
|
||||
UpdateAnimationSpeed(0f);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player == null || playerHealth == null || playerHealth.IsDead)
|
||||
{
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = true;
|
||||
UpdateAnimationSpeed(0f);
|
||||
return;
|
||||
}
|
||||
|
||||
float dist = Vector3.Distance(transform.position, player.position);
|
||||
|
||||
// 1. Проверка на фазовый крик ослепления (Acoustic Blackout Screech)
|
||||
if (Time.time >= nextScreechTime)
|
||||
{
|
||||
StartCoroutine(RoutineAcousticScreech());
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. Ближний бой (если подошли в упор)
|
||||
if (dist <= meleeRange)
|
||||
{
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = true;
|
||||
UpdateAnimationSpeed(0f);
|
||||
|
||||
// Поворот к игроку
|
||||
FaceTarget(player.position);
|
||||
|
||||
if (Time.time >= nextMeleeTime)
|
||||
{
|
||||
PerformMeleeAttack();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. Дальний бой (Кислотный плевок)
|
||||
if (dist >= spitMinDistance && Time.time >= nextSpitTime)
|
||||
{
|
||||
StartCoroutine(RoutineSpitAttack());
|
||||
return;
|
||||
}
|
||||
|
||||
// 4. Погоня за игроком внутри комнаты
|
||||
if (agent != null && agent.isOnNavMesh)
|
||||
{
|
||||
agent.isStopped = false;
|
||||
agent.speed = runSpeed;
|
||||
agent.SetDestination(player.position);
|
||||
UpdateAnimationSpeed(agent.velocity.magnitude);
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformMeleeAttack()
|
||||
{
|
||||
nextMeleeTime = Time.time + meleeCooldown;
|
||||
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetTrigger("Attack");
|
||||
}
|
||||
|
||||
StartCoroutine(RoutineMeleeDamageCheck());
|
||||
}
|
||||
|
||||
private IEnumerator RoutineMeleeDamageCheck()
|
||||
{
|
||||
yield return new WaitForSeconds(0.45f);
|
||||
|
||||
if (CurrentState == BossState.Dead) yield break;
|
||||
|
||||
if (player != null && playerHealth != null && !playerHealth.IsDead)
|
||||
{
|
||||
float dist = Vector3.Distance(transform.position, player.position);
|
||||
if (dist <= meleeRange + 0.8f)
|
||||
{
|
||||
playerHealth.TakeDamage(meleeDamage);
|
||||
Debug.Log($"<color=red>[Босс] Сокрушительный удар вблизи! Нанесено {meleeDamage} урона.</color>");
|
||||
|
||||
// Мощный глухой удар
|
||||
GameAudioSynthesizer.PlayErrorCode();
|
||||
|
||||
// Волна от удара о землю
|
||||
if (EchoTrigger.Instance != null)
|
||||
{
|
||||
EchoTrigger.Instance.TriggerExternalWave(transform.position + transform.forward * 1.2f, 15f, 2.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 GetMouthPosition()
|
||||
{
|
||||
if (mouthSpawnPoint != null) return mouthSpawnPoint.position;
|
||||
|
||||
Transform headBone = null;
|
||||
foreach (var t in GetComponentsInChildren<Transform>())
|
||||
{
|
||||
if (t.name == "head") { headBone = t; break; }
|
||||
}
|
||||
|
||||
if (headBone != null)
|
||||
{
|
||||
return headBone.position + transform.forward * 0.45f - Vector3.up * 0.12f;
|
||||
}
|
||||
|
||||
return transform.position + Vector3.up * 2.75f + transform.forward * 0.55f;
|
||||
}
|
||||
|
||||
private IEnumerator RoutineSpitAttack()
|
||||
{
|
||||
CurrentState = BossState.Spitting;
|
||||
nextSpitTime = Time.time + spitCooldown;
|
||||
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = true;
|
||||
|
||||
// Поворот к цели
|
||||
FaceTarget(player.position);
|
||||
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetTrigger("Attack");
|
||||
}
|
||||
|
||||
// Звук клокотания в горле перед извержением слюны
|
||||
GameAudioSynthesizer.PlayAcidHiss();
|
||||
|
||||
yield return new WaitForSeconds(0.35f);
|
||||
|
||||
if (CurrentState == BossState.Dead) yield break;
|
||||
|
||||
// Звук сочного хлёсткого плевка изо рта
|
||||
GameAudioSynthesizer.PlayAcidSpitSound();
|
||||
|
||||
// Спавним очередь брызг слюны прямо из пасти босса
|
||||
Vector3 target = player != null ? player.position + Vector3.up * 1.1f : transform.position + transform.forward * 10f;
|
||||
|
||||
// 1. Основной тяжелый сгусток слюны
|
||||
Vector3 spawn1 = GetMouthPosition();
|
||||
AcidProjectile.Spawn(spawn1, target, projSpeed: 19f, damage: spitDamage * 0.7f, isMain: true, spreadAngle: 0f);
|
||||
|
||||
// 2. Вторая капля слюны с легким естественным разлетом
|
||||
yield return new WaitForSeconds(0.06f);
|
||||
if (CurrentState == BossState.Dead) yield break;
|
||||
Vector3 spawn2 = GetMouthPosition();
|
||||
AcidProjectile.Spawn(spawn2, target, projSpeed: 17.5f, damage: spitDamage * 0.2f, isMain: false, spreadAngle: 3f);
|
||||
|
||||
// 3. Третья мелкая брызга слюны
|
||||
yield return new WaitForSeconds(0.05f);
|
||||
if (CurrentState == BossState.Dead) yield break;
|
||||
Vector3 spawn3 = GetMouthPosition();
|
||||
AcidProjectile.Spawn(spawn3, target, projSpeed: 16.5f, damage: spitDamage * 0.1f, isMain: false, spreadAngle: 5f);
|
||||
|
||||
yield return new WaitForSeconds(0.4f);
|
||||
|
||||
if (CurrentState != BossState.Dead)
|
||||
{
|
||||
CurrentState = BossState.Combat;
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = false;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator RoutineAcousticScreech()
|
||||
{
|
||||
CurrentState = BossState.Screeching;
|
||||
nextScreechTime = Time.time + screechCooldown;
|
||||
|
||||
if (agent != null && agent.isOnNavMesh) agent.isStopped = true;
|
||||
|
||||
FaceTarget(player.position);
|
||||
|
||||
Debug.Log("<color=red>[Босс] АКУСТИЧЕСКИЙ КРИК: ПОЛНОЕ ОСЛЕПЛЕНИЕ ПРОСТРАНСТВА!</color>");
|
||||
|
||||
// Оглушительный крик
|
||||
GameAudioSynthesizer.PlayAcousticScreech();
|
||||
|
||||
// Активируем полную слепоту в эхолокаторе (эхолокация заблокирована)
|
||||
if (EchoTrigger.Instance != null)
|
||||
{
|
||||
EchoTrigger.Instance.ApplyBlindness(blindnessDuration);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(1.2f);
|
||||
|
||||
if (CurrentState != BossState.Dead)
|
||||
{
|
||||
CurrentState = BossState.Combat;
|
||||
// Во время слепоты босс яростно бежит на игрока!
|
||||
if (agent != null && agent.isOnNavMesh)
|
||||
{
|
||||
agent.isStopped = false;
|
||||
agent.speed = runSpeed * 1.15f; // Ускоренный рывок в темноте!
|
||||
if (player != null) agent.SetDestination(player.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleHealthChanged(float current, float max)
|
||||
{
|
||||
if (BossHealthBarUI.Instance != null)
|
||||
{
|
||||
BossHealthBarUI.Instance.UpdateHealth(current, max);
|
||||
}
|
||||
|
||||
// Ярость при падении ниже 50% HP: внеочередной крик ослепления
|
||||
if (!hasEnragedBelowHalf && current <= max * 0.5f)
|
||||
{
|
||||
hasEnragedBelowHalf = true;
|
||||
nextScreechTime = Time.time + 0.5f; // Немедленный крик ярости!
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleDeath()
|
||||
{
|
||||
CurrentState = BossState.Dead;
|
||||
|
||||
if (agent != null && agent.isOnNavMesh)
|
||||
{
|
||||
agent.isStopped = true;
|
||||
agent.enabled = false;
|
||||
}
|
||||
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetBool("IsDead", true);
|
||||
animator.SetTrigger("Die");
|
||||
}
|
||||
|
||||
// Скрываем полосу здоровья
|
||||
if (BossHealthBarUI.Instance != null)
|
||||
{
|
||||
BossHealthBarUI.Instance.HideBoss(false);
|
||||
}
|
||||
|
||||
// Сообщаем контроллеру арены о победе (открытие дверей)
|
||||
if (arenaController != null)
|
||||
{
|
||||
arenaController.OnBossDefeated();
|
||||
}
|
||||
|
||||
// Финальная победная волна рассеивания
|
||||
if (EchoTrigger.Instance != null)
|
||||
{
|
||||
EchoTrigger.Instance.TriggerExternalWave(transform.position, 35f, 4.0f);
|
||||
}
|
||||
|
||||
GameAudioSynthesizer.PlaySuccessChime();
|
||||
Debug.Log("<color=green>[Босс] БОСС ПОВЕРЖЕН! Карантинная блокировка снята, шлюз открыт.</color>");
|
||||
}
|
||||
|
||||
private void FaceTarget(Vector3 targetPos)
|
||||
{
|
||||
Vector3 dir = (targetPos - transform.position);
|
||||
dir.y = 0;
|
||||
if (dir.sqrMagnitude > 0.001f)
|
||||
{
|
||||
Quaternion rot = Quaternion.LookRotation(dir);
|
||||
transform.rotation = Quaternion.Slerp(transform.rotation, rot, 10f * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAnimationSpeed(float speedVal)
|
||||
{
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetFloat("Speed", speedVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c729d4249c2c444199ee9b78e102ca0
|
||||
@@ -143,9 +143,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0.5849056, g: 0.5849056, b: 0.5849056, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _WaveCenter: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
@@ -158,9 +158,9 @@ Material:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.2901961}
|
||||
- _EchoColor: {r: 4, g: 3.026, b: 1.049, a: 1}
|
||||
- _EchoCoreColor: {r: 7.5, g: 5.5, b: 2.2, a: 1}
|
||||
- _EchoPosition1: {r: 2.2242002, g: 0.12999992, b: 40.5673, a: 1}
|
||||
- _EchoPosition2: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition3: {r: 0, g: 0, b: 14.193845, a: 1}
|
||||
- _EchoPosition1: {r: 1.8514614, g: 0.12999992, b: 40.92091, a: 1}
|
||||
- _EchoPosition2: {r: 1.4822614, g: 0.12999992, b: 39.66953, a: 1}
|
||||
- _EchoPosition3: {r: 1.9371727, g: 0.12999992, b: 38.718243, a: 1}
|
||||
- _EmissionColor: {r: 0.3018868, g: 0.3018868, b: 0.3018868, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _UvOffset: {r: 0, g: 0, b: 0, a: 0}
|
||||
|
||||
@@ -11,5 +11,8 @@ EditorBuildSettings:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/SampleScene.unity
|
||||
guid: 99c9720ab356a0642a771bea13969a05
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Level2.unity
|
||||
guid: 7af213749bf7d8545a574025643ac52f
|
||||
m_configObjects:
|
||||
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
@@ -10,5 +10,5 @@ TimeManager:
|
||||
m_Denominator: 1
|
||||
m_Numerator: 141120000
|
||||
Maximum Allowed Timestep: 0.33333334
|
||||
m_TimeScale: 0
|
||||
m_TimeScale: 1
|
||||
Maximum Particle Timestep: 0.03
|
||||
Reference in new issue
Block a user