Compare commits
1 Commits
master
...
kabNeSloma
| Author | SHA1 | Date | |
|---|---|---|---|
| 8cdd963fc5 |
@ -47,6 +47,7 @@
|
||||
<Analyzer Include="/home/vladislove/Unity/Hub/Editor/6000.2.11f1/Editor/Data/Tools/Unity.SourceGenerators/Unity.UIToolkit.SourceGenerator.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets/Scripts/RollingHazard.cs" />
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextEventHandler.cs" />
|
||||
<Compile Include="Assets/Scripts/LoseScript.cs" />
|
||||
<Compile Include="Assets/Scripts/SwingHammer.cs" />
|
||||
@ -54,6 +55,7 @@
|
||||
<Compile Include="Assets/Scripts/TrampolineScript.cs" />
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextSelector_A.cs" />
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs" />
|
||||
<Compile Include="Assets/Scripts/SpikeTrap.cs" />
|
||||
<Compile Include="Assets/Scripts/FallingPlatform.cs" />
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_ExampleScript_01.cs" />
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/TMPro_InstructionOverlay.cs" />
|
||||
@ -92,6 +94,7 @@
|
||||
<Compile Include="Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs" />
|
||||
<Compile Include="Assets/Scripts/MovingPlatform.cs" />
|
||||
<Compile Include="Assets/Scripts/TrailController.cs" />
|
||||
<Compile Include="Assets/Scripts/TriggerPlatform.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Assets/TextMesh Pro/Shaders/TMPro.cginc" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -91,7 +91,8 @@ public class BallController : MonoBehaviour
|
||||
rb.AddForce(movement * airControlSpeed, ForceMode.Acceleration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ApplyAcceleration()
|
||||
{
|
||||
Vector3 currentVel = rb.linearVelocity;
|
||||
@ -154,24 +155,24 @@ public class BallController : MonoBehaviour
|
||||
}
|
||||
|
||||
// --- Логика Взаимодействия и Тегирования ---
|
||||
//
|
||||
// private void OnCollisionEnter(Collision collision)
|
||||
// {
|
||||
// if (collision.gameObject.CompareTag("Trampoline"))
|
||||
// {
|
||||
// HandleTrampolineBounce(collision);
|
||||
// }
|
||||
// }
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
if (collision.gameObject.CompareTag("Trampoline"))
|
||||
{
|
||||
HandleTrampolineBounce(collision);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleTrampolineBounce(Collision collision)
|
||||
{
|
||||
Vector3 surfaceNormal = Vector3.up;
|
||||
if (collision.contacts.Length > 0)
|
||||
{
|
||||
surfaceNormal = collision.contacts[0].normal;
|
||||
}
|
||||
// Обнуляем скорость перед отскоком для стабильности
|
||||
rb.linearVelocity = Vector3.zero;
|
||||
rb.AddForce(surfaceNormal * jumpForce * trampolineBounceForce, ForceMode.Impulse);
|
||||
}
|
||||
// private void HandleTrampolineBounce(Collision collision)
|
||||
// {
|
||||
// Vector3 surfaceNormal = Vector3.up;
|
||||
// if (collision.contacts.Length > 0)
|
||||
// {
|
||||
// surfaceNormal = collision.contacts[0].normal;
|
||||
// }
|
||||
// // Обнуляем скорость перед отскоком для стабильности
|
||||
// rb.linearVelocity = Vector3.zero;
|
||||
// rb.AddForce(surfaceNormal * jumpForce * trampolineBounceForce, ForceMode.Impulse);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -2,17 +2,49 @@ using UnityEngine;
|
||||
|
||||
public class LoseScript : MonoBehaviour
|
||||
{
|
||||
// 1. Паттерн Одиночки (Singleton) - делает скрипт глобально доступным
|
||||
public static LoseScript Instance { get; private set; }
|
||||
|
||||
// Ссылка на объект меню, которую нужно установить в Инспекторе
|
||||
[SerializeField] private GameObject loseMenuUI;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// Гарантируем, что в сцене будет только один экземпляр
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
// Сбрасываем время при запуске сцены
|
||||
Time.timeScale = 1f;
|
||||
|
||||
if (loseMenuUI != null)
|
||||
{
|
||||
// Скрываем меню при старте
|
||||
loseMenuUI.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Этот метод будет вызываться из любого места, чтобы показать меню
|
||||
public void ShowLoseMenu()
|
||||
{
|
||||
if (loseMenuUI != null)
|
||||
{
|
||||
loseMenuUI.SetActive(true);
|
||||
Time.timeScale = 0f; // Замораживаем игру
|
||||
Debug.Log("Игрок проиграл! Активировано меню проигрыша.");
|
||||
}
|
||||
}
|
||||
|
||||
// Логика проигрыша при столкновении с этим объектом (например, пол проигрыша)
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
if (collision.gameObject.GetComponent<BallController>() != null )
|
||||
@ -20,15 +52,4 @@ public class LoseScript : MonoBehaviour
|
||||
ShowLoseMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ShowLoseMenu()
|
||||
{
|
||||
if (loseMenuUI != null)
|
||||
{
|
||||
loseMenuUI.SetActive(true);
|
||||
Time.timeScale = 0f;
|
||||
Debug.Log("Игрок проиграл! Активировано меню проигрыша.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,19 +2,20 @@ using UnityEngine;
|
||||
|
||||
public class TrampolineScript : MonoBehaviour
|
||||
{
|
||||
|
||||
// ⚙️ Сила, с которой шарик будет отталкиваться.
|
||||
[Tooltip("Сила отскока. Настройте это значение в Инспекторе для каждого трамплина.")]
|
||||
[SerializeField] private float bounceForce = 15f;
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
|
||||
|
||||
if (collision.gameObject.CompareTag("Player"))
|
||||
{
|
||||
|
||||
|
||||
Rigidbody playerRigidbody = collision.gameObject.GetComponent<Rigidbody>();
|
||||
if (playerRigidbody == null)
|
||||
{
|
||||
|
||||
Debug.LogError("Игрок с тегом 'Player' должен иметь компонент Rigidbody для отскока!");
|
||||
return;
|
||||
}
|
||||
@ -23,7 +24,6 @@ public class TrampolineScript : MonoBehaviour
|
||||
|
||||
playerRigidbody.linearVelocity = Vector3.zero;
|
||||
|
||||
|
||||
playerRigidbody.AddForce(normal * bounceForce, ForceMode.Impulse);
|
||||
|
||||
Debug.Log($"Игрок отскочил от трамплина по нормали: {normal.normalized}");
|
||||
|
||||
@ -53,6 +53,7 @@ MonoBehaviour:
|
||||
m_AdditionalLightsShadowResolutionTierHigh: 1024
|
||||
m_ReflectionProbeBlending: 1
|
||||
m_ReflectionProbeBoxProjection: 1
|
||||
m_ReflectionProbeAtlas: 1
|
||||
m_ShadowDistance: 50
|
||||
m_ShadowCascadeCount: 4
|
||||
m_Cascade2Split: 0.25
|
||||
@ -78,11 +79,11 @@ MonoBehaviour:
|
||||
m_UseAdaptivePerformance: 1
|
||||
m_ColorGradingMode: 0
|
||||
m_ColorGradingLutSize: 32
|
||||
m_AllowPostProcessAlphaOutput: 0
|
||||
m_UseFastSRGBLinearConversion: 0
|
||||
m_SupportDataDrivenLensFlare: 1
|
||||
m_SupportScreenSpaceLensFlare: 1
|
||||
m_GPUResidentDrawerMode: 0
|
||||
m_UseLegacyLightmaps: 0
|
||||
m_SmallMeshScreenPercentage: 0
|
||||
m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0
|
||||
m_ShadowType: 1
|
||||
@ -100,15 +101,16 @@ MonoBehaviour:
|
||||
m_Keys: []
|
||||
m_Values:
|
||||
m_PrefilteringModeMainLightShadows: 3
|
||||
m_PrefilteringModeAdditionalLight: 4
|
||||
m_PrefilteringModeAdditionalLightShadows: 0
|
||||
m_PrefilteringModeAdditionalLight: 0
|
||||
m_PrefilteringModeAdditionalLightShadows: 2
|
||||
m_PrefilterXRKeywords: 1
|
||||
m_PrefilteringModeForwardPlus: 1
|
||||
m_PrefilteringModeForwardPlus: 2
|
||||
m_PrefilteringModeDeferredRendering: 0
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 1
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 2
|
||||
m_PrefilterDebugKeywords: 1
|
||||
m_PrefilterWriteRenderingLayers: 0
|
||||
m_PrefilterWriteRenderingLayers: 1
|
||||
m_PrefilterHDROutput: 1
|
||||
m_PrefilterAlphaOutput: 1
|
||||
m_PrefilterSSAODepthNormals: 0
|
||||
m_PrefilterSSAOSourceDepthLow: 1
|
||||
m_PrefilterSSAOSourceDepthMedium: 1
|
||||
@ -120,14 +122,18 @@ MonoBehaviour:
|
||||
m_PrefilterSSAOSampleCountHigh: 1
|
||||
m_PrefilterDBufferMRT1: 1
|
||||
m_PrefilterDBufferMRT2: 1
|
||||
m_PrefilterDBufferMRT3: 0
|
||||
m_PrefilterSoftShadowsQualityLow: 0
|
||||
m_PrefilterSoftShadowsQualityMedium: 0
|
||||
m_PrefilterSoftShadowsQualityHigh: 0
|
||||
m_PrefilterDBufferMRT3: 1
|
||||
m_PrefilterSoftShadowsQualityLow: 1
|
||||
m_PrefilterSoftShadowsQualityMedium: 1
|
||||
m_PrefilterSoftShadowsQualityHigh: 1
|
||||
m_PrefilterSoftShadows: 0
|
||||
m_PrefilterScreenCoord: 1
|
||||
m_PrefilterNativeRenderPass: 1
|
||||
m_PrefilterUseLegacyLightmaps: 0
|
||||
m_PrefilterBicubicLightmapSampling: 1
|
||||
m_PrefilterReflectionProbeBlending: 0
|
||||
m_PrefilterReflectionProbeBoxProjection: 0
|
||||
m_PrefilterReflectionProbeAtlas: 0
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_ShadowCascades: 0
|
||||
m_Textures:
|
||||
|
||||
@ -63,7 +63,21 @@ MonoBehaviour:
|
||||
- rid: 2888274376658255879
|
||||
- rid: 2888274376658255880
|
||||
m_RuntimeSettings:
|
||||
m_List: []
|
||||
m_List:
|
||||
- rid: 6852985685364965378
|
||||
- rid: 6852985685364965379
|
||||
- rid: 6852985685364965380
|
||||
- rid: 6852985685364965381
|
||||
- rid: 6852985685364965384
|
||||
- rid: 6852985685364965385
|
||||
- rid: 6852985685364965392
|
||||
- rid: 6852985685364965394
|
||||
- rid: 8712630790384254976
|
||||
- rid: 2888274376658255873
|
||||
- rid: 2888274376658255875
|
||||
- rid: 2888274376658255876
|
||||
- rid: 2888274376658255878
|
||||
- rid: 2888274376658255880
|
||||
m_AssetVersion: 8
|
||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||
m_RenderingLayerNames:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -84975,7 +84975,7 @@
|
||||
"DisplayName": "Writing Assembly-CSharp.rsp",
|
||||
"ActionType": "WriteFile",
|
||||
"PayloadOffset": 3829063,
|
||||
"PayloadLength": 42574,
|
||||
"PayloadLength": 42674,
|
||||
"PayloadDebugContentSnippet": "-target:library\n-out:\"Library/",
|
||||
"Inputs": [],
|
||||
"InputFlags": [],
|
||||
@ -84991,7 +84991,7 @@
|
||||
"Annotation": "WriteText Library/Bee/artifacts/2400b0aE.dag/Assembly-CSharp.rsp2",
|
||||
"DisplayName": "Writing Assembly-CSharp.rsp2",
|
||||
"ActionType": "WriteFile",
|
||||
"PayloadOffset": 3871724,
|
||||
"PayloadOffset": 3871824,
|
||||
"PayloadLength": 0,
|
||||
"PayloadDebugContentSnippet": "",
|
||||
"Inputs": [],
|
||||
@ -85316,10 +85316,13 @@
|
||||
"Assets/Scripts/LoseScript.cs",
|
||||
"Assets/Scripts/MainMenu.cs",
|
||||
"Assets/Scripts/MovingPlatform.cs",
|
||||
"Assets/Scripts/RollingHazard.cs",
|
||||
"Assets/Scripts/SpikeTrap.cs",
|
||||
"Assets/Scripts/SwingHammer.cs",
|
||||
"Assets/Scripts/TrailController.cs",
|
||||
"Assets/Scripts/TrailSegment.cs",
|
||||
"Assets/Scripts/TrampolineScript.cs",
|
||||
"Assets/Scripts/TriggerPlatform.cs",
|
||||
"Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs",
|
||||
"Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs",
|
||||
"Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs",
|
||||
@ -85708,6 +85711,9 @@
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
8
|
||||
],
|
||||
"Outputs": [
|
||||
@ -86155,7 +86161,7 @@
|
||||
"Annotation": "WriteText Library/Bee/artifacts/2400b0aE.dag/Assembly-CSharp.dll.mvfrm.rsp",
|
||||
"DisplayName": "Writing Assembly-CSharp.dll.mvfrm.rsp",
|
||||
"ActionType": "WriteFile",
|
||||
"PayloadOffset": 3871820,
|
||||
"PayloadOffset": 3871920,
|
||||
"PayloadLength": 15071,
|
||||
"PayloadDebugContentSnippet": "Library/Bee/artifacts/mvdfrm/U",
|
||||
"Inputs": [],
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user