Ejemplo n.º 1
0
    protected override void Start()
    {
        base.Start();

        Text title = GetComponentInChildren <Text>();

        title.text = LocalizationTable.GetLocalization("menu_construction");

        menuLeft = this.transform.GetComponentInParent <MenuLeft>();

        this.transform.Find("Close Button").GetComponent <Button>().onClick.AddListener(delegate
        {
            menuLeft.CloseCurrentMenu();
        });

        RenderRoomBehaviorButtons();
        RenderTileButtons();
        RenderFurnitureButtons();
        RenderUtilityButtons();

        InputField filterField = GetComponentInChildren <InputField>();

        filterField.onValueChanged.AddListener(delegate { FilterTextChanged(filterField.text); });
        KeyboardManager.Instance.RegisterModalInputField(filterField);
    }
Ejemplo n.º 2
0
 public void Volver()
 {
     StartP.SetActive(true);
     PreQuest.SetActive(false);
     MenuLeft.SetActive(false);
     Welcome.SetActive(false);
     Quest.SetActive(false);
 }
Ejemplo n.º 3
0
 void Start()
 {
     StartP.SetActive(true);
     PreQuest.SetActive(false);
     MenuLeft.SetActive(false);
     Welcome.SetActive(false);
     Quest.SetActive(false);
 }
Ejemplo n.º 4
0
    // Use this for initialization.
    private void Start()
    {
        menuLeft     = GameObject.Find("MenuLeft").GetComponent <MenuLeft>();
        buttonPrefab = Resources.Load("UI/MenuButton");

        CreateGameMenu();

        GameMenuManager.Instance.Added += CreateGameMenu;
    }
Ejemplo n.º 5
0
    private void Start()
    {
        menuLeft = this.transform.GetComponentInParent <MenuLeft>();

        this.transform.FindChild("Close Button").GetComponent <Button>().onClick.AddListener(delegate
        {
            menuLeft.CloseMenu();
        });

        RenderDeconstructButton();
        RenderTileButtons();
        RenderFurnitureButtons();

        lastLanguage = LocalizationTable.currentLanguage;
    }
Ejemplo n.º 6
0
    private void Start()
    {
        menuLeft = this.transform.GetComponentInParent <MenuLeft>();

        this.transform.FindChild("Close Button").GetComponent <Button>().onClick.AddListener(delegate
        {
            menuLeft.CloseMenu();
        });

        RenderDeconstructButton();
        RenderRoomBehaviorButtons();
        RenderTileButtons();
        RenderFurnitureButtons();
        RenderUtilityButtons();

        InputField filterField = GetComponentInChildren <InputField>();

        KeyboardManager.Instance.RegisterModalInputField(filterField);
    }
Ejemplo n.º 7
0
    private void Start()
    {
        Text title = GetComponentInChildren <Text>();

        title.text = LocalizationTable.GetLocalization("menu_orders");

        menuLeft = this.transform.GetComponentInParent <MenuLeft>();

        this.transform.FindChild("Close Button").GetComponent <Button>().onClick.AddListener(delegate
        {
            menuLeft.CloseMenu();
        });

        RenderDeconstructButton();
        RenderMineButton();

        InputField filterField = GetComponentInChildren <InputField>();

        KeyboardManager.Instance.RegisterModalInputField(filterField);
    }
Ejemplo n.º 8
0
    // Use this for initialization.
    private void Start()
    {
        dialogBoxManager = GameObject.Find("Dialog Boxes").GetComponent <DialogBoxManager>();
        menuLeft         = GameObject.Find("MenuLeft").GetComponent <MenuLeft>();

        // Add listeners here.
        buttonConstructor.onClick.AddListener(delegate
        {
            OnButtonConstruction();
        });

        buttonWorld.onClick.AddListener(delegate
        {
            OnButtonWorld();
        });

        buttonWork.onClick.AddListener(delegate
        {
            OnButtonWork();
        });

        buttonOptions.onClick.AddListener(delegate
        {
            OnButtonOptions();
        });

        buttonSettings.onClick.AddListener(delegate
        {
            OnButtonSettings();
        });

        buttonQuests = CreateButton("menu_quests");
        buttonQuests.onClick.AddListener(delegate
        {
            OnButtonQuests();
        });

        DeactivateAll();
    }
Ejemplo n.º 9
0
 public void ExitMenu()
 {
     MenuLeft.SetActive(false);
 }
Ejemplo n.º 10
0
 public void Menu()
 {
     MenuLeft.SetActive(true);
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 给窗口添加键盘事件,当楼层初始化后进行处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DirectionKeyDown(object sender, KeyEventArgs e)
        {
            if (!FloorFactory.GetInstance().IsInitialize())
            {
                return;
            }
            //对话界面
            if (hero.IsTalking)
            {
                if (e.Key == Key.Space || e.Key == Key.Enter)
                {
                    hero.NPC.NextText();
                }
                return;
            }

            // 游戏界面中
            if (!isMenuOpened)
            {
                //英雄移动和菜单项开关
                switch (e.Key)
                {
                case Key.Up:
                    hero.MoveUp();
                    break;

                case Key.Down:
                    hero.MoveDown();
                    break;

                case Key.Left:
                    hero.MoveLeft();
                    break;

                case Key.Right:
                    hero.MoveRight();
                    break;

                case Key.Escape:
                    isMenuOpened = true;
                    GlobalLeft.Navigate(MenuLeft.GetInstance());
                    GlobalRight.Navigate(MonsterData.GetInstance());
                    MonsterData.GetInstance().ShowContentItem();
                    break;
                }
            }
            else
            {
                //菜单栏监听
                double itemTop = Canvas.GetTop(MenuLeft.ToggleCanvas);
                switch (e.Key)
                {
                case Key.Down:
                    if (itemTop == 257)
                    {
                        Canvas.SetTop(MenuLeft.ToggleCanvas, 7);
                        itemNum = 0;
                    }
                    else
                    {
                        Canvas.SetTop(MenuLeft.ToggleCanvas, Canvas.GetTop(MenuLeft.ToggleCanvas) + 50);
                        itemNum++;
                    }
                    ShowRightWindow(itemNum);
                    break;

                case Key.Up:
                    if (itemTop == 7)
                    {
                        Canvas.SetTop(MenuLeft.ToggleCanvas, 257);
                        itemNum = 5;
                    }
                    else
                    {
                        Canvas.SetTop(MenuLeft.ToggleCanvas, Canvas.GetTop(MenuLeft.ToggleCanvas) - 50);
                        itemNum--;
                    }
                    ShowRightWindow(itemNum);
                    break;

                case Key.Escape:
                    isMenuOpened = false;
                    GlobalLeft.Navigate(State.GetInstance());
                    GlobalRight.Navigate(FloorFactory.GetInstance());
                    Canvas.SetTop(MenuLeft.ToggleCanvas, 7);
                    MonsterData.GetInstance().ContentItem.Children.Clear();
                    itemNum = 0;
                    break;
                }
            }
        }
Ejemplo n.º 12
0
    protected override void Awake()
    {
        base.Awake();

        Instance = this;
    }