net.dreditor.trackphrase 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.
@@ -1,101 +1,101 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if UNITY_EDITOR && CINEMACHINE
3
- using Cinemachine;
4
- using DREditor.Editor.Utility;
5
- using UnityEditor;
6
- using UnityEngine;
7
-
8
- namespace DREditor.TrackPhrase
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- [CustomClassEditor(typeof(TrackPath))]
14
- public class TrackAnimationEditor : ClassEditorTypeBase<TrackPath>
15
- {
16
- /// <inheritdoc/>
17
- protected override void OnInspectorGUI() => PhraseTrack();
18
-
19
- /// <summary>
20
- ///
21
- /// </summary>
22
- protected virtual void PhraseTrack()
23
- {
24
- target.Position = HandyFields.Vector3Field("Track Position: ", target.Position, 200, 7);
25
-
26
- target.Rotation = HandyFields.Vector4Field("Track Angle: ", target.Rotation, 200, 7);
27
-
28
- DisplayTrackSpeed();
29
-
30
- GUILayout.Space(25);
31
- }
32
-
33
- /// <summary>
34
- ///
35
- /// </summary>
36
- protected virtual void DisplayTrackSpeed()
37
- {
38
- using (new GUILayout.HorizontalScope())
39
- {
40
- ImportPathSelection();
41
-
42
- DisplayClearWaypointsButton();
43
-
44
- target.SpeedCurve = EditorGUILayout.CurveField(target.SpeedCurve);
45
-
46
- DisplayResetCurveButton();
47
- }
48
- }
49
-
50
- /// <summary>
51
- ///
52
- /// </summary>
53
- protected virtual void ImportPathSelection()
54
- {
55
- if (GUILayout.Button("Import Selection", GUILayout.Width(130)))
56
- {
57
- CinemachinePath.Waypoint[] points = Selection.gameObjects[0].GetComponent<CinemachinePath>().m_Waypoints;
58
-
59
- if (points != null && points.Length > 0)
60
- target.Points = points;
61
- else
62
- UnityEngine.Debug.Log("You need to select a Path in the hierarchy!");
63
- }
64
- }
65
-
66
- /// <summary>
67
- ///
68
- /// </summary>
69
- protected virtual void DisplayClearWaypointsButton()
70
- {
71
- if (GUILayout.Button("Clear Waypoints", GUILayout.Width(130)))
72
- target.Points = null;
73
-
74
- if (target.SpeedCurve == null)
75
- ResetTrackCurve();
76
- }
77
-
78
- /// <summary>
79
- ///
80
- /// </summary>
81
- protected virtual void DisplayResetCurveButton()
82
- {
83
- if (GUILayout.Button("Reset Curve", GUILayout.Width(100)) &&
84
- EditorUtility.DisplayDialog("Reset Curve", "Are you sure you want to Reset this Curve?",
85
- "Yes", "No"))
86
- ResetTrackCurve();
87
- }
88
-
89
- /// <summary>
90
- ///
91
- /// </summary>
92
- protected virtual void ResetTrackCurve()
93
- {
94
- target.SpeedCurve = new AnimationCurve()
95
- {
96
- keys = new Keyframe[] { new(0, 1), new(0.5f, 0.09f), new(1, 1) }
97
- };
98
- }
99
- }
100
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if UNITY_EDITOR && CINEMACHINE
3
+ using Cinemachine;
4
+ using DREditor.Editor.Utility;
5
+ using UnityEditor;
6
+ using UnityEngine;
7
+
8
+ namespace DREditor.TrackPhrase
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [CustomClassEditor(typeof(TrackPath))]
14
+ public class TrackAnimationEditor : ClassEditorTypeBase<TrackPath>
15
+ {
16
+ /// <inheritdoc/>
17
+ protected override void OnInspectorGUI() => PhraseTrack();
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ protected virtual void PhraseTrack()
23
+ {
24
+ target.Position = HandyFields.Vector3Field("Track Position: ", target.Position, 200, 7);
25
+
26
+ target.Rotation = HandyFields.Vector4Field("Track Angle: ", target.Rotation, 200, 7);
27
+
28
+ DisplayTrackSpeed();
29
+
30
+ GUILayout.Space(25);
31
+ }
32
+
33
+ /// <summary>
34
+ ///
35
+ /// </summary>
36
+ protected virtual void DisplayTrackSpeed()
37
+ {
38
+ using (new GUILayout.HorizontalScope())
39
+ {
40
+ ImportPathSelection();
41
+
42
+ DisplayClearWaypointsButton();
43
+
44
+ target.SpeedCurve = EditorGUILayout.CurveField(target.SpeedCurve);
45
+
46
+ DisplayResetCurveButton();
47
+ }
48
+ }
49
+
50
+ /// <summary>
51
+ ///
52
+ /// </summary>
53
+ protected virtual void ImportPathSelection()
54
+ {
55
+ if (GUILayout.Button("Import Selection", GUILayout.Width(130)))
56
+ {
57
+ CinemachinePath.Waypoint[] points = Selection.gameObjects[0].GetComponent<CinemachinePath>().m_Waypoints;
58
+
59
+ if (points != null && points.Length > 0)
60
+ target.Points = points;
61
+ else
62
+ UnityEngine.Debug.Log("You need to select a Path in the hierarchy!");
63
+ }
64
+ }
65
+
66
+ /// <summary>
67
+ ///
68
+ /// </summary>
69
+ protected virtual void DisplayClearWaypointsButton()
70
+ {
71
+ if (GUILayout.Button("Clear Waypoints", GUILayout.Width(130)))
72
+ target.Points = null;
73
+
74
+ if (target.SpeedCurve == null)
75
+ ResetTrackCurve();
76
+ }
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ protected virtual void DisplayResetCurveButton()
82
+ {
83
+ if (GUILayout.Button("Reset Curve", GUILayout.Width(100)) &&
84
+ EditorUtility.DisplayDialog("Reset Curve", "Are you sure you want to Reset this Curve?",
85
+ "Yes", "No"))
86
+ ResetTrackCurve();
87
+ }
88
+
89
+ /// <summary>
90
+ ///
91
+ /// </summary>
92
+ protected virtual void ResetTrackCurve()
93
+ {
94
+ target.SpeedCurve = new AnimationCurve()
95
+ {
96
+ keys = new Keyframe[] { new(0, 1), new(0.5f, 0.09f), new(1, 1) }
97
+ };
98
+ }
99
+ }
100
+ }
101
101
  #endif
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: d026c1bca24b9624eb15162460f56b91
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: d026c1bca24b9624eb15162460f56b91
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/TrackPath.cs CHANGED
@@ -1,77 +1,77 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if CINEMACHINE
3
- using Cinemachine;
4
- using DREditor.Minigames.Debates;
5
- using System;
6
- using UnityEngine;
7
-
8
- namespace DREditor.TrackPhrase
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- [Serializable]
14
- public class TrackPath : IPhraseAnimationArchitecture
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- public Vector3 position;
20
-
21
- /// <summary>
22
- ///
23
- /// </summary>
24
- public Vector3 Position { get => position; set => position = value; }
25
-
26
- /// <summary>
27
- ///
28
- /// </summary>
29
- public Vector4 rotation;
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- public Vector4 Rotation { get => rotation; set => rotation = value; }
35
-
36
- /// <summary>
37
- ///
38
- /// </summary>
39
- public CinemachinePath.Waypoint[] points;
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- public CinemachinePath.Waypoint[] Points { get => points; set => points = value; }
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- public AnimationCurve speedCurve;
50
-
51
- /// <summary>
52
- ///
53
- /// </summary>
54
- public AnimationCurve SpeedCurve { get => speedCurve; set => speedCurve = value; }
55
-
56
-
57
- /// <inheritdoc/>
58
- public virtual void Initialize(object o = null) { }
59
-
60
- /// <inheritdoc/>
61
- public virtual void Apply(IPhraseAnimationArchitecture architecture)
62
- {
63
- UnityEngine.Debug.Log("REPORT: The currently selected track animation architecture has been replaced (likely by a preset).");
64
-
65
- TrackPath trackPath = architecture as TrackPath;
66
-
67
- position = trackPath.position;
68
-
69
- rotation = trackPath.rotation;
70
-
71
- points = trackPath.points;
72
-
73
- speedCurve = trackPath.speedCurve;
74
- }
75
- }
76
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if CINEMACHINE
3
+ using Cinemachine;
4
+ using DREditor.Minigames.Debates;
5
+ using System;
6
+ using UnityEngine;
7
+
8
+ namespace DREditor.TrackPhrase
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [Serializable]
14
+ public class TrackPath : IPhraseAnimationArchitecture
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ public Vector3 position;
20
+
21
+ /// <summary>
22
+ ///
23
+ /// </summary>
24
+ public Vector3 Position { get => position; set => position = value; }
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ public Vector4 rotation;
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ public Vector4 Rotation { get => rotation; set => rotation = value; }
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ public CinemachinePath.Waypoint[] points;
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ public CinemachinePath.Waypoint[] Points { get => points; set => points = value; }
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ public AnimationCurve speedCurve;
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ public AnimationCurve SpeedCurve { get => speedCurve; set => speedCurve = value; }
55
+
56
+
57
+ /// <inheritdoc/>
58
+ public virtual void Initialize(object o = null) { }
59
+
60
+ /// <inheritdoc/>
61
+ public virtual void Apply(IPhraseAnimationArchitecture architecture)
62
+ {
63
+ UnityEngine.Debug.Log("REPORT: The currently selected track animation architecture has been replaced (likely by a preset).");
64
+
65
+ TrackPath trackPath = architecture as TrackPath;
66
+
67
+ position = trackPath.position;
68
+
69
+ rotation = trackPath.rotation;
70
+
71
+ points = trackPath.points;
72
+
73
+ speedCurve = trackPath.speedCurve;
74
+ }
75
+ }
76
+ }
77
77
  #endif
