Пример #1
0
    protected virtual void Update()
    {
        existentTime.ModCurrent(-Time.deltaTime);

        transform.Translate(direction * speed * Time.deltaTime);

        if (existentTime.CurrentValue <= 0)
        {
            ReleaseSelf();
        }
    }
Пример #2
0
    protected override void Firing()
    {
        // 检查弹药剩余,
        if (ammo.CurrentValue <= 0 && ammo.BaseValue > 0)
        {
            return;
        }

        // 等待开火前延迟
        if (delayBeforeFire.CurrentValue > 0)
        {
            delayBeforeFire.ModCurrent(-Time.deltaTime);
            return;
        }

        base.Firing();
    }
Пример #3
0
 public void AddAmmo(int amount)
 {
     ammo.ModCurrent(amount);
 }