net.dreditor.phraseanimations 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/AnimData.cs +41 -41
- package/AnimData.cs.meta +11 -11
- package/DREditor.PhraseAnimations.asmdef +19 -19
- package/DREditor.PhraseAnimations.asmdef.meta +7 -7
- package/Editor/CompactPhraseTypeEditor.cs +96 -96
- package/Editor/CompactPhraseTypeEditor.cs.meta +11 -11
- package/Editor/PhraseAnimationEditor.cs +179 -179
- package/Editor/PhraseAnimationEditor.cs.meta +11 -11
- package/Editor/PhraseAnimationTypeEditor.cs +24 -24
- package/Editor/PhraseAnimationTypeEditor.cs.meta +11 -11
- package/Editor/PhraseAnimationTypeList.cs +23 -23
- package/Editor/PhraseAnimationTypeList.cs.meta +11 -11
- package/Editor/PhraseFadeTypeEditor.cs +18 -18
- package/Editor/PhraseFadeTypeEditor.cs.meta +11 -11
- package/Editor/PhraseRotationTypeEditor.cs +19 -19
- package/Editor/PhraseRotationTypeEditor.cs.meta +11 -11
- package/Editor/PhraseScaleTypeEditor.cs +19 -19
- package/Editor/PhraseScaleTypeEditor.cs.meta +11 -11
- package/Editor/PhraseTransformTypeEditor.cs +18 -18
- package/Editor/PhraseTransformTypeEditor.cs.meta +11 -11
- package/Editor/PhraseTypeEditor.cs +277 -277
- package/Editor/PhraseTypeEditor.cs.meta +11 -11
- package/Editor.meta +8 -8
- package/IPhraseAnimationType.cs +16 -16
- package/IPhraseAnimationType.cs.meta +11 -11
- package/PhraseAnimation.cs +73 -73
- package/PhraseAnimation.cs.meta +11 -11
- package/PhraseAnimationCompact.cs +44 -44
- package/PhraseAnimationCompact.cs.meta +11 -11
- package/PhraseAnimationHandler.cs +135 -135
- package/PhraseAnimationHandler.cs.meta +11 -11
- package/PhraseAnimationTypeBase.cs +53 -53
- package/PhraseAnimationTypeBase.cs.meta +11 -11
- package/PhraseFadeType.cs +19 -19
- package/PhraseFadeType.cs.meta +11 -11
- package/PhraseRotationType.cs +27 -27
- package/PhraseRotationType.cs.meta +11 -11
- package/PhraseScaleType.cs +25 -25
- package/PhraseScaleType.cs.meta +11 -11
- package/PhraseTransformType.cs +25 -25
- package/PhraseTransformType.cs.meta +11 -11
- package/package.json +42 -37
- package/package.json.meta +7 -7
package/.attestation.p7m
ADDED
|
Binary file
|
package/AnimData.cs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using UnityEngine;
|
|
3
|
-
|
|
4
|
-
namespace DREditor.PhraseAnimations
|
|
5
|
-
{
|
|
6
|
-
/// <summary>
|
|
7
|
-
///
|
|
8
|
-
/// </summary>
|
|
9
|
-
[System.Serializable]
|
|
10
|
-
public class AnimData
|
|
11
|
-
{
|
|
12
|
-
/// <summary>
|
|
13
|
-
///
|
|
14
|
-
/// </summary>
|
|
15
|
-
[SerializeReference]
|
|
16
|
-
public IPhraseAnimationType animationType;
|
|
17
|
-
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
public int typeIndex;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
/// <param name="animationType"></param>
|
|
28
|
-
public virtual void SetType(IPhraseAnimationType animationType) => this.animationType = animationType;
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
/// <param name="typeIndex"></param>
|
|
34
|
-
public virtual void SetIndex(int typeIndex) => this.typeIndex = typeIndex;
|
|
35
|
-
|
|
36
|
-
/// <summary>
|
|
37
|
-
///
|
|
38
|
-
/// </summary>
|
|
39
|
-
/// <param name="clip"></param>
|
|
40
|
-
public virtual void Initialize(AnimationClip clip) => animationType?.Initialize(clip);
|
|
41
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace DREditor.PhraseAnimations
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
///
|
|
8
|
+
/// </summary>
|
|
9
|
+
[System.Serializable]
|
|
10
|
+
public class AnimData
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
[SerializeReference]
|
|
16
|
+
public IPhraseAnimationType animationType;
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
public int typeIndex;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
/// <param name="animationType"></param>
|
|
28
|
+
public virtual void SetType(IPhraseAnimationType animationType) => this.animationType = animationType;
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
/// <param name="typeIndex"></param>
|
|
34
|
+
public virtual void SetIndex(int typeIndex) => this.typeIndex = typeIndex;
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
///
|
|
38
|
+
/// </summary>
|
|
39
|
+
/// <param name="clip"></param>
|
|
40
|
+
public virtual void Initialize(AnimationClip clip) => animationType?.Initialize(clip);
|
|
41
|
+
}
|
|
42
42
|
}
|
package/AnimData.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: ae9893f91b0ee6541a8de288cdbb21a4
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: ae9893f91b0ee6541a8de288cdbb21a4
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "DREditor.PhraseAnimations",
|
|
3
|
-
"rootNamespace": "",
|
|
4
|
-
"references": [
|
|
5
|
-
"DREditor",
|
|
6
|
-
"Unity.TextMeshPro",
|
|
7
|
-
"DREditor.Editor",
|
|
8
|
-
"DREditor.Minigames",
|
|
9
|
-
"DREditor.Minigames.Debates"
|
|
10
|
-
],
|
|
11
|
-
"includePlatforms": [],
|
|
12
|
-
"excludePlatforms": [],
|
|
13
|
-
"allowUnsafeCode": false,
|
|
14
|
-
"overrideReferences": false,
|
|
15
|
-
"precompiledReferences": [],
|
|
16
|
-
"autoReferenced": true,
|
|
17
|
-
"defineConstraints": [],
|
|
18
|
-
"versionDefines": [],
|
|
19
|
-
"noEngineReferences": false
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.PhraseAnimations",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"DREditor",
|
|
6
|
+
"Unity.TextMeshPro",
|
|
7
|
+
"DREditor.Editor",
|
|
8
|
+
"DREditor.Minigames",
|
|
9
|
+
"DREditor.Minigames.Debates"
|
|
10
|
+
],
|
|
11
|
+
"includePlatforms": [],
|
|
12
|
+
"excludePlatforms": [],
|
|
13
|
+
"allowUnsafeCode": false,
|
|
14
|
+
"overrideReferences": false,
|
|
15
|
+
"precompiledReferences": [],
|
|
16
|
+
"autoReferenced": true,
|
|
17
|
+
"defineConstraints": [],
|
|
18
|
+
"versionDefines": [],
|
|
19
|
+
"noEngineReferences": false
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e383c2b79aa802c4d8f983e9d5520a89
|
|
3
|
-
AssemblyDefinitionImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e383c2b79aa802c4d8f983e9d5520a89
|
|
3
|
+
AssemblyDefinitionImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
#if UNITY_EDITOR
|
|
3
|
-
using System;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.PhraseAnimations.Editor
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
/// <typeparam name="T"></typeparam>
|
|
12
|
-
/// <typeparam name="T2"></typeparam>
|
|
13
|
-
public abstract class CompactPhraseTypeEditor<T, T2> : PhraseAnimationTypeEditor<T>
|
|
14
|
-
where T : PhraseAnimationCompact<T2>
|
|
15
|
-
where T2 : struct
|
|
16
|
-
{
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
public abstract string TypeName { get; }
|
|
21
|
-
|
|
22
|
-
/// <summary>
|
|
23
|
-
///
|
|
24
|
-
/// </summary>
|
|
25
|
-
public abstract Func<string, T2, int, int, T2> FieldFunc { get; }
|
|
26
|
-
|
|
27
|
-
protected override void DisplayType()
|
|
28
|
-
{
|
|
29
|
-
typeTarget.SetStartValue(FieldFunc($"Starting {TypeName}: ", typeTarget.startValue, 200, 6));
|
|
30
|
-
|
|
31
|
-
typeTarget.SetEndValue(FieldFunc($"Ending {TypeName}: ", typeTarget.endValue, 200, 6));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
protected override void DisplayCurves() => PopulateCurves(DisplayCurve);
|
|
35
|
-
|
|
36
|
-
protected override void UpdateCurves() => PopulateCurves(UpdateKey);
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
/// <param name="operation"></param>
|
|
42
|
-
protected virtual void PopulateCurves(Func<AnimationCurve, float, float, AnimationCurve> operation)
|
|
43
|
-
{
|
|
44
|
-
if (typeof(T2) == typeof(float))
|
|
45
|
-
typeTarget.animationCurves[0] = operation(
|
|
46
|
-
typeTarget.animationCurves[0],
|
|
47
|
-
(float)(object)typeTarget.startValue,
|
|
48
|
-
(float)(object)typeTarget.endValue);
|
|
49
|
-
else
|
|
50
|
-
EditVectorCurves(typeTarget.startValue, typeTarget.endValue, operation);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/// <summary>
|
|
54
|
-
///
|
|
55
|
-
/// </summary>
|
|
56
|
-
/// <typeparam name="T3"></typeparam>
|
|
57
|
-
/// <param name="start"></param>
|
|
58
|
-
/// <param name="end"></param>
|
|
59
|
-
/// <param name="operation"></param>
|
|
60
|
-
/// <param name="offset"></param>
|
|
61
|
-
protected virtual void EditVectorCurves<T3>
|
|
62
|
-
(T3 start, T3 end, Func<AnimationCurve, float, float, AnimationCurve> operation, int offset = 0)
|
|
63
|
-
where T3 : struct
|
|
64
|
-
{
|
|
65
|
-
for (int i = 0; i < typeBaseTarget.CurveCount; i++)
|
|
66
|
-
{
|
|
67
|
-
int index = i + offset;
|
|
68
|
-
|
|
69
|
-
float startVal = GetVectorComponent(start, i);
|
|
70
|
-
|
|
71
|
-
float endVal = GetVectorComponent(end, i);
|
|
72
|
-
|
|
73
|
-
typeBaseTarget.animationCurves[index] = operation(typeBaseTarget.animationCurves[index], startVal, endVal);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/// <summary>
|
|
78
|
-
///
|
|
79
|
-
/// </summary>
|
|
80
|
-
/// <typeparam name="T4"></typeparam>
|
|
81
|
-
/// <param name="vector"></param>
|
|
82
|
-
/// <param name="index"></param>
|
|
83
|
-
/// <returns></returns>
|
|
84
|
-
/// <exception cref="ArgumentException"></exception>
|
|
85
|
-
protected float GetVectorComponent<T4>(T4 vector, int index) where T4 : struct
|
|
86
|
-
{
|
|
87
|
-
return vector switch
|
|
88
|
-
{
|
|
89
|
-
Vector2 v2 => v2[index],
|
|
90
|
-
Vector3 v3 => v3[index],
|
|
91
|
-
Vector4 v4 => v4[index],
|
|
92
|
-
_ => throw new ArgumentException($"Unsupported vector type: {typeof(T4)}")
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using System;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.PhraseAnimations.Editor
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
/// <typeparam name="T"></typeparam>
|
|
12
|
+
/// <typeparam name="T2"></typeparam>
|
|
13
|
+
public abstract class CompactPhraseTypeEditor<T, T2> : PhraseAnimationTypeEditor<T>
|
|
14
|
+
where T : PhraseAnimationCompact<T2>
|
|
15
|
+
where T2 : struct
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
public abstract string TypeName { get; }
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
public abstract Func<string, T2, int, int, T2> FieldFunc { get; }
|
|
26
|
+
|
|
27
|
+
protected override void DisplayType()
|
|
28
|
+
{
|
|
29
|
+
typeTarget.SetStartValue(FieldFunc($"Starting {TypeName}: ", typeTarget.startValue, 200, 6));
|
|
30
|
+
|
|
31
|
+
typeTarget.SetEndValue(FieldFunc($"Ending {TypeName}: ", typeTarget.endValue, 200, 6));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected override void DisplayCurves() => PopulateCurves(DisplayCurve);
|
|
35
|
+
|
|
36
|
+
protected override void UpdateCurves() => PopulateCurves(UpdateKey);
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <param name="operation"></param>
|
|
42
|
+
protected virtual void PopulateCurves(Func<AnimationCurve, float, float, AnimationCurve> operation)
|
|
43
|
+
{
|
|
44
|
+
if (typeof(T2) == typeof(float))
|
|
45
|
+
typeTarget.animationCurves[0] = operation(
|
|
46
|
+
typeTarget.animationCurves[0],
|
|
47
|
+
(float)(object)typeTarget.startValue,
|
|
48
|
+
(float)(object)typeTarget.endValue);
|
|
49
|
+
else
|
|
50
|
+
EditVectorCurves(typeTarget.startValue, typeTarget.endValue, operation);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
///
|
|
55
|
+
/// </summary>
|
|
56
|
+
/// <typeparam name="T3"></typeparam>
|
|
57
|
+
/// <param name="start"></param>
|
|
58
|
+
/// <param name="end"></param>
|
|
59
|
+
/// <param name="operation"></param>
|
|
60
|
+
/// <param name="offset"></param>
|
|
61
|
+
protected virtual void EditVectorCurves<T3>
|
|
62
|
+
(T3 start, T3 end, Func<AnimationCurve, float, float, AnimationCurve> operation, int offset = 0)
|
|
63
|
+
where T3 : struct
|
|
64
|
+
{
|
|
65
|
+
for (int i = 0; i < typeBaseTarget.CurveCount; i++)
|
|
66
|
+
{
|
|
67
|
+
int index = i + offset;
|
|
68
|
+
|
|
69
|
+
float startVal = GetVectorComponent(start, i);
|
|
70
|
+
|
|
71
|
+
float endVal = GetVectorComponent(end, i);
|
|
72
|
+
|
|
73
|
+
typeBaseTarget.animationCurves[index] = operation(typeBaseTarget.animationCurves[index], startVal, endVal);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
///
|
|
79
|
+
/// </summary>
|
|
80
|
+
/// <typeparam name="T4"></typeparam>
|
|
81
|
+
/// <param name="vector"></param>
|
|
82
|
+
/// <param name="index"></param>
|
|
83
|
+
/// <returns></returns>
|
|
84
|
+
/// <exception cref="ArgumentException"></exception>
|
|
85
|
+
protected float GetVectorComponent<T4>(T4 vector, int index) where T4 : struct
|
|
86
|
+
{
|
|
87
|
+
return vector switch
|
|
88
|
+
{
|
|
89
|
+
Vector2 v2 => v2[index],
|
|
90
|
+
Vector3 v3 => v3[index],
|
|
91
|
+
Vector4 v4 => v4[index],
|
|
92
|
+
_ => throw new ArgumentException($"Unsupported vector type: {typeof(T4)}")
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
97
|
#endif
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 7421e48f9cec91d4ea40cfded3f35968
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 7421e48f9cec91d4ea40cfded3f35968
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|