gun #6

Merged
gauchmarc merged 7 commits from gun into main 2024-01-07 13:37:48 +01:00
Showing only changes of commit af3b189dfc - Show all commits

View File

@ -1,31 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Suicide : MonoBehaviour public class Suicide : MonoBehaviour
{ {
// This method is called when a collision occurs // 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) private void OnCollisionEnter(Collision collision)
{ {
// Check if the collision is with the specific object you want // Check if the collision is with the specific object you want
if (collision.gameObject.CompareTag("Bullet")) if (collision.gameObject.CompareTag("Bullet"))
{ {
MarcsWebLogger.Log("SC | Shoot Collision");
// Your collision handling code goes here
//transform.Translate(Vector3.up * 2);
sun.enabled = false;
skybox.SetColor("_Tint", Color.black);
SceneManager.LoadScene("AfterLife"); SceneManager.LoadScene("AfterLife");
MarcsWebLogger.Log("SC | Cooroutine shoudlb be running");
} }
} }