protected virtual void Update() { existentTime.ModCurrent(-Time.deltaTime); transform.Translate(direction * speed * Time.deltaTime); if (existentTime.CurrentValue <= 0) { ReleaseSelf(); } }
protected override void Firing() { // 检查弹药剩余, if (ammo.CurrentValue <= 0 && ammo.BaseValue > 0) { return; } // 等待开火前延迟 if (delayBeforeFire.CurrentValue > 0) { delayBeforeFire.ModCurrent(-Time.deltaTime); return; } base.Firing(); }
public void AddAmmo(int amount) { ammo.ModCurrent(amount); }