Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
37
Assets/Scripts/Data/Actor/ActorMeleeSharedDataComponent.cs
Normal file
37
Assets/Scripts/Data/Actor/ActorMeleeSharedDataComponent.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
[Serializable]
|
||||
public struct ActorMeleeSharedData : ISharedComponentData
|
||||
{
|
||||
public LayerMask MeleeMask;
|
||||
public float Range;
|
||||
public float Angle;
|
||||
public float Damage;
|
||||
public float Knockback;
|
||||
public float Cooldown;
|
||||
}
|
||||
|
||||
public class ActorMeleeSharedDataComponent : MonoBehaviour, IConvertGameObjectToEntity
|
||||
{
|
||||
[SerializeField] private ActorMeleeSharedData m_SerializedData;
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
Gizmos.DrawLine(
|
||||
transform.position,
|
||||
transform.position - Quaternion.Euler(0, 0, m_SerializedData.Angle * 0.5f) * transform.right * m_SerializedData.Range);
|
||||
Gizmos.DrawLine(
|
||||
transform.position,
|
||||
transform.position - Quaternion.Euler(0, 0, -m_SerializedData.Angle * 0.5f) * transform.right * m_SerializedData.Range);
|
||||
}
|
||||
|
||||
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
||||
{
|
||||
dstManager.AddSharedComponentData(entity, m_SerializedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue