init
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using GeometryTD.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Entity.EntityData
|
||||
{
|
||||
[Serializable]
|
||||
public class EnemyData : EntityDataBase
|
||||
{
|
||||
[SerializeField] private CampType _camp = CampType.Enemy;
|
||||
|
||||
[SerializeField] private int _maxHealth = 0;
|
||||
|
||||
[SerializeField] private float _speed = 0;
|
||||
|
||||
[SerializeField] private Transform _player = null;
|
||||
|
||||
public EnemyData(int entityId, int typeId, Transform player, Vector3 pos, int maxHp, float speed) : base(
|
||||
entityId, typeId)
|
||||
{
|
||||
_maxHealth = maxHp;
|
||||
_speed = speed;
|
||||
Position = pos;
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public CampType Camp
|
||||
{
|
||||
get => _camp;
|
||||
set => _camp = value;
|
||||
}
|
||||
|
||||
public int MaxHealth
|
||||
{
|
||||
get => _maxHealth;
|
||||
set => _maxHealth = value;
|
||||
}
|
||||
|
||||
public float Speed
|
||||
{
|
||||
get => _speed;
|
||||
set => _speed = value;
|
||||
}
|
||||
|
||||
public Transform Player
|
||||
{
|
||||
get => _player;
|
||||
set => _player = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b802c30cc274e04929b8659ec631e84
|
||||
timeCreated: 1768890974
|
||||
@@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Entity.EntityData
|
||||
{
|
||||
[Serializable]
|
||||
public abstract class EntityDataBase
|
||||
{
|
||||
[SerializeField]
|
||||
private int m_Id = 0;
|
||||
|
||||
[SerializeField]
|
||||
private int m_TypeId = 0;
|
||||
|
||||
[SerializeField]
|
||||
private Vector3 m_Position = Vector3.zero;
|
||||
|
||||
[SerializeField]
|
||||
private Quaternion m_Rotation = Quaternion.identity;
|
||||
|
||||
public EntityDataBase(int entityId, int typeId)
|
||||
{
|
||||
m_Id = entityId;
|
||||
m_TypeId = typeId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体编号。
|
||||
/// </summary>
|
||||
public int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 实体类型编号。
|
||||
/// </summary>
|
||||
public int TypeId => m_TypeId;
|
||||
|
||||
/// <summary>
|
||||
/// 实体位置。
|
||||
/// </summary>
|
||||
public Vector3 Position
|
||||
{
|
||||
get => m_Position;
|
||||
set => m_Position = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体朝向。
|
||||
/// </summary>
|
||||
public Quaternion Rotation
|
||||
{
|
||||
get => m_Rotation;
|
||||
set => m_Rotation = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afb91fe3ed8105e4a96b7bd5917ecc2b
|
||||
timeCreated: 1528026152
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using GeometryTD.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Entity.EntityData
|
||||
{
|
||||
[Serializable]
|
||||
public class PlayerData : EntityDataBase
|
||||
{
|
||||
[SerializeField] private CampType _camp = CampType.Player;
|
||||
|
||||
[SerializeField] private int _maxHealth = 0;
|
||||
|
||||
[SerializeField] private float _speed = 0;
|
||||
|
||||
public PlayerData(int entityId, int typeId, int maxHp, float speed) : base(entityId, typeId)
|
||||
{
|
||||
_maxHealth = maxHp;
|
||||
_speed = speed;
|
||||
}
|
||||
|
||||
public CampType Camp
|
||||
{
|
||||
get => _camp;
|
||||
set => _camp = value;
|
||||
}
|
||||
|
||||
public int MaxHealth
|
||||
{
|
||||
get => _maxHealth;
|
||||
set => _maxHealth = value;
|
||||
}
|
||||
|
||||
public float Speed
|
||||
{
|
||||
get => _speed;
|
||||
set => _speed = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b69d3168ac4f442994f8dc4d906daa60
|
||||
timeCreated: 1768890638
|
||||
Reference in New Issue
Block a user