(BREAKING) Replace structs with classes

This commit is contained in:
Haï~
2023-10-02 04:53:27 +02:00
parent fd5c47e83c
commit a1e5a43491
4 changed files with 3 additions and 14 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ namespace AnimatorAsCode.V1
}
}
public struct AacFlLayer
public class AacFlLayer
{
private readonly AnimatorController _animatorController;
private readonly AacConfiguration _configuration;
-5
View File
@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// ReSharper disable once CheckNamespace
@@ -16,9 +14,6 @@ namespace AnimatorAsCode.V1
protected readonly AacFlStateMachine ParentMachine;
protected readonly IAacDefaultsProvider DefaultsProvider;
// TODO: What is this for???
protected Dictionary<Type, object> behaviorCache = new Dictionary<Type, object>();
protected AacAnimatorNode(AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider)
{
ParentMachine = parentMachine;
+2 -2
View File
@@ -7,7 +7,7 @@ using UnityEngine;
// ReSharper disable once CheckNamespace
namespace AnimatorAsCode.V1
{
public readonly struct AacFlClip
public class AacFlClip
{
private readonly AacConfiguration _component;
public AnimationClip Clip { get; }
@@ -146,7 +146,7 @@ namespace AnimatorAsCode.V1
}
}
public readonly struct AacFlEditClip
public class AacFlEditClip
{
private readonly AacConfiguration _component;
public AnimationClip Clip { get; }
-6
View File
@@ -308,9 +308,6 @@ namespace AnimatorAsCode.V1
public override TBehaviour EnsureBehaviour<TBehaviour>()
{
if (behaviorCache.TryGetValue(typeof(TBehaviour), out var existingBehavior))
return (TBehaviour)existingBehavior;
foreach (var behaviour in Machine.behaviours)
if (behaviour is TBehaviour myBehaviour)
return myBehaviour;
@@ -462,9 +459,6 @@ namespace AnimatorAsCode.V1
public override TBehaviour EnsureBehaviour<TBehaviour>()
{
if (behaviorCache.TryGetValue(typeof(TBehaviour), out var existingBehavior))
return (TBehaviour)existingBehavior;
foreach (var behaviour in State.behaviours)
if (behaviour is TBehaviour myBehaviour)
return myBehaviour;