Esempio n. 1
0
 protected void copy(WaitForInputNode nodeToCopy)
 {
     base.copy(nodeToCopy);
 }
Esempio n. 2
0
    void ContextCallBack(object o)
    {
        string clb = o.ToString();

        if (clb.Equals("textNode"))
        {
            TextNode textNode = new TextNode();

            textNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(textNode);
        }
        else if (clb.Equals("imgNode"))
        {
            ImageNode imgNode = new ImageNode();

            imgNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 325);

            AddNode(imgNode);
        }
        else if (clb.Equals("clicNode"))
        {
            WaitForInputNode clicNode = new WaitForInputNode();

            clicNode.windowRect = new Rect(mousePos.x, mousePos.y, 150, 50);

            AddNode(clicNode);
        }
        else if (clb.Equals("lucNode"))
        {
            LucidityAddNode lucNode = new LucidityAddNode();

            lucNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(lucNode);
        }
        else if (clb.Equals("calcNode"))
        {
            SetVariableNode calcNode = new SetVariableNode();

            calcNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(calcNode);
        }
        else if (clb.Equals("waitNode"))
        {
            WaitNode waitNode = new WaitNode();

            waitNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(waitNode);
        }
        else if (clb.Equals("fadeNode"))
        {
            FadeNode fadeNode = new FadeNode();

            fadeNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(fadeNode);
        }
        else if (clb.Equals("choiceNode"))
        {
            ChoiceNode choiceNode = new ChoiceNode();

            choiceNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(choiceNode);
        }
        else if (clb.Equals("seqNode"))
        {
            GoToSequenceNode seqChoice = new GoToSequenceNode();

            seqChoice.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(seqChoice);
        }
        else if (clb.Equals("destroyNode"))
        {
            DestroyNode destroyNode = new DestroyNode();

            destroyNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(destroyNode);
        }
        else if (clb.Equals("conditionNode"))
        {
            ConditionNode conditionNode = new ConditionNode();

            conditionNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 175);

            AddNode(conditionNode);
        }
        else if (clb.Equals("placeNode"))
        {
            GoToPlaceNode placeNode = new GoToPlaceNode();

            placeNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(placeNode);
        }
        else if (clb.Equals("animNode"))
        {
            AnimationNode animNode = new AnimationNode();

            animNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 300);

            AddNode(animNode);
        }
        else if (clb.Equals("exploNode"))
        {
            GoToExplorationNode exploNode = new GoToExplorationNode();

            exploNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(exploNode);
        }
        else if (clb.Equals("soundNode"))
        {
            PlaySoundNode soundNode = new PlaySoundNode();

            soundNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(soundNode);
        }
        else if (clb.Equals("stopNode"))
        {
            StopSoundNode stopNode = new StopSoundNode();

            stopNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(stopNode);
        }
        else if (clb.Equals("goNode"))
        {
            GameObjectNode goNode = new GameObjectNode();

            goNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 200);

            AddNode(goNode);
        }
        else if (clb.Equals("setFirst"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                sequence.firstNodeId = sequence.nodes[selectedIndex].id;
            }
        }
        else if (clb.Equals("makeTransition"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                selectedNode = sequence.nodes[selectedIndex];

                if (selectedNode.nextNodeId != -1)
                {
                    selectedNode.nextNodeId = -1;

                    selectedNode.nextNode.NodeDeleted(selectedNode);
                    selectedNode.nextNode = null;
                }

                makeTransitionMode = true;
            }
        }
        else if (clb.Equals("makeTransition1"))
        {
            MakeTransitionChoice(0);
        }
        else if (clb.Equals("makeTransition2"))
        {
            MakeTransitionChoice(1);
        }
        else if (clb.Equals("makeTransition3"))
        {
            MakeTransitionChoice(2);
        }
        else if (clb.Equals("makeTransition4"))
        {
            MakeTransitionChoice(3);
        }
        else if (clb.Equals("makeTransitionTrue"))
        {
            MakeTransitionCondition(0);
        }
        else if (clb.Equals("makeTransitionFalse"))
        {
            MakeTransitionCondition(1);
        }
        else if (clb.Equals("deleteNode"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                EventNode selNode = sequence.nodes[selectedIndex];
                sequence.nodes.RemoveAt(selectedIndex);

                if (selNode.id == sequence.firstNodeId)
                {
                    if (sequence.nodes.Count > 0)
                    {
                        sequence.firstNodeId = sequence.nodes[0].id;
                    }
                    else
                    {
                        sequence.firstNodeId = -1;
                    }
                }

                foreach (EventNode n in sequence.nodes)
                {
                    n.NodeDeleted(selNode);
                }
            }
        }
    }