Skip to content

Commit

Permalink
Merge pull request #6 from Netherlands3D/feature/set-absolute-animati…
Browse files Browse the repository at this point in the history
…on-speed

Feature/set absolute animation speed
  • Loading branch information
TomSimons authored Aug 27, 2024
2 parents 4a170c8 + ac1ac19 commit a94d653
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2023-07-27
## [1.2.0] - 2023-08-27

### Added
- Added function to set timeSpeed with an absolute value
- Increased the max speed to max 12 hours per second

## [1.1.0] - 2023-08-26

### Added
- A DateTime object is now the main source of time instead of multiple ints.
Expand Down
10 changes: 8 additions & 2 deletions Runtime/Scripts/SunTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,15 @@ public void SetUpdateSteps(int i)
frameSteps = i;
}

public void SetTimeSpeed(float multiplicationFactor)
public void MultiplyTimeSpeed(float multiplicationFactor)
{
timeSpeed = Math.Clamp(timeSpeed * multiplicationFactor, 1, 10000);
timeSpeed = Math.Clamp(timeSpeed * multiplicationFactor, 1, 43200);
timeSpeedChanged.Invoke(timeSpeed);
}

public void SetTimeSpeed(float speed)
{
timeSpeed = Math.Clamp(speed, 1, 43200);
timeSpeedChanged.Invoke(timeSpeed);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eu.netherlands3d.sun",
"displayName": "Netherlands3D - Sun, Time of Day and Shadows",
"version": "1.1.0",
"version": "1.2.0",
"unity": "2022.2",
"description": "",
"type": "library",
Expand Down

0 comments on commit a94d653

Please sign in to comment.