Exemplo n.º 1
0
        void Update()
        {
            Game game = Game.GetInstantiate();

            if (game.GetGameState() == GameState.IN_DIALOG)
            {
                int key = -1;
                if (Input.GetKeyDown(KeyCode.Alpha1))
                {
                    key = 1;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha2))
                {
                    key = 2;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha3))
                {
                    key = 3;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha4))
                {
                    key = 4;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha5))
                {
                    key = 5;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha6))
                {
                    key = 6;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha7))
                {
                    key = 7;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha8))
                {
                    key = 8;
                }
                else if (Input.GetKeyDown(KeyCode.Alpha9))
                {
                    key = 9;
                }
                if (key != -1)
                {
                    InterfaceManager interfaceManager = InterfaceManager.GetInstantiate();
                    DialogChoose     choose           = interfaceManager.dialogPanel.GetChoose(key);
                    if (choose != null)
                    {
                        DialogManager.GetInstantiate().RealizeChoose(choose);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void SetChoose(DialogChoose choose, int index)
 {
     this.choose = choose;
     if (choose.type == ChooseType.CONTINUE)
     {
         chooseText.text = string.Format("{0}. {1}", index, "[Продолжить]");
     }
     else
     {
         chooseText.text = string.Format("{0}. {1}", index, choose.chooseText);
     }
 }
Exemplo n.º 3
0
    public DialogChooseNode CreateChooseNode(DialogChoose choose)
    {
        DialogChooseNode chooseNode = new DialogChooseNode();

        if (choose != null)
        {
            chooseNode.choose     = choose;
            chooseNode.windowRect = choose.nodePosition;
        }
        else
        {
            GameObject goChoose = new GameObject("Choose");
            goChoose.transform.parent = phrase.transform;
            DialogChoose newChoose = goChoose.AddComponent <DialogChoose>();
            phrase.chooses.Add(newChoose);
            chooseNode.choose = newChoose;
        }
        chooseNode.id = DialogEditor.editor.id;
        DialogEditor.editor.id++;
        chooseNode.parentNode = this;
        chooseNodes.Add(chooseNode);
        Selection.activeGameObject = chooseNode.choose.gameObject;
        return(chooseNode);
    }