public void Update(float elapsed)
        {
            if (_shown || _completed)
            {
                return;
            }

            if (_alertPrototype == null)
            {
                _alertPrototype = Services.Instance.Resolve <IAlertView>();
                if (_alertPrototype == null)
                {
                    throw new InvalidOperationException("Could not find alert view");
                }
            }

            var alertView = (IAlertView)_alertPrototype.Clone();

            alertView.Title   = "Tutorial Step";
            alertView.Message = AlertMessage;
            alertView.Input   = false;
            alertView.Buttons = new[] { "Ok" };
            alertView.Show(result => { _completed = true; });

            _shown = true;
        }
Beispiel #2
0
    void OnStartTutorial(string tutorialName)
    {
        if (_tutorialManager.HasActiveTutorial == false)
        {
            _tutorialManager.SetActiveTutorial(tutorialName);
        }
        else
        {
            var alertView = (IAlertView)_alertPrototype.Clone();
            alertView.Title   = "Start Tutorial Error";
            alertView.Message =
                $"Could not start {tutorialName}. A tutorial is already running: {_tutorialManager.ActiveTutorialName}";

            alertView.Input   = false;
            alertView.Buttons = new[] { "Ok" };
            alertView.Show(result => { });
        }
    }