Skip to content

Commit da6a22a

Browse files
committed
Merge branch 'feature/anim-controller-reader-attribute'
2 parents c00c1e1 + cc18287 commit da6a22a

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

Diff for: Assets/NaughtyAttributes/Scripts/Test/AnimatorParamTest.cs

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
using UnityEditor.Animations;
2-
using UnityEngine;
1+
using UnityEngine;
32

43
namespace NaughtyAttributes.Test
54
{
65
public class AnimatorParamTest : MonoBehaviour
76
{
87
public Animator animator0;
98

10-
public AnimatorController animatorController0;
9+
#if UNITY_EDITOR
10+
public UnityEditor.Animations.AnimatorController animatorController0;
11+
#endif
1112

1213
[AnimatorParam("animator0")]
1314
public int hash0;
@@ -39,11 +40,16 @@ private void TestLog()
3940
public class AnimatorParamNest1
4041
{
4142
public Animator animator1;
42-
public AnimatorController animatorController1;
43-
43+
44+
#if UNITY_EDITOR
45+
public UnityEditor.Animations.AnimatorController animatorController1;
46+
#endif
47+
4448
private Animator Animator1 => animator1;
4549

46-
private AnimatorController AnimatorController1 => animatorController1;
50+
#if UNITY_EDITOR
51+
private UnityEditor.Animations.AnimatorController AnimatorController1 => animatorController1;
52+
#endif
4753

4854
[AnimatorParam("Animator1", AnimatorControllerParameterType.Bool)]
4955
public int hash1;
@@ -64,12 +70,17 @@ public class AnimatorParamNest1
6470
public class AnimatorParamNest2
6571
{
6672
public Animator animator2;
67-
public AnimatorController animatorController2;
68-
73+
74+
#if UNITY_EDITOR
75+
public UnityEditor.Animations.AnimatorController animatorController2;
76+
#endif
77+
6978
private Animator GetAnimator2() => animator2;
7079

71-
private AnimatorController GetAnimatorController2() => animatorController2;
72-
80+
#if UNITY_EDITOR
81+
private UnityEditor.Animations.AnimatorController GetAnimatorController2() => animatorController2;
82+
#endif
83+
7384
[AnimatorParam("GetAnimator2", AnimatorControllerParameterType.Int)]
7485
public int hash1;
7586

Diff for: Assets/NaughtyAttributes/Scripts/Test/_NaughtyScriptableObject.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Collections.Generic;
2-
using UnityEditor.Animations;
32
using UnityEngine;
43

54
namespace NaughtyAttributes.Test
@@ -10,12 +9,14 @@ public class _NaughtyScriptableObject : ScriptableObject
109
[Expandable]
1110
public List<_TestScriptableObject> list;
1211

13-
public AnimatorController animatorController0;
12+
#if UNITY_EDITOR
13+
public UnityEditor.Animations.AnimatorController animatorController0;
14+
#endif
1415

15-
[AnimatorParam(nameof(animatorController0))]
16+
[AnimatorParam("animatorController0")]
1617
public int hashController0;
1718

18-
[AnimatorParam(nameof(animatorController0))]
19+
[AnimatorParam("animatorController0")]
1920
public string nameController0;
2021

2122

0 commit comments

Comments
 (0)