Do something when looked at for a certain amount of time

I am currently making a game for my iphone, and want to know if when something is looked at for a long enough time the player will walk over to the object?

I can see you’re after something that will detect a certain amount of time passed. This may help

private float timeStamp, waitTime;
private bool timeStamped;

void Start()
{
timeStamp = 0.0f;
waitTime = 1.0f; //1 second
timeStamped = false; //Flag to show time has been recorded.
}

void Update()
{
if(!timeStamped) //if time hasn't been recorded yet.
{
timeStamp = Time.time;
timeStamped = true; //Flag the time record. This block of code won't execute again.
}

if(WaitTimeFinished()) //if time has finished/passed
{
//do something now i have waited
}
else
{
//don't
}

}

private bool WaitTimeFinished()
{
if(timeStamped) //only check if the time has been recorded
{
//TimeCheck
if(Time.time < timeStamp + waitTime)
{
return false;
}
else
{
return true;
}
}
else
   return false;
}