cvr-props/Assets/ABI.CCK/Components/ObjectHealth.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2023-01-22 16:38:23 +01:00
using System;
using ABI.CCK.Scripts;
using UnityEngine;
using UnityEngine.Events;
namespace ABI.CCK.Components
{
[AddComponentMenu("ChilloutVR/Object Health")]
[HelpURL("https://developers.abinteractive.net/cck/")]
public class ObjectHealth : Health, ICCK_Component
2023-01-22 16:38:23 +01:00
{
public enum DownBehavior
{
Destroy = 0,
RespawnAfterTime = 1,
2023-07-30 01:20:46 +02:00
RespawnOnRoundStart = 2,
RespawnOnRoundEnd = 3,
RespawnOnGameStart = 4,
RespawnOnGameEnd = 5,
2023-01-22 16:38:23 +01:00
}
[Header("Down Behavior")]
public DownBehavior downBehavior = DownBehavior.Destroy;
public float respawnTime = 10f;
public Transform respawnPoint;
2023-07-30 01:20:46 +02:00
public GameInstanceController connectedGameInstance;
2023-01-22 16:38:23 +01:00
[Header("Events")]
public UnityEvent downEvent = new UnityEvent();
public UnityEvent respawnEvent = new UnityEvent();
//public new UnityEvent damageReceivedEvent = new UnityEvent();
2023-01-22 16:38:23 +01:00
private void Reset()
{
referenceID = Guid.NewGuid().ToString();
}
}
}