Beispiel #1
0
    public void OnMouseUp()
    {
        //print(gameObject.name);
        if (_inventory != null && _inventory.IsOpen)
        {
            return;
        }
        _mouseDown = false;

        if (_startMousePos == Camera.main.ScreenToWorldPoint(Input.mousePosition))
        {
            if (_haveActionHandler)
            {
                _actionHandler.HandleAction();
            }
        }
    }
Beispiel #2
0
        public static async Task Run()
        {
            SharedVars.CurrentRunningActionType = RunningActionType.AskForCourse;
            while (true)
            {
                try
                {
                    switch (SharedVars.CurrentRunningActionType)
                    {
                    case RunningActionType.AskForCourse:
                        await AskForCourse();

                        break;

                    case RunningActionType.AskForSection:
                        await AskForSection();

                        break;

                    case RunningActionType.AskForMultipleLinks:
                        AskForMultipleLinks();
                        break;

                    case RunningActionType.AskForNamingMethod:
                        await AskForNamingMethod();

                        break;

                    case RunningActionType.DownloadSelectedLinks:
                        await DownloadSelectedLinks();

                        break;
                    }

                    SharedVars.CurrentRunningActionType++;
                }
                catch (BaseAction action)
                {
                    await ActionHandler.HandleAction(action);
                }

                if (SharedVars.CurrentRunningActionType == RunningActionType.Repeat)
                {
                    var startAgain = MenuChooseItem.AskYesNoQuestion("Do you want to start again? [Y/N] ",
                                                                     () =>
                    {
                        SharedVars.ChosenItemsTillNow.Clear();
                        SharedVars.CurrentRunningActionType = RunningActionType.AskForCourse;
                    },
                                                                     Dispose);

                    if (!startAgain) // onNo
                    {
                        break;
                    }
                }

                if (SharedVars.CurrentRunningActionType == RunningActionType.End)
                {
                    Dispose();
                    break;
                }
            }
        }