com.kyrylokuzyk.primetween 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,13 +20,13 @@ namespace PrimeTween {
20
20
  internal static PrimeTweenManager Instance {
21
21
  get {
22
22
  if (!HasInstance) {
23
- #if UNITY_EDITOR
23
+ if (Application.isEditor) {
24
24
  CreateInstance();
25
25
  _instance.gameObject.hideFlags = HideFlags.HideAndDontSave;
26
- #else
26
+ } else {
27
27
  const string error = nameof(PrimeTweenManager) + " is not created yet. Please add the 'PRIME_TWEEN_EXPERIMENTAL' define to your project, then use '" + nameof(PrimeTweenConfig) + "." + nameof(PrimeTweenConfig.ManualInitialize) + "()' to initialize PrimeTween before '" + nameof(RuntimeInitializeLoadType) + "." + nameof(RuntimeInitializeLoadType.BeforeSceneLoad) + "'.";
28
28
  throw new Exception(error);
29
- #endif
29
+ }
30
30
  } /*else if (_instance == null) { // todo this throws if PrimeTween API is called from OnDestroy(). See the DestructionOrderTest scene. How to detect manual PrimeTweenManager destruction?
31
31
  throw new Exception(nameof(PrimeTweenManager) + " was manually destroyed after creation, which is not allowed. Please check you're not destroying all objects manually.");
32
32
  }*/
@@ -98,6 +98,8 @@ namespace PrimeTween {
98
98
 
99
99
  #if PRIME_TWEEN_EXPERIMENTAL
100
100
  public
101
+ #else
102
+ internal
101
103
  #endif
102
104
  static void ManualInitialize() {
103
105
  if (!PrimeTweenManager.HasInstance) {
@@ -284,22 +284,22 @@ namespace PrimeTween {
284
284
  }
285
285
  var rootTween = root.tween;
286
286
  if (tween._isPaused && tween._isPaused != rootTween._isPaused) {
287
- warnIgnoredChildrenSetting(nameof(isPaused));
287
+ warnIgnoredChildrenSetting(nameof(isPaused), rootTween._isPaused, tween._isPaused);
288
288
  }
289
289
  if (tween.timeScale != 1f && tween.timeScale != rootTween.timeScale) {
290
- warnIgnoredChildrenSetting(nameof(timeScale));
290
+ warnIgnoredChildrenSetting(nameof(timeScale), rootTween.timeScale, tween.timeScale);
291
291
  }
292
292
  if (tween.settings.useUnscaledTime && tween.settings.useUnscaledTime != rootTween.settings.useUnscaledTime) {
293
- warnIgnoredChildrenSetting(nameof(TweenSettings.useUnscaledTime));
293
+ warnIgnoredChildrenSetting(nameof(TweenSettings.useUnscaledTime), rootTween.settings.useUnscaledTime, tween.settings.useUnscaledTime);
294
294
  }
295
- if (tween.settings._updateType != _UpdateType.Default && tween.settings._updateType != rootTween.settings._updateType) {
296
- warnIgnoredChildrenSetting(nameof(TweenSettings.updateType));
295
+ if (tween.settings._updateType != PrimeTweenManager.Instance.defaultUpdateType && tween.settings._updateType != rootTween.settings._updateType) {
296
+ warnIgnoredChildrenSetting(nameof(TweenSettings.updateType), rootTween.settings._updateType, tween.settings._updateType);
297
297
  }
298
- void warnIgnoredChildrenSetting(string settingName) {
299
- Debug.LogError($"'{settingName}' was ignored after adding child animation to the Sequence. Parent Sequence controls '{settingName}' of all its children animations.\n" +
300
- "To prevent this error:\n" +
298
+ void warnIgnoredChildrenSetting(string settingName, object sequenceSetting, object childSetting) {
299
+ Debug.LogError($"'{settingName}' was ignored after adding child animation to the Sequence (Sequence has '{sequenceSetting}', but the child had '{childSetting}').\n" +
300
+ $"Parent Sequence controls '{settingName}' of all its children animations. To prevent this error:\n" +
301
301
  $"- Use the default value of '{settingName}' in child animation.\n" +
302
- $"- OR use the same '{settingName}' in child animation.\n\n");
302
+ $"- OR use the same '{settingName}' in child animation.\n");
303
303
  }
304
304
  return true;
305
305
  }
package/Tests/Sequence.cs CHANGED
@@ -351,6 +351,10 @@ public partial class Tests {
351
351
  seq.Chain(createSequenceWithNonDefaultSettings());
352
352
  LogAssert.NoUnexpectedReceived();
353
353
 
354
+ Sequence.Create(updateType: UpdateType.FixedUpdate)
355
+ .Group(Tween.PositionY(transform, new(5, 0.1f)))
356
+ .ChainCallback(() => {});
357
+
354
358
  return;
355
359
 
356
360
  static void expectErrors() {
package/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.3.2] - 2025-05-18
2
+ ### Fixed
3
+ - Fixed: the 'updateType was ignored' error appears if a tween with default 'updateType' is added to a Sequence. https://github.com/KyryloKuzyk/PrimeTween/issues/171
4
+
1
5
  ## [1.3.1] - 2025-04-27
2
6
  ### Added
3
7
  - Add Edit mode support, so animations can be played in Editor without entering the Play mode. https://github.com/KyryloKuzyk/PrimeTween/discussions/62
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "com.kyrylokuzyk.primetween",
3
3
  "displayName": "PrimeTween",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "unity": "2018.4",
6
6
  "author": {
7
7
  "name": "Kyrylo Kuzyk"
@@ -34,11 +34,11 @@
34
34
  "documentationUrl": "https://github.com/KyryloKuzyk/PrimeTween",
35
35
  "changelogUrl": "https://github.com/KyryloKuzyk/PrimeTween/blob/main/changelog.md",
36
36
  "_upm": {
37
- "changelog": "### Added\n- Add Edit mode support, so animations can be played in Editor without entering the Play mode. https://github.com/KyryloKuzyk/PrimeTween/discussions/62\n- PrimeTween can now be installed via Unity Package Manager.\n- Demo project: add 'Play Animation' button to Inspector to preview animations in Edit mode without entering Play mode.\n- Add the experimental `ResetAfterComplete()` method to reset animations to the initial value before completion. https://github.com/KyryloKuzyk/PrimeTween/discussions/153\n- Add the experimental `PrimeTweenConfig.ManualInitialize()` to initialize PrimeTween before `RuntimeInitializeLoadType.BeforeSceneLoad`. https://github.com/KyryloKuzyk/PrimeTween/issues/150\n- Add `Tween.VisualElementOpacity()` method to animate the `VisualElement.style.opacity` property. Also, extend `Tween.Color/Alpha` methods to also work with VisualElement.\n\n### Changed\n- Passing `null` to `OnComplete()` is now allowed and no longer results in an error. https://github.com/KyryloKuzyk/PrimeTween/discussions/164\n\n### Fixed\n- Fixed: PrimeTween doesn't work after scripts are recompiled while playing in Editor when the 'Recompile And Continue Playing' setting is enabled.\n"
37
+ "changelog": "### Fixed\n- Fixed: the 'updateType was ignored' error appears if a tween with default 'updateType' is added to a Sequence. https://github.com/KyryloKuzyk/PrimeTween/issues/171"
38
38
  },
39
39
  "repository": {
40
40
  "url": "git@bitbucket.org:stampedegames/primetween.git",
41
41
  "type": "git",
42
- "revision": "cd2962587768a9255dafbd7327dc6868dcfd6379"
42
+ "revision": "3cecdc457560520e4d1945a66ab3e26029619f2a"
43
43
  }
44
44
  }
package/readme.md CHANGED
@@ -384,7 +384,7 @@ Or modify the `Packages/manifest.json' file manually:
384
384
  ```json
385
385
  {
386
386
  "dependencies": {
387
- "com.kyrylokuzyk.primetween": "1.3.1",
387
+ "com.kyrylokuzyk.primetween": "1.3.2",
388
388
  ...
389
389
  },
390
390
  "scopedRegistries": [