예제 #1
0
    void Update()
    {
        var right   = rightSrc.GetAxes();
        var forward = forwardSrc.GetAxes();
        var motion  = motionSrc.GetAxes();

        force = Time.frameCount % 2 == 0? right * motion.x : forward * motion.y;
    }
예제 #2
0
    void Update()
    {
        var rotation = rotation2DOF.GetAxes();
        var up       = up3DOF.GetAxes();
        var right    = right3DOF.GetAxes();

        t.rotation = Time.frameCount % 2 == 0
                        ? Quaternion.AngleAxis(rotation.x * angularSpeed, up) * t.rotation
                        : Quaternion.AngleAxis(rotation.y * angularSpeed, right) * t.rotation;
    }
예제 #3
0
 void Update()
 {
     val = axis == Axis.X ? src.GetAxes().x : src.GetAxes().y;
 }