diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d37b12..ac9b83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ 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.3.0] - 2023-09-03 + +### Added +- Added event and property for animation state. + +### Fixed +- Fixed initial sun position. + ## [1.2.1] - 2023-08-27 ### Fixed diff --git a/Runtime/Scripts/SunTime.cs b/Runtime/Scripts/SunTime.cs index e62d83b..ccdc550 100644 --- a/Runtime/Scripts/SunTime.cs +++ b/Runtime/Scripts/SunTime.cs @@ -47,6 +47,7 @@ public class SunTime : MonoBehaviour [Header("Events")] public UnityEvent timeOfDayChanged = new(); public UnityEvent timeSpeedChanged = new(); public UnityEvent useCurrentTimeChanged = new(); + public UnityEvent isAnimatingChanged = new(); private float longitude; private float latitude; @@ -80,6 +81,8 @@ public bool UseCurrentTime } } + public bool IsAnimating => animate; + private int frameStep; private const int gizmoRayLength = 10000; @@ -95,7 +98,7 @@ private void Start() Time = newTime; } - DetermineCurrentLocationFromOrigin(); + RecalculateOrigin(); } private void OnValidate() @@ -124,6 +127,7 @@ private void OnDrawGizmos() public void ToggleAnimation(bool animate) { this.animate = animate; + isAnimatingChanged.Invoke(animate); } [Obsolete("Use the Time property instead")] diff --git a/package.json b/package.json index cd38211..d7644c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eu.netherlands3d.sun", "displayName": "Netherlands3D - Sun, Time of Day and Shadows", - "version": "1.2.1", + "version": "1.3.0", "unity": "2022.2", "description": "", "type": "library",