public void SetPositionToOffsetParent(DialogueNode parentRect) { Rect ChildRectPosition = rect; if (parentRect != null) { ChildRectPosition = new Rect(parentRect.GetRect().x + 220, parentRect.GetRect().y, 200, 100); } rect = ChildRectPosition; }
private DialogueNode MakeNode(DialogueNode parent) { var newNode = CreateInstance <DialogueNode>(); newNode.name = Guid.NewGuid().ToString(); if (parent != null) { parent.AddChild(newNode.name); newNode.SetPlayerSpeaking(!parent.IsPlayerSpeaking()); newNode.SetPosition(parent.GetRect().position + newNodeOffset); } return(newNode); }
public void CreateNode(DialogueNode parent) { DialogueNode newNode = CreateInstance <DialogueNode>(); newNode.name = Guid.NewGuid().ToString(); Undo.RegisterCreatedObjectUndo(newNode, "Created Dialogue Node"); if (parent != null) { parent.AddChild(newNode.name); newNode.SetIsPlayerSpeaking(!parent.IsPlayerSpeaking()); newNode.SetPosition(parent.GetRect().position + newNodeOffset); } if (AssetDatabase.GetAssetPath(this) != "") { Undo.RecordObject(this, "Added Dialogue Node"); } nodes.Add(newNode); OnValidate(); }