-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
924 additions
and
25 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.idea/.idea.com.studio23.ss2.dialoguesystem/.idea/inspectionProfiles/Project_Default.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ackages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/ForceTakeAllChoiceNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Studio23.SS2.DialogueSystem.Utility; | ||
using UnityEngine; | ||
|
||
namespace Studio23.SS2.DialogueSystem.Data | ||
{ | ||
/// <summary> | ||
/// IF all normal choices are taken, shows another choice. | ||
/// This is useful for dialogue trees that the player needs to fully exhaust | ||
/// before being allowed to continue | ||
/// </summary> | ||
[CreateNodeMenu("Force Take All Choice Node"), NodeTint("#996600")] | ||
public class ForceTakeAllChoiceNode:DialogueChoicesNode | ||
{ | ||
[Output] | ||
public int FinalChoice; | ||
|
||
protected override void GetAvailableChoices() | ||
{ | ||
GetAllConnectedChoiceNodes(); | ||
Debug.Log(_availableDialogueChoices.Count); | ||
AddFinalChoiceIfAvailable(); | ||
Debug.Log(_availableDialogueChoices.Count); | ||
RemoveUnavailableChoices(); | ||
Debug.Log("RemoveUnavailableChoices " + _availableDialogueChoices.Count); | ||
} | ||
|
||
private void AddFinalChoiceIfAvailable() | ||
{ | ||
bool allNormalChoicesTaken = true; | ||
foreach (var choice in AvailableDialogueChoices) | ||
{ | ||
if (!choice.Taken) | ||
{ | ||
allNormalChoicesTaken = false; | ||
break; | ||
} | ||
} | ||
|
||
if (allNormalChoicesTaken) | ||
{ | ||
this.GetOutputNodesConnectedToPort("FinalChoice", _availableDialogueChoices); | ||
} | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...es/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/ForceTakeAllChoiceNode.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.