LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/CompanyMonsterCollisionDetect.cs

21 lines
547 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using GameNetcodeStuff;
using Unity.Netcode;
using UnityEngine;
public class CompanyMonsterCollisionDetect : MonoBehaviour
{
public int monsterAnimationID;
private void OnTriggerEnter(Collider other)
{
if (!(NetworkManager.Singleton == null) && other.CompareTag("Player"))
{
PlayerControllerB component = other.gameObject.GetComponent<PlayerControllerB>();
if (component != null && !component.isPlayerDead && component.IsOwner)
{
Object.FindObjectOfType<DepositItemsDesk>().CollisionDetect(monsterAnimationID);
}
}
}
}