implementation of drecon in unity 2022 lts forked from: https://github.com/joanllobera/marathon-envs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
546 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Pool;
public class Body : MonoBehaviour
{
private ObjectPool<Body> m_Pool;
public Transform m_Pelvis;
public int m_DespawnTimer;
private void OnEnable()
{
StartCoroutine(DespawnTimer());
}
public void SetPool(ObjectPool<Body> pool)
{
m_Pool = pool;
}
IEnumerator DespawnTimer()
{
yield return new WaitForSecondsRealtime(m_DespawnTimer);
m_Pool.Release(this);
}
}