(BREAKING) Make constructors non-public:

- Fix inconsistency where constructors were public.
This commit is contained in:
Haï~
2024-08-18 07:02:01 +02:00
parent 0bddfdd7a3
commit 68e20a0ffb
6 changed files with 41 additions and 32 deletions
@@ -616,6 +616,10 @@ namespace AnimatorAsCode.V1
private readonly Dictionary<string, int> _intOverrides = new Dictionary<string, int>();
private readonly Dictionary<string, bool> _boolOverrides = new Dictionary<string, bool>();
internal AacFlNoAnimator()
{
}
/// Create a Float parameter, for use without a backing animator.
public AacFlFloatParameter FloatParameter(string parameterName)
{
@@ -689,7 +693,7 @@ namespace AnimatorAsCode.V1
private readonly AacConfiguration _configuration;
private readonly AacFlBase _base;
public AacFlController(AacConfiguration configuration, AnimatorController animatorAnimatorController, AacFlBase originalBase)
internal AacFlController(AacConfiguration configuration, AnimatorController animatorAnimatorController, AacFlBase originalBase)
{
AnimatorController = animatorAnimatorController;
_configuration = configuration;
@@ -709,7 +713,7 @@ namespace AnimatorAsCode.V1
{
private readonly AnimatorController _animatorController;
public AacAnimatorRemoval(AnimatorController animatorController)
internal AacAnimatorRemoval(AnimatorController animatorController)
{
_animatorController = animatorController;
}
@@ -1,4 +1,5 @@
using UnityEditor.Animations;
using JetBrains.Annotations;
using UnityEditor.Animations;
using UnityEngine;
// ReSharper disable once CheckNamespace
@@ -18,7 +19,7 @@ namespace AnimatorAsCode.V1
{
private readonly bool _writeDefaults;
public AacDefaultsProvider(bool writeDefaults = false)
[PublicAPI] public AacDefaultsProvider(bool writeDefaults = false)
{
_writeDefaults = writeDefaults;
}
@@ -16,7 +16,7 @@ namespace AnimatorAsCode.V1
/// Exposes the underlying Unity Clip asset.
[PublicAPI] public AnimationClip Clip { get; }
public AacFlClip(AacConfiguration component, AnimationClip clip)
internal AacFlClip(AacConfiguration component, AnimationClip clip)
{
_component = component;
Clip = clip;
@@ -315,7 +315,7 @@ namespace AnimatorAsCode.V1
private readonly AacConfiguration _component;
[PublicAPI] public AnimationClip Clip { get; }
public AacFlEditClip(AacConfiguration component, AnimationClip clip)
internal AacFlEditClip(AacConfiguration component, AnimationClip clip)
{
_component = component;
Clip = clip;
@@ -448,7 +448,7 @@ namespace AnimatorAsCode.V1
private readonly AnimationClip _clip;
private readonly EditorCurveBinding[] _bindings;
public AacFlSettingCurve(AnimationClip clip, EditorCurveBinding[] bindings)
internal AacFlSettingCurve(AnimationClip clip, EditorCurveBinding[] bindings)
{
_clip = clip;
_bindings = bindings;
@@ -517,7 +517,7 @@ namespace AnimatorAsCode.V1
private readonly AnimationClip _clip;
private readonly EditorCurveBinding[] _bindings;
public AacFlSettingCurveObjectReference(AnimationClip clip, EditorCurveBinding[] bindings)
internal AacFlSettingCurveObjectReference(AnimationClip clip, EditorCurveBinding[] bindings)
{
_clip = clip;
_bindings = bindings;
@@ -563,7 +563,7 @@ namespace AnimatorAsCode.V1
private readonly AacFlUnit _unit;
private readonly List<ObjectReferenceKeyframe> _mutatedKeyframes;
public AacFlSettingKeyframesObjectReference(AacFlUnit unit, List<ObjectReferenceKeyframe> mutatedKeyframes)
internal AacFlSettingKeyframesObjectReference(AacFlUnit unit, List<ObjectReferenceKeyframe> mutatedKeyframes)
{
_unit = unit;
_mutatedKeyframes = mutatedKeyframes;
@@ -597,7 +597,7 @@ namespace AnimatorAsCode.V1
private readonly EditorCurveBinding[] _bindings;
private readonly bool _hdr;
public AacFlSettingCurveColor(AnimationClip clip, EditorCurveBinding[] bindings, bool hdr = false)
internal AacFlSettingCurveColor(AnimationClip clip, EditorCurveBinding[] bindings, bool hdr = false)
{
_clip = clip;
_bindings = bindings;
@@ -648,7 +648,7 @@ namespace AnimatorAsCode.V1
private readonly AacFlUnit _unit;
private readonly List<Keyframe> _mutatedKeyframes;
public AacFlSettingKeyframes(AacFlUnit unit, List<Keyframe> mutatedKeyframes)
internal AacFlSettingKeyframes(AacFlUnit unit, List<Keyframe> mutatedKeyframes)
{
_unit = unit;
_mutatedKeyframes = mutatedKeyframes;
@@ -715,7 +715,7 @@ namespace AnimatorAsCode.V1
private AacFlSettingKeyframes _b;
private AacFlSettingKeyframes _a;
public AacFlSettingKeyframesColor(AacFlUnit unit, List<Keyframe> mutatedKeyframesR, List<Keyframe> mutatedKeyframesG, List<Keyframe> mutatedKeyframesB, List<Keyframe> mutatedKeyframesA)
internal AacFlSettingKeyframesColor(AacFlUnit unit, List<Keyframe> mutatedKeyframesR, List<Keyframe> mutatedKeyframesG, List<Keyframe> mutatedKeyframesB, List<Keyframe> mutatedKeyframesA)
{
_r = new AacFlSettingKeyframes(unit, mutatedKeyframesR);
_g = new AacFlSettingKeyframes(unit, mutatedKeyframesG);
@@ -19,7 +19,7 @@ namespace AnimatorAsCode.V1
public class AacFlNonInitializedBlendTree : AacFlBlendTree
{
public AacFlNonInitializedBlendTree(BlendTree blendTree) : base(blendTree)
internal AacFlNonInitializedBlendTree(BlendTree blendTree) : base(blendTree)
{
}
@@ -71,7 +71,7 @@ namespace AnimatorAsCode.V1
public class AacFlBlendTree2D : AacFlBlendTree
{
public AacFlBlendTree2D(BlendTree blendTree) : base(blendTree)
internal AacFlBlendTree2D(BlendTree blendTree) : base(blendTree)
{
}
@@ -197,7 +197,7 @@ namespace AnimatorAsCode.V1
public class AacFlBlendTree1D : AacFlBlendTree
{
public AacFlBlendTree1D(BlendTree blendTree) : base(blendTree)
internal AacFlBlendTree1D(BlendTree blendTree) : base(blendTree)
{
}
@@ -278,7 +278,7 @@ namespace AnimatorAsCode.V1
public class AacFlBlendTreeDirect : AacFlBlendTree
{
public AacFlBlendTreeDirect(BlendTree blendTree) : base(blendTree)
internal AacFlBlendTreeDirect(BlendTree blendTree) : base(blendTree)
{
}
@@ -356,7 +356,11 @@ namespace AnimatorAsCode.V1
internal float TimeScale { get; set; } = 1f;
internal bool Mirror { get; set; }
internal float CycleOffset { get; set; }
internal AacFlBlendTreeChildMotion()
{
}
/// Set the time scale. The time scale value is 1 by default.
public AacFlBlendTreeChildMotion WithTimeScaleSetTo(float timeScale)
{
@@ -12,7 +12,7 @@ namespace AnimatorAsCode.V1
{
private readonly Action<AacFlCondition> _action;
public AacFlConditionSimple(Action<AacFlCondition> action)
private AacFlConditionSimple(Action<AacFlCondition> action)
{
_action = action;
}
@@ -279,7 +279,7 @@ namespace AnimatorAsCode.V1
private readonly string[] _names;
private readonly bool _value;
public AacFlBoolParameterIsAnyOrCondition(string[] names, bool value)
internal AacFlBoolParameterIsAnyOrCondition(string[] names, bool value)
{
_names = names;
_value = value;
@@ -12,7 +12,7 @@ namespace AnimatorAsCode.V1
{
private readonly AacAnimatorGenerator _generator;
public AacBackingAnimator(AacAnimatorGenerator animatorGenerator)
internal AacBackingAnimator(AacAnimatorGenerator animatorGenerator)
{
_generator = animatorGenerator;
}
@@ -362,7 +362,7 @@ namespace AnimatorAsCode.V1
private readonly AnimatorStateMachine _machine;
public AacFlState(AnimatorState state, AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider, Transform animatorRoot) : base(parentMachine, defaultsProvider, animatorRoot)
internal AacFlState(AnimatorState state, AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider, Transform animatorRoot) : base(parentMachine, defaultsProvider, animatorRoot)
{
State = state;
_machine = parentMachine.Machine;
@@ -544,7 +544,7 @@ namespace AnimatorAsCode.V1
{
private readonly AnimatorStateTransition _transition;
public AacFlTransition(AnimatorStateTransition transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
internal AacFlTransition(AnimatorStateTransition transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
{
_transition = transition;
}
@@ -655,7 +655,7 @@ namespace AnimatorAsCode.V1
public class AacFlEntryTransition : AacFlNewTransitionContinuation
{
public AacFlEntryTransition(AnimatorTransition transition, AnimatorStateMachine machine, AnimatorState sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
internal AacFlEntryTransition(AnimatorTransition transition, AnimatorStateMachine machine, AnimatorState sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
{
}
}
@@ -674,7 +674,7 @@ namespace AnimatorAsCode.V1
{
private readonly AnimatorTransitionBase _transition;
public AacFlCondition(AnimatorTransitionBase transition)
internal AacFlCondition(AnimatorTransitionBase transition)
{
_transition = transition;
}
@@ -695,7 +695,7 @@ namespace AnimatorAsCode.V1
private readonly AacTransitionEndpoint _sourceNullableIfAny;
private readonly AacTransitionEndpoint _destinationNullableIfExits;
public AacFlNewTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits)
internal AacFlNewTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits)
{
Transition = transition;
_machine = machine;
@@ -765,7 +765,7 @@ namespace AnimatorAsCode.V1
public class AacFlTransitionContinuation : AacFlTransitionContinuationAbstractWithOr
{
public AacFlTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
internal AacFlTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
{
}
@@ -805,7 +805,7 @@ namespace AnimatorAsCode.V1
{
private readonly List<AacFlTransitionContinuation> _pendingContinuations;
public AacFlMultiTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits, List<AacFlTransitionContinuation> pendingContinuations) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
internal AacFlMultiTransitionContinuation(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits, List<AacFlTransitionContinuation> pendingContinuations) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
{
_pendingContinuations = pendingContinuations;
}
@@ -852,7 +852,7 @@ namespace AnimatorAsCode.V1
public class AacFlTransitionContinuationOnlyOr : AacFlTransitionContinuationAbstractWithOr
{
public AacFlTransitionContinuationOnlyOr(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
internal AacFlTransitionContinuationOnlyOr(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits) : base(transition, machine, sourceNullableIfAny, destinationNullableIfExits)
{
}
}
@@ -864,7 +864,7 @@ namespace AnimatorAsCode.V1
private readonly AacTransitionEndpoint _sourceNullableIfAny;
private readonly AacTransitionEndpoint _destinationNullableIfExits;
public AacFlTransitionContinuationAbstractWithOr(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits)
protected AacFlTransitionContinuationAbstractWithOr(AnimatorTransitionBase transition, AnimatorStateMachine machine, AacTransitionEndpoint sourceNullableIfAny, AacTransitionEndpoint destinationNullableIfExits)
{
Transition = transition;
_machine = machine;
@@ -980,7 +980,7 @@ namespace AnimatorAsCode.V1
{
private readonly AnimatorTransitionBase _transition;
public AacFlTransitionContinuationWithoutOr(AnimatorTransitionBase transition)
internal AacFlTransitionContinuationWithoutOr(AnimatorTransitionBase transition)
{
_transition = transition;
}
@@ -1008,12 +1008,12 @@ namespace AnimatorAsCode.V1
private readonly AnimatorState _state;
private readonly AnimatorStateMachine _stateMachine;
public AacTransitionEndpoint(AnimatorState state)
private AacTransitionEndpoint(AnimatorState state)
{
_state = state;
}
public AacTransitionEndpoint(AnimatorStateMachine stateMachine)
private AacTransitionEndpoint(AnimatorStateMachine stateMachine)
{
_stateMachine = stateMachine;
}