Ejemplo n.º 1
0
        private void DrawLinesAsConnections(JournalNode nodeTemp)
        {
            JournalNode nextNode = null;

            foreach (JournalNode node in _mainJournal.GetAllNodes())
            {
                if (node.GetOrder() == (nodeTemp.GetOrder() + 1))
                {
                    nextNode = node;
                }
            }

            if (nextNode != null)
            {
                LineConnectionPosition(new Vector2(nodeTemp.GetRect().xMax, nodeTemp.GetRect().center.y),
                                       new Vector2(nextNode.GetRect().xMin, nextNode.GetRect().center.y));
            }
        }
Ejemplo n.º 2
0
        private void DrawNode(JournalNode node)
        {
            GUILayout.BeginArea(node.GetRect());
            Texture2D texture = null;

            foreach (Texture2D t in _picsInFolder)
            {
                if (node.GetImageName().Equals(t.name))
                {
                    texture = t;
                }
            }

            GUI.DrawTexture(new Rect(0, 0, _nodeOuterRect.width, _nodeOuterRect.height), texture,
                            ScaleMode.StretchToFill, true, 0f);
            GUILayout.Space(10);
            GUILayout.BeginHorizontal();

            int order = node.GetOrder();

            if (order > 1)
            {
                if (GUILayout.Button(" < ", GUILayout.Width(15), GUILayout.Height(15)))
                {
                    NodeOrder(node, order, false);
                }
            }
            else
            {
                GUILayout.Label("", GUILayout.Width(0));
            }

            if (order < _mainJournal.GetAllNodes().Count)
            {
                if (GUILayout.Button(" > ", GUILayout.Width(15), GUILayout.Height(15)))
                {
                    NodeOrder(node, order, true);
                }
            }
            else
            {
                GUILayout.Label("", GUILayout.Width(0));
            }


            GUILayout.EndHorizontal();
            GUILayout.Space(220);
            GUILayout.Label("Order: " + node.GetOrder(), _orderStyle, GUILayout.Width(70));

            GUILayout.EndArea();
        }