Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            panel.SetActive(false);

            _currentPanelAnimationState = PanelAnimationState.Off;
            _nextPanelAnimationState    = PanelAnimationState.Off;
            _animationTextAtlasIndex    = 0;

            Agent.OnEnqueueOwnGameAction += guid => _nextPanelAnimationState = PanelAnimationState.On;
            Agent.OnHasOwnTx             += has => _nextPanelAnimationState = has
                ? PanelAnimationState.On
                : PanelAnimationState.Off;
        }
Exemplo n.º 2
0
        protected override void Update()
        {
            if (_currentPanelAnimationState == _nextPanelAnimationState)
            {
                return;
            }

            _currentPanelAnimationState = _nextPanelAnimationState;

            if (_currentPanelAnimationState == PanelAnimationState.On)
            {
                if (!panel.activeSelf)
                {
                    panel.SetActive(true);
                }
                _panelAnimator.Play("Show");
                UpdateAnimation();
            }
            else
            {
                _panelAnimator.Play("Close");
            }
        }