private void Update() { if (Pause.isPaused()) { return; } return; // TODO if (this.risingItem == null) { this.flatTimer -= Time.deltaTime; if (this.flatTimer <= 0) { // Start a new spike. List <Item> list = this.getUnlockedItems(); this.risingItem = new RisingItem( list[Random.Range(0, list.Count)], Random.Range(this._curveLengthRange.x, this._curveLengthRange.y)); } } else { this.risingItem.timer -= Time.deltaTime; // This price change is over if (this.risingItem.timer <= 0) { this.risingItem = null; this.func(); } } }
public void readFromNbt(NbtCompound tag) { if (tag.hasKey("risingItemId")) { this.risingItem = new RisingItem( this.reg.getElement(tag.getInt("risingItemId")), tag.getFloat("risingCurveLength")); this.risingItem.timer = tag.getFloat("risingTimer"); } }