package/TrackPath.cs.meta CHANGED
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: a06a96b95f2e12a4b83072f5b0b28cd7
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: a06a96b95f2e12a4b83072f5b0b28cd7
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,37 +1,42 @@
1
- {
2
- "name": "net.dreditor.trackphrase",
3
- "version": "0.1.6",
4
- "displayName": "DREditor Track Phrase",
5
- "description": "The beta for DREditor. A tool to create death game style projects without having to code.",
6
- "unity": "6000.4",
7
- "dependencies": {
8
- "com.unity.cinemachine": "2.10.7",
9
- "net.dreditor.core": "0.1.6",
10
- "net.dreditor.minigames": "0.1.6",
11
- "net.dreditor.minigames.debates": "0.1.6"
12
- },
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "author": {
17
- "name": "Benjamin \"Sweden\" Jillson",
18
- "email": "dreditortool@gmail.com",
19
- "url": "https://dreditor.net"
20
- },
21
- "keywords": [
22
- "editor",
23
- "tool",
24
- "dreditor"
25
- ],
26
- "samples": [
27
- {
28
- "displayName": "Samples",
29
- "description": "",
30
- "path": "Samples~"
31
- }
32
- ],
33
- "documentationUrl": "https://dreditor.net",
34
- "license": "Apache-2.0",
35
- "licensesUrl": "https://dreditor.net/docs/LICENSE.html",
36
- "changelogUrl": "https://dreditor.net/docs/CHANGELOG.html"
37
- }
1
+ {
2
+ "name": "net.dreditor.trackphrase",
3
+ "version": "0.1.7",
4
+ "displayName": "DREditor Track Phrase",
5
+ "description": "The beta for DREditor. A tool to create death game style projects without having to code.",
6
+ "unity": "6000.4",
7
+ "dependencies": {
8
+ "com.unity.cinemachine": "2.10.7",
9
+ "net.dreditor.core": "0.1.7",
10
+ "net.dreditor.minigames": "0.1.7",
11
+ "net.dreditor.minigames.debates": "0.1.7"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "author": {
17
+ "name": "Benjamin \"Sweden\" Jillson",
18
+ "email": "dreditortool@gmail.com",
19
+ "url": "https://dreditor.net"
20
+ },
21
+ "keywords": [
22
+ "editor",
23
+ "tool",
24
+ "dreditor"
25
+ ],
26
+ "samples": [
27
+ {
28
+ "displayName": "Samples",
29
+ "description": "",
30
+ "path": "Samples~"
31
+ }
32
+ ],
33
+ "documentationUrl": "https://dreditor.net",
34
+ "license": "Apache-2.0",
35
+ "licensesUrl": "https://dreditor.net/docs/LICENSE.html",
36
+ "changelogUrl": "https://dreditor.net/docs/CHANGELOG.html",
37
+ "repository": {
38
+ "url": "https://github.com/CertifiedSharp/DREditor",
39
+ "type": "git",
40
+ "revision": "14ca252fbb33eb6f53557ecaed1c10902877698f"
41
+ }
42
+ }
package/package.json.meta CHANGED
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: a581ee62c04232643b27efe0e81e4489
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: a581ee62c04232643b27efe0e81e4489
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Samples.meta DELETED
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 2bd9fab9e56cae342aaf087ccd62fae1
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant: