class SkyboxCorona extends Interaction;
#exec OBJ LOAD FILE=wm_textures.utx
var Vector SunDir;
simulated function PostRender( canvas Canvas )
{
local Actor Other;
local SunLight SL;
local Vector X, End, HitLocation, HitNormal,Start;
local Material HitMat;
if(ViewportOwner.Actor.Pawn !=None)
{
start=viewportOwner.Actor.pawn.location;
// ForEach AllActors(class'SunLight', SL, )
//the above line does not compile, it gives the following error
// Error, 'ForEach': An iterator expression is required
//So after looking through code of other Interaction class I found some that use "ViewportOwner.Actor.DynamicActors"
//so I put in a "ViewportOwner.Actor." in front of the "AllActors" and it now compiles
// but does not look to be doing anything
ForEach ViewportOwner.Actor.AllActors(class'SunLight', SL, )
//how do I use an AllActors properly in an Interaction class?
{
if ( (SL != None) && (SL.Region.Zone.IsA('SkyZoneInfo')) )
{
X = (Vector(SL.Rotation))* -1;
End = Start + 50000 * X;
Other = viewportOwner.Actor.pawn.Trace(HitLocation, HitNormal, End, Start, true,, HitMat);
If ( (Other!=None) && (HitMat==Texture'wm_textures.sky') )
viewportOwner.Actor.pawn.ClientMessage("You are in SunLight");
// how do I tell it to Message the player properly in an Interaction class?
}
}
}
}
defaultproperties
{
bVisible=true
bActive=true
bRequiresTick=True
}