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

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

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

            _appearingTime    = appearingTime;
            _disappearingTime = disappearingTime;
        }
示例#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);
        }
示例#5
0
    public void RemoveSubLoopFlow(LoopFlow loopFlow)
    {
        if (_subLoopFlows.Remove(loopFlow))
        {
            loopFlow.OnTerminate();
            loopFlow._owner = null;

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

        _requestedLoopFlow = newLoopFlow;

        _transiting  = true;
        _transitTime = fadeOutSeconds;
    }
示例#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));
    }
示例#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;
    }
示例#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");
            }
        }
示例#10
0
 public LoopFlowManager() : base()
 {
     _currentLoopFlow = null;
 }