Timed intervals?

Hello. I know how to enable objects, but how can I make it so that an object is enabled at the next set time interval? For example: If the time interval is every 5 seconds and the "object enabled" condition is met by the player at 13 seconds (since the start of the scene), then the object will be enabled at 15 seconds. If the player meets the condition at 21 seconds, it will be enabled at 25 seconds and so on. How can I do this?

I am going to have one object run from the start and then the second object will be enabled by the player at some point, but I want them both to be synced up...both object fire projectiles every .3 seconds if that helps put things into context.


EDIT- How would I incorporate something like that into this script?

static var MainLvl  = 0;
        var Upgrade1 : GameObject;
        var Upgrade2 : GameObject;
        var Upgrade3 : GameObject;

function Update (){
if (MainLvl >0) {Upgrade1.active = true;}
if (MainLvl >1) {Upgrade2.active = true;}
if (MainLvl >2) {Upgrade3.active = true;}

Use InvokeRepeating to test if a condition is met and apply a response.

// This is the condition that the player will set.
public var condition : boolean;

function Start()
    // Calls TestCondition after 0 seconds 
    // and repeats every 5 seconds.
    InvokeRepeating ("TestCondition", 0, 5); 

// Because of InvokeRepeating, tis is called every 5 seconds.
function TestCondition()
    if (condition)
        // Condition is met, cancel the repeating invoke
        // and call OnCondition, which handle the details
        // for what to do when the condition is true.

// This is called if the condition is met every 5 seconds.
function OnCondition()
    // Enable that object that you wanted to enable.
    print("Condition met!");

By the way, I am not sure what you're trying to achieve but it sounds that the example on the documentation page seems related;

// Starting in 2 seconds.
// a projectile will be launched every 0.3 seconds

var projectile : Rigidbody;

InvokeRepeating("LaunchProjectile", 2, 0.3);

function LaunchProjectile () {
    var instance : Rigidbody = Instantiate(projectile);
    instance.velocity = Random.insideUnitSphere * 5;

Just store a variable that holds the time and then do a check for variable + 5.0 seconds.

1 (not tested):

var enabledTime: float; 
var nextEvent: float = 5.0;

// set initial time
{ enabledTime = Time.time; }

//check timer

if(Time.time == enabledTime+nextEvent)
{ //do something }