41 lines
1007 B
C#
41 lines
1007 B
C#
using DragonLi.Core;
|
|
using DragonLi.Frame;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Tower : IAgent
|
|
{
|
|
// Start is called before the first frame update
|
|
protected override void OnBorn()
|
|
{
|
|
//NavAgent.enabled = false;
|
|
}
|
|
|
|
protected override void OnHeathChanged(float currentHealth)
|
|
{
|
|
base.OnHeathChanged(currentHealth);
|
|
|
|
}
|
|
|
|
protected override void OnDeath(object info, Transform _sender)
|
|
{
|
|
// spawn explosion
|
|
Transform explosion = SpawnManager.Instance.Spawn("Effect", "EskyExplosion", transform.position);
|
|
|
|
if (explosion)
|
|
SpawnManager.Instance.Despawn(explosion, 4.0f);
|
|
|
|
// despawn self
|
|
SpawnManager.Instance.Despawn(transform, 0);
|
|
|
|
}
|
|
|
|
protected override float OnReceiveDamage(float value, object info, Transform _sender)
|
|
{
|
|
//Debug.Log(value);
|
|
float res = base.OnReceiveDamage(value, info, _sender);
|
|
return res;
|
|
}
|
|
}
|