private void MoveFigureDown() { if (this.figureInfo == null) { return; } bool ok = this.figureInfo.MoveDown(true); this.lastTime = this.timing.time; if (!ok) { this.figureInfo = null; } }
private FigureInfo CreateFigure() { Vector2Int localPoint = new Vector2Int(this.gameDesk.Width / 2, this.gameDesk.Height); Color color = this.gameDesk.MaterialsScope.GetRandomColor(); FigureInfo info = new FigureInfo( sample: this.gameDesk.Figure, localPoint: localPoint, transform: this.gameDesk.CupLayer.transform, color: color, figureAssetScope: this.gameDesk.FigureAssetScope, parameters: this.gameDesk.Parameters, cubesArray: this.cubesArray, atomCubePool: this.atomCubePool); return(info); }
private void UpdateFigure() { float now = this.timing.time; if (this.figureInfo == null) { this.figureInfo = this.CreateFigure(); this.lastTime = now; } else if (this.lastTime == null || this.lastTime.Value + this.gameDesk.TimeInterval <= now) { this.MoveFigureDown(); } if (this.figureInfo != null) { this.figureInfo.Update(this.timing); } }