just get the component from the gameObject and then set ".enabled" to true or false.
on some kind of trigger event it could be like this:
var component : nameOfComponent = collision.GetComponent( nameOfComponent );
component.enabled = true;
//assuming default is false
or if no collision/trigger event..find the gameObject first..and get component from that.
var gObjectComponent : nameOfComponent;
gObjectComponent = GameObject.Find("nameOfGameObjectWithComponent").GetComponent( nameOfComponent );
if( time >= 3seconds )
gObjectComponent.enabled = true;
else
gObjectComponent.enabled = false;
↧