AkiraPixelWind/Assets/Scripts/Main/Battle/AttackBox.cs

40 lines
1.1 KiB
C#
Raw Normal View History

using Axibug;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Game
{
public class AttackBox : MonoBehaviour
{
public E_NODE_TYPE selfNodeType;
public long selfRoleId;
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);
//TODO
AppEntry.Event.Fire(null, CameraShakeEventArgs.Create());
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);
}
}
}