public void UpdateByController(float rotationY)
 {
     if (state == states.DEAD)
     {
         return;
     }
     if (!grounded)
     {
         ResetRotations();
         if (startJumping + 0.2f < Time.time)
         {
             Vector3 pos = transform.position;
             pos.y   += 1;
             grounded = Physics.Linecast(pos, groundCheck.position, 1 << LayerMask.NameToLayer("Floor"));
             if (grounded)
             {
                 OnFloor();
             }
         }
     }
     else
     {
         RaycastHit coverHit;
         if (Physics.Linecast(transform.position, groundCheck.position, out coverHit, 1 << LayerMask.NameToLayer("Floor")))
         {
             if (sliderEffect.speed != 0)
             {
                 SliderFloor sliderFloor = coverHit.transform.gameObject.GetComponent <SliderFloor>();
                 if (sliderFloor == null)
                 {
                     sliderEffect.speed = 0;
                     madRoller.Play("run");
                 }
             }
             if (coverHit.transform.tag == "floor")
             {
                 rotationZ = coverHit.transform.up.x * -30;
                 rotationX = coverHit.transform.eulerAngles.x;
             }
             else
             {
                 ResetRotations();
             }
         }
     }
     characterMovement.UpdateByController(rotationY);
 }
    public void UpdateByController(float rotationY)
    {
        if (state == states.COLLISIONED)
        {
            if (collisionToRight)
            {
                collisionedValue -= Time.deltaTime * collisionReactValue;
                if (collisionedValue < 0)
                {
                    madRoller.Play("run");
                    state = states.RUN;
                }
                else
                {
                    rotationY = (collisionedValue);
                }
            }
            else
            {
                collisionedValue += Time.deltaTime * collisionReactValue;
                if (collisionedValue > 0)
                {
                    madRoller.Play("run");
                    state = states.RUN;
                }
                else
                {
                    rotationY = (collisionedValue);
                }
            }
        }
        else
        if (!grounded)
        {
            ResetRotations();
            if (startJumping + 0.2f < Time.time)
            {
                Vector3 pos = transform.position;
                pos.y   += 1;
                grounded = Physics.Linecast(pos, groundCheck.position, 1 << LayerMask.NameToLayer("Floor"));
                if (grounded)
                {
                    OnFloor();
                }
            }
        }
        else
        {
            RaycastHit coverHit;
            if (Physics.Linecast(transform.position, groundCheck.position, out coverHit, 1 << LayerMask.NameToLayer("Floor")))
            {
                if (sliderEffect.speed != 0)
                {
                    SliderFloor sliderFloor = coverHit.transform.gameObject.GetComponent <SliderFloor>();
                    if (sliderFloor == null)
                    {
                        sliderEffect.speed = 0;
                        SetRunState();
                    }
                }
                float lastRotX = 0;
                if (coverHit.transform.tag == "floor")
                {
                    rotationZ = coverHit.transform.up.x * -30;
                    rotationX = coverHit.transform.eulerAngles.x;
                    if (rotationX != lastRotX)
                    {
                        madRoller.Play("little_jump");
                        lastRotX = rotationX;
                    }
                }
                else
                {
                    ResetRotations();
                }
            }
        }


        characterMovement.UpdateByController(rotationY);
    }