From 51b19e346b99fc1e481d25e74fc1fae57e7cca8e Mon Sep 17 00:00:00 2001 From: Tom Simons Date: Mon, 2 Sep 2024 11:40:46 +0200 Subject: [PATCH 1/2] Added event and property for animation state. Fixed initial sun position --- Runtime/Scripts/SunTime.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")] From 242da654f0f324eacdff0a0d7a6a55f4b1f8d402 Mon Sep 17 00:00:00 2001 From: Tom Simons Date: Mon, 2 Sep 2024 13:08:29 +0200 Subject: [PATCH 2/2] prepared package for release --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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/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",