Ejemplo n.º 1
0
        private void ChangeButtons()
        {
            /*
            colors Hex:
            xpress: D06286
            premium: EDD569
            lux: 352E4F

            SRUIDisplayRegular, 22, Hex: AFB6BC
            */
            for (int i = 0; i < modeButtons.Count; i++)
            {
                var btn = modeButtons[i];
                if (i == selectedIndex)
                {
                    btn.Source = ImageSource.FromResource($"TiroApp.Images.SliderBtnChecked_{i}.png");
                    modeInfos[i].TextColor = GetColorForCheckedMode(i);
                    modePrices[i].TextColor = GetColorForCheckedMode(i);
                }
                else
                {
                    btn.Source = ImageSource.FromResource("TiroApp.Images.SliderBtnUnchecked.png");
                    modeInfos[i].TextColor = Color.FromHex("AFB6BC");
                    modePrices[i].TextColor = Color.FromHex("AFB6BC");
                }
            }
            OnSlide?.Invoke(this, (Tier)(selectedIndex + 1));
        }
Ejemplo n.º 2
0
        public void SmashDown()
        {
            while (CanMoveDown(CurrentPiece))
            {
                CurrentPiece.MoveDown();
            }

            Checkout();
            OnSlide?.Invoke();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The SlideLeft
        /// </summary>
        public void SlideLeft()
        {
            if (!CanMoveLeft(CurrentPiece))
            {
                return;
            }

            while (CanMoveLeft(CurrentPiece))
            {
                CurrentPiece.MoveLeft();
            }
            Checkout();
            OnSlide?.Invoke();
        }
Ejemplo n.º 4
0
        private GameController(int width, int height)
        {
            if (width < 10)
            {
                throw new ArgumentException(nameof(width));
            }

            if (height < 10)
            {
                throw new ArgumentException(nameof(height));
            }

            _board            = new Board(new StatsRepository(), width, height);
            _board.OnRefresh += () => { OnRefresh?.Invoke(); };
            _board.OnFinish  += () => { OnFinish?.Invoke(); };
            _board.OnClear   += () => { OnClear?.Invoke(); };
            _board.OnMove    += () => { OnMove?.Invoke(); };
            _board.OnSlide   += () => { OnSlide?.Invoke(); };
        }
Ejemplo n.º 5
0
 void Update()
 {
     if (m_bForward)
     {
         OnForward.Invoke(1.0f);
     }
     if (m_bBack)
     {
         OnForward.Invoke(-1.0f);
     }
     if (m_bSlideLeft)
     {
         OnSlide.Invoke(-1.0f);
     }
     if (m_bSlideRight)
     {
         OnSlide.Invoke(1.0f);
     }
 }
Ejemplo n.º 6
0
        private void ProcessInput(List <Touch> touches, InputState state)
        {
            switch (state)
            {
            case InputState.None:
                break;

            case InputState.Press:
                if (touches[0].phase == TouchPhase.Began)
                {
                    OnPressStart?.Invoke(touches[0].position);
                }
                break;

            case InputState.Sliding:
                Vector3 prevPos    = _prevTouches[0].position;
                Vector3 currentPos = touches[0].position;
                OnSlide?.Invoke(prevPos, currentPos);
                break;

            case InputState.Up:
                OnTouchUp?.Invoke(touches[0].position);
                break;

            case InputState.Pinch:
                if (_prevState != InputState.Pinch)
                {
                    return;
                }

                float prevLength    = (_prevTouches[0].position - _prevTouches[1].position).magnitude;
                float currentLength = (touches[0].position - touches[1].position).magnitude;
                OnPinch?.Invoke(Mathf.Abs(prevLength - currentLength));
                break;

            default:
                break;
            }
        }
Ejemplo n.º 7
0
 private void StartSlide()
 {
     if (/*!isJump && */ !_isSliding)
     {
         _animator.SetSlideAnimation(true);
         if (_isJump)
         {
             StopJump();
             _animator.SetJumpAnimation(false);
         }
         _slideBreak = false;
         slideEffect.Play();
         _isSliding          = true;
         _collider.direction = 2;
         SetPlayerMovementType(MovementType.Slide);
         OnSlide?.Invoke();
         StartCoroutine(Slide());
         if (_followCamera.followType != PlayerFollowCamera.FollowType.DeathLoop)
         {
             _followCamera.SetFollowType(PlayerFollowCamera.FollowType.Slide);
         }
     }
 }
Ejemplo n.º 8
0
    //public void TapStarted()
    //{
    //    OnTapStarted?.Invoke();
    //}

    public void Slide(float value)
    {
        OnSlide?.Invoke(value);
    }