From 424edf8e566bb8572032152cb4ff9350ea47a019 Mon Sep 17 00:00:00 2001 From: marcgauch <34353267+marcgauch@users.noreply.github.com> Date: Sun, 7 Jan 2024 12:36:39 +0100 Subject: [PATCH] Badly workling dimming --- Assets/Scenes/SampleScene.unity | 11 ++++++++--- Assets/Suicide.cs | 16 +++++++++++++++- ... NOT THE HUGE ASS SPHERE THAT IS THE SKY!.mat | 2 +- ProjectSettings/ProjectSettings.asset | 2 -- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 51a2cfe..7981f97 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.387776, g: 0.3228798, b: 0.08558196, a: 1} + m_IndirectSpecularColor: {r: 0.18824416, g: 0.24832445, b: 0.32856566, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -425,7 +425,7 @@ GameObject: - component: {fileID: 223974229} - component: {fileID: 223974228} m_Layer: 0 - m_Name: Directional Light + m_Name: Sunlight m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2142,6 +2142,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b9763abf2ebe9a0058a5ca57fd60d20f, type: 3} m_Name: m_EditorClassIdentifier: + fadeDuration: 2 + skybox: {fileID: 2100000, guid: 8138b2e64e964ba2ab05123d4940f482, type: 2} + sun: {fileID: 223974228} + fadeImage: {fileID: 0} + fadeSpeed: 0.5 --- !u!1 &1426203498 GameObject: m_ObjectHideFlags: 0 @@ -2853,7 +2858,7 @@ MeshRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2039657593} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 diff --git a/Assets/Suicide.cs b/Assets/Suicide.cs index 5d84689..b35f51c 100644 --- a/Assets/Suicide.cs +++ b/Assets/Suicide.cs @@ -1,17 +1,31 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.UI; public class Suicide : MonoBehaviour { // This method is called when a collision occurs + + + public float fadeDuration = 2.0f; // Duration of the fade in seconds + + public Material skybox; + public Light sun; private void OnCollisionEnter(Collision collision) { // Check if the collision is with the specific object you want if (collision.gameObject.CompareTag("Bullet")) { + MarcsWebLogger.Log("SC | Shoot Collision"); // Your collision handling code goes here - transform.Translate(Vector3.up * 2); + //transform.Translate(Vector3.up * 2); + sun.enabled = false; + skybox.SetColor("_Tint", Color.black); + + + MarcsWebLogger.Log("SC | Cooroutine shoudlb be running"); } } + } diff --git a/Assets/World/Skybox (OVRCameraRig) NOT THE HUGE ASS SPHERE THAT IS THE SKY!.mat b/Assets/World/Skybox (OVRCameraRig) NOT THE HUGE ASS SPHERE THAT IS THE SKY!.mat index 7cbf626..528ef72 100644 --- a/Assets/World/Skybox (OVRCameraRig) NOT THE HUGE ASS SPHERE THAT IS THE SKY!.mat +++ b/Assets/World/Skybox (OVRCameraRig) NOT THE HUGE ASS SPHERE THAT IS THE SKY!.mat @@ -93,6 +93,6 @@ Material: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _GroundColor: {r: 0, g: 0, b: 0, a: 1} - - _SkyTint: {r: 1, g: 1, b: 1, a: 1} + - _SkyTint: {r: 0, g: 0, b: 0, a: 1} - _Tint: {r: 0.20909262, g: 0.20876513, b: 0.20876513, a: 0.5} m_BuildTextureStacks: [] diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index eefee64..75fdc46 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -139,8 +139,6 @@ PlayerSettings: bundleVersion: 0.1 preloadedAssets: - {fileID: 11400000, guid: 29d72bf9f28086693968cedbdc8f08cd, type: 2} - - {fileID: 11400000, guid: 541751c4fa90967d68ef779a22ee43f3, type: 2} - - {fileID: -3127938587913570544, guid: 8eb28e39ec717d0799039f01965f0533, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1