//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 Jiang Yin. All rights reserved. // Homepage: https://gameframework.cn/ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ using GameFramework.DataTable; using System; using UnityEngine; namespace MetaClient { [Serializable] public class WeaponData : AccessoryObjectData { [SerializeField] private int m_Attack = 0; [SerializeField] private float m_AttackInterval = 0f; [SerializeField] private int m_BulletId = 0; [SerializeField] private float m_BulletSpeed = 0f; [SerializeField] private int m_BulletSoundId = 0; public WeaponData(int entityId, int typeId, int ownerId, CampType ownerCamp) : base(entityId, typeId, ownerId, ownerCamp) { IDataTable dtWeapon = GameEntry.DataTable.GetDataTable(); DRWeapon drWeapon = dtWeapon.GetDataRow(TypeId); if (drWeapon == null) { return; } m_Attack = drWeapon.Attack; m_AttackInterval = drWeapon.AttackInterval; m_BulletId = drWeapon.BulletId; m_BulletSpeed = drWeapon.BulletSpeed; m_BulletSoundId = drWeapon.BulletSoundId; } /// /// 攻击力。 /// public int Attack { get { return m_Attack; } } /// /// 攻击间隔。 /// public float AttackInterval { get { return m_AttackInterval; } } /// /// 子弹编号。 /// public int BulletId { get { return m_BulletId; } } /// /// 子弹速度。 /// public float BulletSpeed { get { return m_BulletSpeed; } } /// /// 子弹声音编号。 /// public int BulletSoundId { get { return m_BulletSoundId; } } } }