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;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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();
        }