Skip to content

Commit

Permalink
2023.12.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
R0fael committed Dec 3, 2023
1 parent 4894d2f commit e3772a6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Main/HitCheck.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Photon.Voice;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.SceneManagement;

Expand All @@ -19,27 +17,33 @@ public class HitCheck : MonoBehaviour
public string ScreamObjectTag = "ScreamObject";
public string SaveZoneTag = "SaveZone";

[Header("Options")]
public bool enable_kick;
public bool enable_pvp;
public bool enable_freeze;
public bool enable_screams;
public bool enable_tag;

[Header("Other")]
public int tag_counter;
public GameObject scream;
public float time_of_scream;
public bool is_enemy;

private void OnTriggerEnter(Collider other)
{
if (other.CompareTag(kickTag) && !is_enemy)
if (other.CompareTag(kickTag) && enable_kick)
{
Application.Quit();
Debug.Log("Kick");
}
if (other.CompareTag(pushTag))
if (other.CompareTag(pushTag) && enable_pvp)
{
gameObject.transform.parent.GetComponent<Rigidbody>().velocity += other.gameObject.GetComponent<Data>().force;
gameObject.transform.parent.GetComponent<Rigidbody>().velocity *= other.gameObject.GetComponent<Data>().force_multiplyer;
gameObject.transform.parent.GetComponent<Rigidbody>().velocity += (other.transform.position - transform.position).normalized * other.gameObject.GetComponent<Data>().force_to_the_player;
Debug.Log("Boom");
}
if (other.CompareTag(HandTag))
if (other.CompareTag(HandTag) && enable_tag)
{
tag_counter++;
Debug.Log("Tagged");
Expand All @@ -50,7 +54,7 @@ private void OnTriggerEnter(Collider other)
Death();
}

if (other.CompareTag(FreezeTag))
if (other.CompareTag(FreezeTag) && enable_freeze)
{
transform.parent.GetComponent<Rigidbody>().drag = 100;
transform.parent.GetComponent<Rigidbody>().angularDrag = 100;
Expand Down

0 comments on commit e3772a6

Please sign in to comment.