kScriptObject
This is a wrapper for accessing an actor's user script object from its native script object, via kActor::ScriptObject()
.
Variables
ref& obj
a reference to the actor's user script object
e.g.,
void DoViewShake( float velocity, float angle, float duration )
{
kActor@ actor = ActorFactory.Spawn( "QuakeSource", 0,0,0, 0, self.SectorIndex() );
if ( actor is null )
return;
TurokQuakeSource@ quake = cast<TurokQuakeSource@>( actor.ScriptObject().obj );
if ( quake !is null )
quake.SetupShake( self.Origin(), velocity, angle, duration );
}