예제 #1
0
    void LoadBulletCSV()
    {
        Dictionary <UInt32, object> bullet_list = CSVHelper.Instance.GetTable("conf_bullet");

        foreach (var items in bullet_list)
        {
            conf_bullet bullet_conf = (conf_bullet)items.Value;
            WeaponAttri _bullet     = new WeaponAttri();

            _bullet.nID            = bullet_conf.NID;            //子弹ID
            _bullet.Name           = bullet_conf.Name;           //名称
            _bullet.CooldownTime   = bullet_conf.CooldownTime;   //冷却时间
            _bullet.AttackDistance = bullet_conf.AttackDistance; //攻击距离
            _bullet.Speed          = bullet_conf.Speed;          //初始飞行速度
            _bullet.Damage         = bullet_conf.Damage;         //攻击伤害
            _bullet.ExplodeTime    = bullet_conf.ExplodeTime;    //爆炸时间
            _bullet.BarNode        = bullet_conf.BarNode;        //cd bar 挂在节点

            _Weapons[_bullet.nID] = _bullet;

            if (!_FireConditions.ContainsKey(_bullet.nID))
            {
                _FireConditions[_bullet.nID] = new List <FireCondition>();
                _FireConditions[_bullet.nID].Add(new IsCooldown());
            }
        }
    }
예제 #2
0
 public override void Progressbar_WeaponBronEvent(WeaponAttri weapon)
 {
     if (weapon.BarNode == "missile_cd" && _weapAttri == null)
     {
         AttachToWeap(weapon);
         SetProgressBar();
     }
 }
예제 #3
0
 protected void RemoveFromWeap()
 {
     _weapAttri = null;
 }
예제 #4
0
 protected void AttachToWeap(WeaponAttri weapon)
 {
     _weapAttri = weapon;
 }
예제 #5
0
 public virtual void Progressbar_WeaponBronEvent(WeaponAttri weapon)
 {
 }
예제 #6
0
 public virtual bool CanFire(WeaponAttri attri)
 {
     return(true);
 }
예제 #7
0
 public override bool CanFire(WeaponAttri attri)
 {
     return(attri.Duration == 0);
 }