1
This commit is contained in:
36
Packages/Runtime/Entity/Components/Melee/EntityMelee.cs
Normal file
36
Packages/Runtime/Entity/Components/Melee/EntityMelee.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace BITKit.Entities
|
||||
{
|
||||
public interface IEntityMelee
|
||||
{
|
||||
void Excute();
|
||||
}
|
||||
public class EntityMelee : EntityComponent
|
||||
{
|
||||
[Header(Constant.Header.Settings)]
|
||||
public int damage=50;
|
||||
public bool singleTarget;
|
||||
public override void OnStart()
|
||||
{
|
||||
entity.AddListener<int>("Melee", Melee);
|
||||
}
|
||||
public virtual void Excute()
|
||||
{
|
||||
Melee(damage);
|
||||
}
|
||||
public virtual void AIAction(string actionName)
|
||||
{
|
||||
switch (actionName)
|
||||
{
|
||||
case "Melee":
|
||||
Excute();
|
||||
break;
|
||||
}
|
||||
}
|
||||
protected virtual void Melee(int damage)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user