protected override void Update()
    {
        base.Update();

        transform.rotation   = Quaternion.Euler(new Vector3(0, 0, ActionInput.GetJoyconVector().y + startAngle));
        transform.localScale = ActionInput.GetJoyconAccel();
        Vector3 tmpS = transform.localScale;

        /*
         * tmpS.x = Mathf.Max(tmpS.x, 0.5f);
         * tmpS.y = Mathf.Max(tmpS.y, 0.5f);
         * tmpS.z = Mathf.Max(tmpS.z, 0.5f);
         * transform.localScale = tmpS;
         */
    }
Example #2
0
    protected override void Update()
    {
        float speed = ActionInput.GetJoyconAccel().magnitude;

        if (speed < 1.2f)
        {
            speed = 1f;
        }
        speed               = Mathf.Min(speed, maxSpeed);
        targetPos           = defaultPos + transform.up * (speed - 1);
        transform.position += (targetPos - transform.position) * kakerukazu;
        base.Update();
        if (speed >= maxSpeed)
        {
            foreach (PlayerRB player in ridingPlayers)
            {
                player.power    = transform.up * maxSpeed;
                player.isGround = false;
                audioSource.PlayOneShot(audioSource.clip);
            }
        }
    }