123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- //------------------------------------------------------------
- // 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<DRWeapon> dtWeapon = GameEntry.DataTable.GetDataTable<DRWeapon>();
- 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;
- }
- /// <summary>
- /// 攻击力。
- /// </summary>
- public int Attack
- {
- get
- {
- return m_Attack;
- }
- }
- /// <summary>
- /// 攻击间隔。
- /// </summary>
- public float AttackInterval
- {
- get
- {
- return m_AttackInterval;
- }
- }
- /// <summary>
- /// 子弹编号。
- /// </summary>
- public int BulletId
- {
- get
- {
- return m_BulletId;
- }
- }
- /// <summary>
- /// 子弹速度。
- /// </summary>
- public float BulletSpeed
- {
- get
- {
- return m_BulletSpeed;
- }
- }
- /// <summary>
- /// 子弹声音编号。
- /// </summary>
- public int BulletSoundId
- {
- get
- {
- return m_BulletSoundId;
- }
- }
- }
- }
|