Exemple #1
0
    public override void RequestSwitchLoopFlow(LoopFlow newLoopFlow, float fadeOutSeconds = 0.5f)
    {
        base.RequestSwitchLoopFlow(newLoopFlow, fadeOutSeconds);

        Futile.stage.AddChild(_fadeSprite);
        Futile.stage.AddChild(_fadeLabel);
    }
Exemple #2
0
    public override void SwitchLoopFlow(LoopFlow newLoopFlow)
    {
        base.SwitchLoopFlow(newLoopFlow);

        Futile.stage.AddChild(_fadeSprite);
        Futile.stage.RemoveChild(_fadeLabel);
    }
Exemple #3
0
        public PopupMenuFlow(LoopFlow pausingTarget, bool escToExit, float appearingTime = 0f, float disappearingTime = 0f) : base()
        {
            _pausingTarget = pausingTarget;
            _escToExit     = escToExit;

            _appearingTime    = appearingTime;
            _disappearingTime = disappearingTime;
        }
Exemple #4
0
        public OptionsMenu(LoopFlow pausingTarget) : base(pausingTarget, true, 0.5f, 0.5f)
        {
            AddElement(new FadePanel(this));

            _panel = new RoundedRect(this);
            AddElement(_panel);

            _label = new FLabel("font", "Not yet.");
            container.AddChild(_label);
        }
Exemple #5
0
    public void RemoveSubLoopFlow(LoopFlow loopFlow)
    {
        if (_subLoopFlows.Remove(loopFlow))
        {
            loopFlow.OnTerminate();
            loopFlow._owner = null;

            Debug.Log(string.Concat(this, "\nX ", loopFlow));
        }
    }
Exemple #6
0
    public virtual void RequestSwitchLoopFlow(LoopFlow newLoopFlow, float fadeOutSeconds = 0.5f)
    {
        if (_transiting)
        {
            return;
        }

        _requestedLoopFlow = newLoopFlow;

        _transiting  = true;
        _transitTime = fadeOutSeconds;
    }
Exemple #7
0
    public void AddSubLoopFlow(LoopFlow loopFlow)
    {
        if (loopFlow.activated)
        {
            loopFlow.Terminate();
        }

        _subLoopFlows.Add(loopFlow);

        loopFlow._owner = this;
        loopFlow.OnActivate();

        Debug.Log(string.Concat(this, "\n> ", loopFlow));
    }
Exemple #8
0
    public virtual void SwitchLoopFlow(LoopFlow newLoopFlow)
    {
        if (newLoopFlow == null || _currentLoopFlow == newLoopFlow)
        {
            return;
        }

        if (_currentLoopFlow != null)
        {
            _currentLoopFlow.Terminate();
        }

        _currentLoopFlow = newLoopFlow;
        AddSubLoopFlow(_currentLoopFlow);

        _transiting = false;
    }
Exemple #9
0
        public PauseMenu(LoopFlow pauseTarget) : base(null, true, 0.5f, 0.5f)
        {
            _pauseTarget = pauseTarget;

            _optionsMenu = new OptionsMenu(this);

            AddElement(new FadePanel(this));

            _cinematicEdge = new FSprite[2];
            for (int index = 0; index < _cinematicEdge.Length; index++)
            {
                _cinematicEdge[index] = new FSprite("pixel");

                _cinematicEdge[index].width = Futile.screen.width;
                _cinematicEdge[index].color = Color.black;
                _cinematicEdge[index].y     = Futile.screen.halfHeight * (index > 0 ? 1f : -1f);
            }

            container.AddChild(_cinematicEdge[0]);
            container.AddChild(_cinematicEdge[1]);

            _buttons    = new GeneralButton[3];
            _buttons[0] = new GeneralButton(this, "Resume", RequestTerminate);
            _buttons[1] = new GeneralButton(this, "To Menu", BackToMenu);
            _buttons[2] = new GeneralButton(this, "Options", OpenOptions);

            for (int index = 0; index < _buttons.Length; index++)
            {
                _buttons[index].size = new Vector2(48f, 16f);
                AddElement(_buttons[index]);
            }

            _buttons[0].position = MenuFlow.rightDown + Vector2.right * -30f;
            _buttons[1].position = MenuFlow.leftDown + Vector2.right * 30f;
            _buttons[2].position = MenuFlow.leftDown + Vector2.right * 90f;

            if (_onPauseAudio == null)
            {
                _onPauseAudio = Resources.Load <AudioClip>("SoundEffects/UIMetalHit");
            }
        }
Exemple #10
0
 public LoopFlowManager() : base()
 {
     _currentLoopFlow = null;
 }