From 0bddfdd7a37176e9230be9d6ac25de14d67b4f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=C3=AF=7E?= Date: Sun, 18 Aug 2024 04:23:51 +0200 Subject: [PATCH] (BREAKING) Replace public readonly fields with properties: - Fix inconsistency by replacing public readonly fields with getter-only properties. - Add PublicAPI annotation where it was missing. --- .../dev.hai-vr.animator-as-code.v1/V1/Editor/Aac.cs | 9 +++++---- .../V1/Editor/AacFlAnimations.cs | 5 +++-- .../V1/Editor/AacFlStates.cs | 13 +++++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/Aac.cs b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/Aac.cs index 829fe16..c260c3d 100644 --- a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/Aac.cs +++ b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/Aac.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using JetBrains.Annotations; using UnityEditor; using UnityEditor.Animations; using UnityEngine; @@ -683,14 +684,14 @@ namespace AnimatorAsCode.V1 public class AacFlController { /// Exposes the underlying Unity AnimatorController. - public readonly AnimatorController AnimatorController; - + [PublicAPI] public AnimatorController AnimatorController { get; } + private readonly AacConfiguration _configuration; private readonly AacFlBase _base; - public AacFlController(AacConfiguration configuration, AnimatorController animatorController, AacFlBase originalBase) + public AacFlController(AacConfiguration configuration, AnimatorController animatorAnimatorController, AacFlBase originalBase) { - AnimatorController = animatorController; + AnimatorController = animatorAnimatorController; _configuration = configuration; _base = originalBase; } diff --git a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs index ada80bf..080ef61 100644 --- a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs +++ b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlAnimations.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using JetBrains.Annotations; using UnityEditor; using UnityEngine; using Object = UnityEngine.Object; @@ -13,7 +14,7 @@ namespace AnimatorAsCode.V1 private readonly AacConfiguration _component; /// Exposes the underlying Unity Clip asset. - public AnimationClip Clip { get; } + [PublicAPI] public AnimationClip Clip { get; } public AacFlClip(AacConfiguration component, AnimationClip clip) { @@ -312,7 +313,7 @@ namespace AnimatorAsCode.V1 public class AacFlEditClip { private readonly AacConfiguration _component; - public AnimationClip Clip { get; } + [PublicAPI] public AnimationClip Clip { get; } public AacFlEditClip(AacConfiguration component, AnimationClip clip) { diff --git a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs index 831fe21..772b12a 100644 --- a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs +++ b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using JetBrains.Annotations; using UnityEditor.Animations; using UnityEngine; @@ -111,8 +112,8 @@ namespace AnimatorAsCode.V1 public class AacFlStateMachine : AacAnimatorNode { /// Exposes the underlying Unity AnimatorStateMachine object of this state machine. - public readonly AnimatorStateMachine Machine; - + [PublicAPI] public AnimatorStateMachine Machine { get; } + private readonly AnimationClip _emptyClip; private readonly AacBackingAnimator _backingAnimator; private readonly IAacDefaultsProvider _defaultsProvider; @@ -356,7 +357,9 @@ namespace AnimatorAsCode.V1 public class AacFlState : AacAnimatorNode { - public readonly AnimatorState State; + /// Exposes the underlying Unity AnimatorState of this state. + [PublicAPI] public AnimatorState State { get; } + private readonly AnimatorStateMachine _machine; public AacFlState(AnimatorState state, AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider, Transform animatorRoot) : base(parentMachine, defaultsProvider, animatorRoot) @@ -685,7 +688,9 @@ namespace AnimatorAsCode.V1 public class AacFlNewTransitionContinuation { - public readonly AnimatorTransitionBase Transition; + /// Exposes the underlying Unity AnimatorTransitionBase of this transition. + [PublicAPI] public AnimatorTransitionBase Transition { get; } + private readonly AnimatorStateMachine _machine; private readonly AacTransitionEndpoint _sourceNullableIfAny; private readonly AacTransitionEndpoint _destinationNullableIfExits;