67 lines
1.7 KiB
C#
67 lines
1.7 KiB
C#
using System;
|
|
using GeometryTD.Definition;
|
|
using UnityEngine;
|
|
|
|
namespace GeometryTD.Entity.EntityData
|
|
{
|
|
[Serializable]
|
|
public class BulletData : EntityDataBase
|
|
{
|
|
[SerializeField] private Transform _target = null;
|
|
[SerializeField] private int _damage = 0;
|
|
[SerializeField] private float _speed = 0f;
|
|
[SerializeField] private float _maxLifetime = 3f;
|
|
[SerializeField] private AttackPropertyType _attackPropertyType = AttackPropertyType.None;
|
|
|
|
public BulletData(
|
|
int entityId,
|
|
int typeId,
|
|
Vector3 position,
|
|
Quaternion rotation,
|
|
Transform target,
|
|
int damage,
|
|
float speed,
|
|
AttackPropertyType attackPropertyType = AttackPropertyType.None,
|
|
float maxLifetime = 3f) : base(entityId, typeId)
|
|
{
|
|
Position = position;
|
|
Rotation = rotation;
|
|
_target = target;
|
|
_damage = damage;
|
|
_speed = speed;
|
|
_attackPropertyType = attackPropertyType;
|
|
_maxLifetime = maxLifetime;
|
|
}
|
|
|
|
public Transform Target
|
|
{
|
|
get => _target;
|
|
set => _target = value;
|
|
}
|
|
|
|
public int Damage
|
|
{
|
|
get => _damage;
|
|
set => _damage = value;
|
|
}
|
|
|
|
public float Speed
|
|
{
|
|
get => _speed;
|
|
set => _speed = value;
|
|
}
|
|
|
|
public float MaxLifetime
|
|
{
|
|
get => _maxLifetime;
|
|
set => _maxLifetime = value;
|
|
}
|
|
|
|
public AttackPropertyType AttackPropertyType
|
|
{
|
|
get => _attackPropertyType;
|
|
set => _attackPropertyType = value;
|
|
}
|
|
}
|
|
}
|