2023-01-07 23:24:18 +08:00
|
|
|
using Axibug;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Game
|
|
|
|
{
|
|
|
|
public class AttackBox : MonoBehaviour
|
|
|
|
{
|
|
|
|
public E_NODE_TYPE selfNodeType;
|
2023-01-09 00:17:20 +08:00
|
|
|
public int selfRoleId;
|
2023-01-07 23:24:18 +08:00
|
|
|
|
|
|
|
public void InitNode(RoleBase role)
|
|
|
|
{
|
|
|
|
selfNodeType = role.RoleType;
|
|
|
|
selfRoleId = role.RoleID;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnTriggerEnter(Collider other)
|
|
|
|
{
|
|
|
|
//AxibugLog.Debug("OnTriggerEnter => tag" + other.tag);
|
|
|
|
Debug.Log("OnTriggerEnter => tag " + other.tag);
|
|
|
|
|
|
|
|
if (Common.CheckTagIsRole(other.tag, out E_NODE_TYPE Target_nodeType))
|
|
|
|
{
|
|
|
|
|
|
|
|
RoleBase underatkrole = other.GetComponent<RoleBase>();
|
|
|
|
AppEntry.Event.Fire(null, AttackHitEventArgs.Create(selfNodeType, selfRoleId, Target_nodeType, underatkrole.RoleID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
|
|
{
|
|
|
|
Debug.Log("OnTriggerExit => tag " + other.tag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|