private void Update()
    {
        if (health.value <= 0)
        {
            StartCoroutine(death());
        }

        IEnumerator death()
        {
            {
                vData.SetValueFormTransform(transform.position);
                Destroy(Prefab, 3f);
            }
            yield return(new WaitForSeconds(1));
        }
    }
Esempio n. 2
0
 private void OnTriggerEnter(Collider other)
 {
     vData.SetValueFormTransform(transform.position);
 }