コード例 #1
0
    void SetTouch()
    {
        if (inputX.SetInputs())
        {
            _click = inputX.GetInput(0);

            if (_click.phase == IPhase.Began)
            {
                TouchStarted(_click);
            }
            else if (_click.phase == IPhase.Moved || _click.phase == IPhase.Stationary)
            {
                TouchProceed(_click);
            }
            else
            {
                TouchEnd(_click);
            }

            isMO = true;

            return;
        }

        isMO = false;
    }
コード例 #2
0
    void Update()
    {
        transform.position = Vector3.MoveTowards(transform.position, transform.position + Vector3.forward, playerSpeed);

        if (inputX.IsInput())
        {
            isGameStarted = true;

            GeneralInput gInput = inputX.GetInput(0);

            if (gInput.phase == IPhase.Began || gInput.phase == IPhase.Stationary || gInput.phase == IPhase.Ended || gInput.phase == IPhase.Canceled)
            {
                touchStartPos = gInput.currentPosition;
            }
            else
            {
                Vector2 touchAlpha = gInput.currentPosition - touchStartPos;
                if (touchAlpha.x > 1f && !moveHandsToRight)
                {
                    moveHandsToRight = true;
                    moveHandsToLeft  = false;
                }
                else if (touchAlpha.x < -1f && !moveHandsToLeft)
                {
                    moveHandsToLeft  = true;
                    moveHandsToRight = false;
                }
            }
        }
    }
コード例 #3
0
    void Update()
    {
        if (inputX.GetInputs() && !DataScript.inputLock)
        {
            GeneralInput gInput = inputX.GetInput(0);

            if (gInput.phase == IPhase.Began)
            {
                Ray        ray = Camera.main.ScreenPointToRay(gInput.currentPosition);
                RaycastHit raycastHit;

                if (Physics.Raycast(ray, out raycastHit))
                {
                    if (raycastHit.transform.gameObject.tag == "Hex")
                    {
                        StartCoroutine(CarryRagdollToNewPos(raycastHit.transform.gameObject));
                    }
                }
            }
        }
    }
コード例 #4
0
    void Update()
    {
        if(inputX.IsInput())
        {
            GeneralInput gInput = inputX.GetInput(0);
          
            if(gInput.phase == IPhase.Began)
            {
                isTouchEnded = false;
                StartCoroutine(Fire());
                touchStartPos = gInput.currentPosition;
            }
            else if(gInput.phase == IPhase.Ended)
            {
                isTouchEnded = true;

                if(routeFollower!=null)
                    StopCoroutine(routeFollower); //Corountine inputla beraber bitmediginden burada durduruluyor. yukarda alinan input corountine sokuluyor ama sonradan editlenmiyor. 

                coroutineAllowed = true;
                touchDeltaX = 0;
            }
            else
            {