Exemplo n.º 1
0
        public AircraftData(int entityId, int typeId, CampType camp)
            : base(entityId, typeId, camp)
        {
            IDataTable <DRAircraft> dtAircraft = GameEntry.DataTable.GetDataTable <DRAircraft>();
            DRAircraft drAircraft = dtAircraft.GetDataRow(TypeId);

            if (drAircraft == null)
            {
                return;
            }

            //创建推进器数据
            ThrusterData = new ThrusterData(GameEntry.Entity.GenerateSerialId(), drAircraft.ThrusterId, Id, Camp);
            //附加武器数据
            for (int index = 0, weaponId = 0; (weaponId = drAircraft.GetWeaponIdAt(index)) > 0; index++)
            {
                AttachWeaponData(new WeaponData(GameEntry.Entity.GenerateSerialId(), weaponId, Id, camp));
            }
            //附加装甲数据
            for (int index = 0, armorId = 0; (armorId = drAircraft.GetArmorIdAt(index)) > 0; index++)
            {
                AttachArmorData(new ArmorData(GameEntry.Entity.GenerateSerialId(), armorId, Id, camp));
            }

            DeadEffectId = drAircraft.DeadEffectId;   //死亡特效id
            DeadSoundId  = drAircraft.DeadSoundId;    //死亡声音id

            HP = m_MaxHP;
        }
Exemplo n.º 2
0
        public override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_ThrusterData = userData as ThrusterData;
            if (m_ThrusterData == null)
            {
                HotLog.Error("Thruster data is invalid.");
                return;
            }

            //挂载到拥有者上
            GameEntry.Entity.AttachEntity(this, m_ThrusterData.OwnerId, AttachPointName);
        }
 //显示推进器实体
 public static void ShowThruster(this EntityComponent entityComponent, ThrusterData data)
 {
     entityComponent.ShowEntity(typeof(Thruster), "Thruster", Constant.AssetPriority.ThrusterAsset, data);
 }