(BREAKING) Replace structs with classes
This commit is contained in:
@@ -50,7 +50,7 @@ namespace AnimatorAsCode.V1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct AacFlLayer
|
public class AacFlLayer
|
||||||
{
|
{
|
||||||
private readonly AnimatorController _animatorController;
|
private readonly AnimatorController _animatorController;
|
||||||
private readonly AacConfiguration _configuration;
|
private readonly AacConfiguration _configuration;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
@@ -16,9 +14,6 @@ namespace AnimatorAsCode.V1
|
|||||||
protected readonly AacFlStateMachine ParentMachine;
|
protected readonly AacFlStateMachine ParentMachine;
|
||||||
protected readonly IAacDefaultsProvider DefaultsProvider;
|
protected readonly IAacDefaultsProvider DefaultsProvider;
|
||||||
|
|
||||||
// TODO: What is this for???
|
|
||||||
protected Dictionary<Type, object> behaviorCache = new Dictionary<Type, object>();
|
|
||||||
|
|
||||||
protected AacAnimatorNode(AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider)
|
protected AacAnimatorNode(AacFlStateMachine parentMachine, IAacDefaultsProvider defaultsProvider)
|
||||||
{
|
{
|
||||||
ParentMachine = parentMachine;
|
ParentMachine = parentMachine;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using UnityEngine;
|
|||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace AnimatorAsCode.V1
|
namespace AnimatorAsCode.V1
|
||||||
{
|
{
|
||||||
public readonly struct AacFlClip
|
public class AacFlClip
|
||||||
{
|
{
|
||||||
private readonly AacConfiguration _component;
|
private readonly AacConfiguration _component;
|
||||||
public AnimationClip Clip { get; }
|
public AnimationClip Clip { get; }
|
||||||
@@ -146,7 +146,7 @@ namespace AnimatorAsCode.V1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly struct AacFlEditClip
|
public class AacFlEditClip
|
||||||
{
|
{
|
||||||
private readonly AacConfiguration _component;
|
private readonly AacConfiguration _component;
|
||||||
public AnimationClip Clip { get; }
|
public AnimationClip Clip { get; }
|
||||||
|
|||||||
@@ -308,9 +308,6 @@ namespace AnimatorAsCode.V1
|
|||||||
|
|
||||||
public override TBehaviour EnsureBehaviour<TBehaviour>()
|
public override TBehaviour EnsureBehaviour<TBehaviour>()
|
||||||
{
|
{
|
||||||
if (behaviorCache.TryGetValue(typeof(TBehaviour), out var existingBehavior))
|
|
||||||
return (TBehaviour)existingBehavior;
|
|
||||||
|
|
||||||
foreach (var behaviour in Machine.behaviours)
|
foreach (var behaviour in Machine.behaviours)
|
||||||
if (behaviour is TBehaviour myBehaviour)
|
if (behaviour is TBehaviour myBehaviour)
|
||||||
return myBehaviour;
|
return myBehaviour;
|
||||||
@@ -462,9 +459,6 @@ namespace AnimatorAsCode.V1
|
|||||||
|
|
||||||
public override TBehaviour EnsureBehaviour<TBehaviour>()
|
public override TBehaviour EnsureBehaviour<TBehaviour>()
|
||||||
{
|
{
|
||||||
if (behaviorCache.TryGetValue(typeof(TBehaviour), out var existingBehavior))
|
|
||||||
return (TBehaviour)existingBehavior;
|
|
||||||
|
|
||||||
foreach (var behaviour in State.behaviours)
|
foreach (var behaviour in State.behaviours)
|
||||||
if (behaviour is TBehaviour myBehaviour)
|
if (behaviour is TBehaviour myBehaviour)
|
||||||
return myBehaviour;
|
return myBehaviour;
|
||||||
|
|||||||
Reference in New Issue
Block a user