T3UZO5Y2LB2Z2NG3Z5XUTINPOPY5WJXECL4M4DEURD47SOQPQ47QC
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
Dialogue SelectedDialogue {
get {
return _selectedDialogue;
}
set {
if (_selectedDialogue != value) {
_selectedDialogue = value;
if (_selectedDialogue.Nodes.Count == 0) {
var rootDefaultPosition = new Vector2(5, 25);
_selectedDialogue.CreateNode(null).Position = rootDefaultPosition;
}
Repaint();
}
}
}
_playerNodeStyle.padding = new RectOffset(12, 12, 12, 12);
_playerNodeStyle.border = new RectOffset(12, 12, 12, 12);
_playerNodeStyle.overflow = new RectOffset(7, 7, 7, 7);
_playerNodeStyle.padding = padding;
_playerNodeStyle.border = border;
_playerNodeStyle.overflow = overflow;
else {
ProcessEvents();
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
EditorGUILayout.LabelField(_selectedDialogue.name, EditorStyles.boldLabel);
ProcessEvents();
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
var canvas = GUILayoutUtility.GetRect(CanvasSize, CanvasSize);
var backgroundTex = UnityEngine.Resources.Load("background") as Texture2D;
Rect texCoords = new(0, 0, CanvasSize / backgroundTex.width, CanvasSize / backgroundTex.height);
GUI.DrawTextureWithTexCoords(canvas, backgroundTex, texCoords);
_nodeIndex = SelectedDialogue.Nodes.ToDictionary(node => node.name);
foreach (var node in SelectedDialogue.Nodes) {
DrawConnections(node);
}
OutlineRootNode(SelectedDialogue.Nodes.First());
foreach (var node in SelectedDialogue.Nodes) {
DrawNode(node);
}
var canvas = GUILayoutUtility.GetRect(_canvasSize, _canvasSize);
var backgroundTex = UnityEngine.Resources.Load("background") as Texture2D;
Rect texCoords = new(0, 0, _canvasSize / _backgroundsize, _canvasSize / _backgroundsize);
DrawDialogueName();
EditorGUILayout.EndScrollView();
switch (_manipulationState) {
case DialogueManipulation.CreateNode action:
SelectedDialogue.CreateNode(action.NodeParent);
_manipulationState = new DialogueManipulation.None();
break;
case DialogueManipulation.DeleteNode action:
SelectedDialogue.DeleteNode(action.NodeToDelete);
_manipulationState = new DialogueManipulation.None();
break;
}
}
GUI.DrawTextureWithTexCoords(canvas, backgroundTex, texCoords);
void DrawDialogueName() {
GUILayout.BeginArea(new Rect(_scrollPosition.x, _scrollPosition.y, CanvasSize, 20));
EditorGUILayout.LabelField(SelectedDialogue.name, EditorStyles.boldLabel);
GUILayout.EndArea();
}
foreach (var node in _selectedDialogue.Nodes) {
DrawConnections(node);
}
void OutlineRootNode(DialogueNode dialogueNode) {
IEnumerable<(Vector3 start, Vector3 end)> NodeSides() {
var drawOffset = 2f;
Vector3 topLeft = new Vector2(dialogueNode.Rect.xMin - drawOffset, dialogueNode.Rect.yMin - drawOffset);
Vector3 topRight = new Vector2(dialogueNode.Rect.xMax + drawOffset, dialogueNode.Rect.yMin - drawOffset);
Vector3 bottomLeft = new Vector2(dialogueNode.Rect.xMin - drawOffset, dialogueNode.Rect.yMax + drawOffset);
Vector3 bottomRight = new Vector2(dialogueNode.Rect.xMax + drawOffset, dialogueNode.Rect.yMax + drawOffset);
switch (_manipulationState) {
case DialogueManipulation.CreateNode action:
_selectedDialogue.CreateNode(action.NodeParent);
_manipulationState = new DialogueManipulation.None();
break;
case DialogueManipulation.DeleteNode action:
_selectedDialogue.DeleteNode(action.NodeToDelete);
_manipulationState = new DialogueManipulation.None();
break;
}
foreach (var (start, end) in NodeSides()) {
Handles.DrawBezier(start, end, start, end, Color.white, null, 4f);
_manipulationState = (clickedNode.Rect.height + dragOffset.y > _resizeBorder) || (clickedNode.Rect.width + dragOffset.x > _resizeBorder) ?
_manipulationState = (clickedNode.Rect.height + dragOffset.y > ResizeBorder) || (clickedNode.Rect.width + dragOffset.x > ResizeBorder) ?
private DialogueNode GetNodeAtPoint(Vector2 point) {
return _selectedDialogue.Nodes.Where(node => node.Rect.Contains(point)).LastOrDefault();
DialogueNode GetNodeAtPoint(Vector2 point) {
return SelectedDialogue.Nodes.Where(node => node.Rect.Contains(point)).LastOrDefault();
get { return nodes; }
}
public IEnumerable<DialogueNode> GetAllChildren(DialogueNode parentNode) {
return parentNode.GetChildren().Where(childID => nodeDictionary.ContainsKey(childID)).Select(childID => nodeDictionary[childID]);
get { return _nodes; }
fileFormatVersion: 2
guid: 1ff90635cceb940469d5599dbe19baa2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5180882202668083039
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 480303b4b1409b54d8239c1b17e97f2b, type: 3}
m_Name: e0312784-372d-41b0-b754-2a22996087a2
m_EditorClassIdentifier:
_isPlayerSpeaking: 1
_text: Step Aside!
_children: []
_rect:
serializedVersion: 2
x: 775
y: 203
width: 200
height: 100
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 714f334e7ffb0154996de980ccf9e1c0, type: 3}
m_Name: ExampleDialogue
m_EditorClassIdentifier:
_nodes:
- {fileID: 2378482198948503118}
- {fileID: -5180882202668083039}
- {fileID: 3698232489421855906}
- {fileID: 5382213053841987224}
_newNodeOffset: {x: 250, y: 0}
--- !u!114 &2378482198948503118
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 480303b4b1409b54d8239c1b17e97f2b, type: 3}
m_Name: 3139e3f7-6754-4ff3-8fe2-9a52bcf7bb5a
m_EditorClassIdentifier:
_isPlayerSpeaking: 0
_text: Hi There!
_children:
- e0312784-372d-41b0-b754-2a22996087a2
- e859cf8f-a166-4a86-9742-c36088d6fce3
- bd6226fe-239d-4f5e-95d0-b741e90d0f7a
_rect:
serializedVersion: 2
x: 445
y: 334
width: 200
height: 100
--- !u!114 &3698232489421855906
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 480303b4b1409b54d8239c1b17e97f2b, type: 3}
m_Name: e859cf8f-a166-4a86-9742-c36088d6fce3
m_EditorClassIdentifier:
_isPlayerSpeaking: 1
_text: Let them pass.
_children: []
_rect:
serializedVersion: 2
x: 773
y: 332
width: 200
height: 100
--- !u!114 &5382213053841987224
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 480303b4b1409b54d8239c1b17e97f2b, type: 3}
m_Name: bd6226fe-239d-4f5e-95d0-b741e90d0f7a
m_EditorClassIdentifier:
_isPlayerSpeaking: 1
_text: Bye.
_children: []
_rect:
serializedVersion: 2
x: 771
y: 468
width: 200
height: 100