net.dreditor.flairs 0.0.0-stage → 0.1.6
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/DREditor.Flairs.asmdef +19 -0
- package/DREditor.Flairs.asmdef.meta +7 -0
- package/DestroyFlairHandler.cs +90 -0
- package/DestroyFlairHandler.cs.meta +2 -0
- package/DestroyFlairOnDirectorComplete.cs +74 -0
- package/DestroyFlairOnDirectorComplete.cs.meta +11 -0
- package/DestroyFlairOnNextLine.cs +78 -0
- package/DestroyFlairOnNextLine.cs.meta +2 -0
- package/Editor/AllCharactersOption.cs +43 -0
- package/Editor/AllCharactersOption.cs.meta +2 -0
- package/Editor/AllFlairsOneCharacterOption.cs +47 -0
- package/Editor/AllFlairsOneCharacterOption.cs.meta +2 -0
- package/Editor/AllSpritesOption.cs +54 -0
- package/Editor/AllSpritesOption.cs.meta +2 -0
- package/Editor/DREditor.Flairs.Editor.asmdef +18 -0
- package/Editor/DREditor.Flairs.Editor.asmdef.meta +7 -0
- package/Editor/FlairEditorTools.cs +87 -0
- package/Editor/FlairEditorTools.cs.meta +2 -0
- package/Editor/GenerateFlairDebugDialogue.cs +62 -0
- package/Editor/GenerateFlairDebugDialogue.cs.meta +2 -0
- package/Editor/GenerateFlairDialogueOptionBase.cs +112 -0
- package/Editor/GenerateFlairDialogueOptionBase.cs.meta +2 -0
- package/Editor/IGenerateFlairDialogueSetting.cs +19 -0
- package/Editor/IGenerateFlairDialogueSetting.cs.meta +2 -0
- package/Editor.meta +8 -0
- package/EnableFlairCanvas.cs +78 -0
- package/EnableFlairCanvas.cs.meta +2 -0
- package/FadeFlairDestroyer.cs +59 -0
- package/FadeFlairDestroyer.cs.meta +2 -0
- package/Flair.cs +32 -0
- package/Flair.cs.meta +2 -0
- package/FlairDestroyer.cs +27 -0
- package/FlairDestroyer.cs.meta +2 -0
- package/FlairEvent.cs +46 -0
- package/FlairEvent.cs.meta +2 -0
- package/FlairEventHandler.cs +34 -0
- package/FlairEventHandler.cs.meta +2 -0
- package/FlairOffset.cs +48 -0
- package/FlairOffset.cs.meta +2 -0
- package/FlairSpawner.cs +29 -0
- package/FlairSpawner.cs.meta +2 -0
- package/FlairSpawnerBase.cs +17 -0
- package/FlairSpawnerBase.cs.meta +2 -0
- package/FlairStrategy.cs +49 -0
- package/FlairStrategy.cs.meta +2 -0
- package/FlairStrategyBase.cs +58 -0
- package/FlairStrategyBase.cs.meta +2 -0
- package/Flair_Question.controller +72 -0
- package/Flair_Question.controller.meta +8 -0
- package/Flair_QuestionAnim.anim +693 -0
- package/Flair_QuestionAnim.anim.meta +8 -0
- package/Flair_QuestionTimeline.playable +2198 -0
- package/Flair_QuestionTimeline.playable.meta +8 -0
- package/IFlair.cs +17 -0
- package/IFlair.cs.meta +2 -0
- package/IFlairDestroyable.cs +16 -0
- package/IFlairDestroyable.cs.meta +2 -0
- package/IFlairEvent.cs +30 -0
- package/IFlairEvent.cs.meta +2 -0
- package/IFlairSetting.cs +17 -0
- package/IFlairSetting.cs.meta +2 -0
- package/IFlairSpawnStep.cs +18 -0
- package/IFlairSpawnStep.cs.meta +2 -0
- package/IFlairStep.cs +18 -0
- package/IFlairStep.cs.meta +2 -0
- package/LayerFlair.cs +39 -0
- package/LayerFlair.cs.meta +2 -0
- package/ProtagFlairStrategy.cs +69 -0
- package/ProtagFlairStrategy.cs.meta +2 -0
- package/Samples/Flair.prefab +145 -0
- package/Samples/Flair.prefab.meta +7 -0
- package/Samples/Flair_Event_Handler.prefab +238 -0
- package/Samples/Flair_Event_Handler.prefab.meta +7 -0
- package/Samples/Flair_Question.asset +15 -0
- package/Samples/Flair_Question.asset.meta +8 -0
- package/Samples/Flair_Question.prefab +412 -0
- package/Samples/Flair_Question.prefab.meta +7 -0
- package/Samples/Flair_Strategy.prefab +64 -0
- package/Samples/Flair_Strategy.prefab.meta +7 -0
- package/Samples/Protag_Flair_Strategy.prefab +186 -0
- package/Samples/Protag_Flair_Strategy.prefab.meta +7 -0
- package/Samples.meta +8 -0
- package/SpawnFlairOnHead.cs +37 -0
- package/SpawnFlairOnHead.cs.meta +2 -0
- package/SpawnFlairOnParent.cs +25 -0
- package/SpawnFlairOnParent.cs.meta +2 -0
- package/SpawnFlairStepBase.cs +45 -0
- package/SpawnFlairStepBase.cs.meta +2 -0
- package/SpawnFlairToParent.cs +39 -0
- package/SpawnFlairToParent.cs.meta +2 -0
- package/package.json +36 -6
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.Flairs",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"DG.Tweening",
|
|
6
|
+
"DREditor",
|
|
7
|
+
"DREditor.DialogueEventHandling",
|
|
8
|
+
"Unity.Timeline"
|
|
9
|
+
],
|
|
10
|
+
"includePlatforms": [],
|
|
11
|
+
"excludePlatforms": [],
|
|
12
|
+
"allowUnsafeCode": false,
|
|
13
|
+
"overrideReferences": false,
|
|
14
|
+
"precompiledReferences": [],
|
|
15
|
+
"autoReferenced": true,
|
|
16
|
+
"defineConstraints": [],
|
|
17
|
+
"versionDefines": [],
|
|
18
|
+
"noEngineReferences": false
|
|
19
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Kill/Cure: Beautiful Vice
|
|
2
|
+
using System;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.Events;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Flairs
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
public abstract class DestroyFlairHandler : MonoBehaviour
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected FlairDestroyer destroyer = null;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[Header("")]
|
|
22
|
+
public UnityEvent onOtherHandlerInvoked = null;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
protected DestroyFlairHandler[] otherHandlers;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
protected virtual void Awake() =>
|
|
32
|
+
otherHandlers = GetComponents<DestroyFlairHandler>()
|
|
33
|
+
.Where(handler => handler != this)
|
|
34
|
+
.ToArray();
|
|
35
|
+
|
|
36
|
+
protected virtual void Start() =>
|
|
37
|
+
UpdateFlairSubscription((handler) => handler.onOtherHandlerInvoked.AddListener(OnOtherHandlerDestroying));
|
|
38
|
+
|
|
39
|
+
protected virtual void OnDestroy() =>
|
|
40
|
+
UpdateFlairSubscription((handler) => handler.onOtherHandlerInvoked.RemoveListener(OnOtherHandlerDestroying));
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
/// <param name="update"></param>
|
|
46
|
+
protected virtual void UpdateFlairSubscription(Action<DestroyFlairHandler> update)
|
|
47
|
+
{
|
|
48
|
+
if (otherHandlers == null)
|
|
49
|
+
return;
|
|
50
|
+
|
|
51
|
+
foreach (DestroyFlairHandler handler in otherHandlers)
|
|
52
|
+
if (handler != null)
|
|
53
|
+
update(handler);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
protected abstract void OnOtherHandlerDestroying();
|
|
60
|
+
|
|
61
|
+
/// <summary>
|
|
62
|
+
///
|
|
63
|
+
/// </summary>
|
|
64
|
+
protected virtual void AttemptToDestroyFlair()
|
|
65
|
+
{
|
|
66
|
+
if (FlairCanBeDestroyed())
|
|
67
|
+
InvokeFlairDestroyer();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
/// <returns></returns>
|
|
74
|
+
protected virtual bool FlairCanBeDestroyed() => gameObject != null;
|
|
75
|
+
|
|
76
|
+
/// <summary>
|
|
77
|
+
///
|
|
78
|
+
/// </summary>
|
|
79
|
+
protected virtual void InvokeFlairDestroyer()
|
|
80
|
+
{
|
|
81
|
+
onOtherHandlerInvoked?.Invoke();
|
|
82
|
+
|
|
83
|
+
if (destroyer != null)
|
|
84
|
+
destroyer.DestroyFlair();
|
|
85
|
+
else
|
|
86
|
+
UnityEngine.Debug.LogWarning("ALERT: This flair cannot be destroyed! " +
|
|
87
|
+
"\nANALYSIS: A destroyer has not been assigned!");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Kill/Cure: Beautiful Vice
|
|
2
|
+
//Original Author: KHeartz
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using UnityEngine.Playables;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.Flairs
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader(nameof(DestroyFlairHandler) +
|
|
12
|
+
"\n\n")]
|
|
13
|
+
public class DestroyFlairOnDirectorComplete : DestroyFlairHandler
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
protected PlayableDirector timeline = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
protected bool isLooping = false;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/// <inheritdoc/>
|
|
27
|
+
protected override void Awake()
|
|
28
|
+
{
|
|
29
|
+
base.Awake();
|
|
30
|
+
|
|
31
|
+
if (TryGetComponent(out timeline))
|
|
32
|
+
isLooping = timeline.extrapolationMode == DirectorWrapMode.Loop;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected virtual void Update() => AttemptToDestroyFlair();
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
protected override bool FlairCanBeDestroyed() => base.FlairCanBeDestroyed() && IsComplete();
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
/// <returns></returns>
|
|
44
|
+
protected virtual bool IsComplete() => !timeline.playableGraph.IsValid() || !isLooping && !timeline.playableGraph.IsPlaying();
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/// <inheritdoc/>
|
|
48
|
+
protected override void InvokeFlairDestroyer()
|
|
49
|
+
{
|
|
50
|
+
DestroyPlayableDirector();
|
|
51
|
+
|
|
52
|
+
base.InvokeFlairDestroyer();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
///
|
|
57
|
+
/// </summary>
|
|
58
|
+
protected virtual void DestroyPlayableDirector()
|
|
59
|
+
{
|
|
60
|
+
if (gameObject.TryGetComponent(out PlayableDirector playableDirector))
|
|
61
|
+
{
|
|
62
|
+
playableDirector.enabled = false;
|
|
63
|
+
|
|
64
|
+
foreach (var item in gameObject.GetComponentsInChildren<Animator>())
|
|
65
|
+
Destroy(item);
|
|
66
|
+
|
|
67
|
+
Destroy(gameObject.GetComponent<Animator>());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// <inheritdoc/>
|
|
72
|
+
protected override void OnOtherHandlerDestroying() => DestroyPlayableDirector();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Kill/Cure: Beautiful Vice
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.LineReading;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.Flairs
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader(nameof(DestroyFlairHandler) +
|
|
12
|
+
"\n\n")]
|
|
13
|
+
public class DestroyFlairOnNextLine : DestroyFlairHandler
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
protected ILineReader lineReader;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/// <inheritdoc/>
|
|
22
|
+
protected override void Awake()
|
|
23
|
+
{
|
|
24
|
+
base.Awake();
|
|
25
|
+
|
|
26
|
+
InitializeCheck();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
///
|
|
31
|
+
/// </summary>
|
|
32
|
+
protected virtual void InitializeCheck()
|
|
33
|
+
{
|
|
34
|
+
Initialize();
|
|
35
|
+
|
|
36
|
+
if (InitializationFailed())
|
|
37
|
+
OnInitializationCheckFailed();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
protected virtual void Initialize() =>
|
|
44
|
+
lineReader = ServiceLocator.GetService<IDialogueManager>().GetReader().GetComponentInChildren<ILineReader>();
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
///
|
|
48
|
+
/// </summary>
|
|
49
|
+
/// <returns></returns>
|
|
50
|
+
protected virtual bool InitializationFailed() => lineReader == null;
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
///
|
|
54
|
+
/// </summary>
|
|
55
|
+
protected virtual void OnInitializationCheckFailed()
|
|
56
|
+
{
|
|
57
|
+
UnityEngine.Debug.LogError($"ALERT: Destroyer {gameObject.name} failed initialization because the line reader was null!" +
|
|
58
|
+
"\nDestroying Object.");
|
|
59
|
+
|
|
60
|
+
InvokeFlairDestroyer();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
protected virtual void OnEnable()
|
|
64
|
+
{
|
|
65
|
+
if (lineReader != null)
|
|
66
|
+
lineReader.OnLineEndEvent += AttemptToDestroyFlair;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
protected virtual void OnDisable()
|
|
70
|
+
{
|
|
71
|
+
if (lineReader != null)
|
|
72
|
+
lineReader.OnLineEndEvent -= AttemptToDestroyFlair;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// <inheritdoc/>
|
|
76
|
+
protected override void OnOtherHandlerDestroying() { }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Dialogues;
|
|
4
|
+
using DREditor.Editor.Utility;
|
|
5
|
+
using System;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Flairs.Editor
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[Serializable]
|
|
13
|
+
public class AllCharactersOption : GenerateFlairDialogueOptionBase
|
|
14
|
+
{
|
|
15
|
+
/// <inheritdoc/>
|
|
16
|
+
protected override void GenerateDialogue()
|
|
17
|
+
{
|
|
18
|
+
foreach (IFlairEvent sceneEvent in events)
|
|
19
|
+
AllCharactersOneFlair(sceneEvent);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
/// <param name="flair"></param>
|
|
26
|
+
protected virtual void AllCharactersOneFlair(IFlairEvent flair)
|
|
27
|
+
{
|
|
28
|
+
Dialogue dia = MakeInstance<Dialogue>();
|
|
29
|
+
|
|
30
|
+
dia.Lines.Clear();
|
|
31
|
+
|
|
32
|
+
string flairName = flair.GetFlair().GetPrefab().name;
|
|
33
|
+
|
|
34
|
+
dia.name = "D_" + flairName + "_Debug";
|
|
35
|
+
|
|
36
|
+
foreach (var c in cdb.Characters)
|
|
37
|
+
dia.Lines.Add(CharacterFlairLine(c, flair, flairName));
|
|
38
|
+
|
|
39
|
+
BuilderUtility.CreateAsset(dia, targetDirectory);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
#endif
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Characters;
|
|
4
|
+
using DREditor.Dialogues;
|
|
5
|
+
using DREditor.Editor.Utility;
|
|
6
|
+
using System;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Flairs.Editor
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[Serializable]
|
|
15
|
+
public class AllFlairsOneCharacterOption : GenerateFlairDialogueOptionBase
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected int speakerNumber = -1;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <inheritdoc/>
|
|
25
|
+
protected override void GenerateDialogue() => AllFlairsOneCharacter();
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
protected virtual void AllFlairsOneCharacter()
|
|
31
|
+
{
|
|
32
|
+
Dialogue dia = MakeInstance<Dialogue>();
|
|
33
|
+
|
|
34
|
+
dia.Lines.Clear();
|
|
35
|
+
|
|
36
|
+
dia.name = "D_" + cdb.Characters[speakerNumber].FirstName + "_All_Flairs_Debug";
|
|
37
|
+
|
|
38
|
+
Character speaker = cdb.Characters[speakerNumber];
|
|
39
|
+
|
|
40
|
+
foreach (var f in events)
|
|
41
|
+
dia.Lines.Add(CharacterFlairLine(speaker, f, f.GetFlair().GetPrefab().name));
|
|
42
|
+
|
|
43
|
+
BuilderUtility.CreateAsset(dia, targetDirectory);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
#endif
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Characters;
|
|
4
|
+
using DREditor.Dialogues;
|
|
5
|
+
using DREditor.Editor.Utility;
|
|
6
|
+
using System;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Flairs.Editor
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[Serializable]
|
|
15
|
+
public class AllSpritesOption : GenerateFlairDialogueOptionBase
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected int speakerNumber = -1;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <inheritdoc/>
|
|
25
|
+
protected override void GenerateDialogue()
|
|
26
|
+
{
|
|
27
|
+
foreach (IFlairEvent sceneEvent in events)
|
|
28
|
+
OneCharacterAllSprites(sceneEvent);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
/// <param name="flair"></param>
|
|
35
|
+
protected virtual void OneCharacterAllSprites(IFlairEvent flair)
|
|
36
|
+
{
|
|
37
|
+
Dialogue dia = MakeInstance<Dialogue>();
|
|
38
|
+
|
|
39
|
+
dia.Lines.Clear();
|
|
40
|
+
|
|
41
|
+
string flairName = flair.GetFlair().GetPrefab().name;
|
|
42
|
+
|
|
43
|
+
dia.name = "D_" + cdb.Characters[speakerNumber].FirstName + "_All_Sprites_" + flairName + "_Debug";
|
|
44
|
+
|
|
45
|
+
Character speaker = cdb.Characters[speakerNumber];
|
|
46
|
+
|
|
47
|
+
for (int i = 0; i < speaker.Sprites.Count; i++)
|
|
48
|
+
dia.Lines.Add(CharacterFlairLine(speaker, flair, flairName, i));
|
|
49
|
+
|
|
50
|
+
BuilderUtility.CreateAsset(dia, targetDirectory);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
#endif
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.Flairs.Editor",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"DREditor.Flairs",
|
|
6
|
+
"DREditor",
|
|
7
|
+
"DREditor.Editor"
|
|
8
|
+
],
|
|
9
|
+
"includePlatforms": [],
|
|
10
|
+
"excludePlatforms": [],
|
|
11
|
+
"allowUnsafeCode": false,
|
|
12
|
+
"overrideReferences": false,
|
|
13
|
+
"precompiledReferences": [],
|
|
14
|
+
"autoReferenced": true,
|
|
15
|
+
"defineConstraints": [],
|
|
16
|
+
"versionDefines": [],
|
|
17
|
+
"noEngineReferences": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Editor.Utility;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using System.Linq;
|
|
6
|
+
using UnityEditor;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Flairs.Editor
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
public static class FlairEditorTools
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[MenuItem("DREditor/Flair/Create Flairs From Selected Objects")]
|
|
20
|
+
public static void CreateFlairsFromSelectedObjects()
|
|
21
|
+
{
|
|
22
|
+
if (NoSelectedScriptableObjects(out IEnumerable<GameObject> objects))
|
|
23
|
+
return;
|
|
24
|
+
|
|
25
|
+
AssetDatabase.StartAssetEditing();
|
|
26
|
+
|
|
27
|
+
try
|
|
28
|
+
{
|
|
29
|
+
CreateFlairs(objects);
|
|
30
|
+
}
|
|
31
|
+
finally
|
|
32
|
+
{
|
|
33
|
+
AssetDatabase.StopAssetEditing();
|
|
34
|
+
|
|
35
|
+
AssetDatabase.SaveAssets();
|
|
36
|
+
|
|
37
|
+
AssetDatabase.Refresh();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
UnityEngine.Debug.Log("REPORT: Process completed.");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
///
|
|
45
|
+
/// </summary>
|
|
46
|
+
/// <param name="objects"></param>
|
|
47
|
+
private static void CreateFlairs(IEnumerable<GameObject> objects)
|
|
48
|
+
{
|
|
49
|
+
foreach (var obj in objects)
|
|
50
|
+
if (obj is GameObject prefab)
|
|
51
|
+
CreateFlair(prefab);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
///
|
|
56
|
+
/// </summary>
|
|
57
|
+
/// <param name="prefab"></param>
|
|
58
|
+
private static void CreateFlair(GameObject prefab)
|
|
59
|
+
{
|
|
60
|
+
var instance = CustomEditorUtility.CreateAsset<Flair>();
|
|
61
|
+
|
|
62
|
+
instance.name = prefab.name;
|
|
63
|
+
|
|
64
|
+
instance.SetPrefab(prefab);
|
|
65
|
+
|
|
66
|
+
EditorUtility.SetDirty(instance);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
///
|
|
71
|
+
/// </summary>
|
|
72
|
+
/// <param name="objects"></param>
|
|
73
|
+
/// <returns></returns>
|
|
74
|
+
private static bool NoSelectedScriptableObjects(out IEnumerable<GameObject> objects)
|
|
75
|
+
{
|
|
76
|
+
objects = Selection.objects.OfType<GameObject>();
|
|
77
|
+
|
|
78
|
+
bool result = objects.Count() == 0;
|
|
79
|
+
|
|
80
|
+
if (result)
|
|
81
|
+
UnityEngine.Debug.LogWarning("ALERT: Process likely aborted since no scriptable objects were selected.");
|
|
82
|
+
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
#endif
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using System;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using UnityEditor;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Flairs.Editor
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
public class GenerateFlairDebugDialogue : ScriptableWizard
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[Header("")]
|
|
19
|
+
[Divider]
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeReference, SelectType]
|
|
22
|
+
[SerializeField] protected IGenerateFlairDialogueSetting activeSetting;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
[Header("")]
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeReference, SelectType]
|
|
31
|
+
[SerializeField] protected List<IFlairEvent> events = new();
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
///
|
|
36
|
+
/// </summary>
|
|
37
|
+
[MenuItem("DREditor/Flair/Generate Flair Debug Dialogue")]
|
|
38
|
+
public static void GenerateFlairDialogueWizard() => DisplayWizard<GenerateFlairDebugDialogue>("Flair Dialogue Wizard", "Create");
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
protected virtual void OnWizardCreate()
|
|
42
|
+
{
|
|
43
|
+
AssetDatabase.StartAssetEditing();
|
|
44
|
+
|
|
45
|
+
try
|
|
46
|
+
{
|
|
47
|
+
activeSetting?.ExecuteOption(events);
|
|
48
|
+
}
|
|
49
|
+
catch (Exception exception)
|
|
50
|
+
{
|
|
51
|
+
UnityEngine.Debug.LogException(exception);
|
|
52
|
+
}
|
|
53
|
+
finally
|
|
54
|
+
{
|
|
55
|
+
AssetDatabase.StopAssetEditing();
|
|
56
|
+
|
|
57
|
+
AssetDatabase.SaveAssets();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
#endif
|