panning script csharp on phone

Code Example - panning script csharp on phone

                
                        #pragma strict

// The target gameObject.
var target: Transform;

// Speed in units per sec.
var speedLeft: float = -10;

private static var isPanLeft = false;


function FixedUpdate()
{
if(isPanLeft == true)
{
    // The step size is equal to speed times frame time.
    var step = speedLeft * Time.deltaTime;

    // Move model position a step closer to the target.
    transform.position = Vector3.MoveTowards(transform.position, target.position, step);
}
}

static function doPanLeft()
{
    isPanLeft = !isPanLeft;
}