Exemplo n.º 1
0
    public override async Task OnClick()
    {
        try {
            switch (Type)
            {
            case PanelChangerButtonType.Open:
                await PanelChangerService.ShowPanel(Id);

                break;

            case PanelChangerButtonType.Close:
                await PanelChangerService.HidePanel(Id);

                break;

            case PanelChangerButtonType.Toggle:
                await PanelChangerService.TogglePanel(Id);

                break;
            }
        }
        catch (System.Exception e) {
            LOG.Log(e);
            throw;
        }
    }
Exemplo n.º 2
0
    public override async Task OnClick()
    {
        var res = await NetworkService.RequestMoveCurrentCharacter(MapService.SelectedArea.Id);

        if (res)
        {
            await GameState.RefreshCurrentCharacter();

            while (GameState.IsCurrentCharacterMoving)
            {
                await Task.Delay(1000);
            }
        }

        await PanelChangerService.HidePanel(GamePanelId.Map);
    }
Exemplo n.º 3
0
    private void HandleUserInputs()
    {
        if (!shouldHandleUserInputs)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            PanelChangerService.TogglePanel(GamePanelId.EscMenu);
        }

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            PanelChangerService.TogglePanel(GamePanelId.Map);
        }
    }
Exemplo n.º 4
0
    async void Start()
    {
        // MUST BE THE FIRST THING
        LOG.Log("Setting up all objects");
        foreach (var item in Resources.FindObjectsOfTypeAll <SetupMonoBehaviour>())
        {
            item.Setup();
        }

        ScreenChangerService.HideAll();
        PanelChangerService.HideAllPanels();
        await ScreenChangerService.ChangeScreen(ScreenId.Login);

        UserInputService.ShouldHandleUserInputs = true;
        SoundService.PlaySong(SongId.Opening);

        try {
            await ConnectToServer();
        }
        catch (Exception e) {
            LOG.Log(e);
        }
    }