Rain = 
{
	type = "Rain",
	Properties = 
	{
		bEnabled = 1, --[0,1,1,"Set this to true/false to turn the rain effect on/off."]
		bIgnoreVisareas = 0, --[0,1,1,"Continue to render rain when player is inside a visarea."]
		bDisableOcclusion = 0, --[0,1,1,"Don't check if object should be occluded from rain (is under cover)."]
		fRadius = 10000.0, --[0,10000,1,"Set the radius, or coverage area, of the rain effect."]
		fAmount = 1.0, --[0,100,0.1,"Set the overall amount of the rain entity's various effects."]
		clrColor = {x=1,y=1,z=1},
		fFakeGlossiness = 0.5, --[0,100,0.1,"Set the amount of glossiness/wetness that is applied to the surfaces in the world."]
		fFakeReflectionsAmount = 1.5, --[0,1000,0.1,"Set the amount of reflection that is applied to the surfaces in the world."]
		fDiffuseDarkening = 0.5, --[0,1,0.1,"Set the amount of darkening due to wetness that is applied to the surfaces in the world."]
		fRainDropsAmount = 0.5, --[0,100,0.1,"Set the amount of rain drops that can be seen in the air."]
		fRainDropsSpeed = 1.0, --[0,100,0.1,"Set the speed at which the rain drops travel."]
		fRainDropsLighting = 1.0, --[0,100,0.1,"Set the brightness or backlighting of the rain drops."]
		fMistAmount = 3.0, --[0,1000,0.1,"Set the amount of mist that appears on surfaces (distant, subtle effect)."]
		fMistHeight = 8.0, --[0,100,0.1,"Set the maximum height at which mist can appear on distant surfaces."]
		fPuddlesAmount = 1.5, --[0,10,0.01,"Set the strength (depth and brightness) of puddles generated by the rain."]
		fPuddlesMaskAmount = 1.0, --[0,1,0.01,"Set the strength of the puddle mask to balance different puddle results."]
		fPuddlesRippleAmount = 2.0, --[0,100,0.1,"Set the strength and frequency of the puddles generated by the rain (offset PuddlesAmount)."]
		fSplashesAmount = 1.3, --[0,1000,0.1,"Set the strength of splash effects generated by the rain (subtle ground effect)."]
	},
	Editor =
	{
		Icon="shake.bmp",
	},
}

function Rain:OnInit()
	self:OnReset();
end

function Rain:OnPropertyChange()
	self:OnReset();
end

function Rain:OnReset()
end

function Rain:OnSave(tbl)
	tbl.bEnabled = self.Properties.bEnabled;
end

function Rain:OnLoad(tbl)
	self.Properties.bEnabled = tbl.bEnabled;
end

function Rain:OnShutDown()
end


----------------------
-- Flow Nodes Start
----------------------

function Rain:Event_Enable( sender )
	self.Properties.bEnabled = 1;
	self:ActivateOutput("Enable", true);
end

function Rain:Event_Disable( sender )
	self.Properties.bEnabled = 0;
	self:ActivateOutput("Disable", true);
end

function Rain:Event_Amount( sender, amount )
	self.Properties.fAmount = amount;
end

function Rain:Event_Radius( sender, radius )
	self.Properties.fRadius = radius;
end

function Rain:Event_MistAmount( sender, mistamount )
	self.Properties.fMistAmount = mistamount;
end

function Rain:Event_PuddlesAmount( sender, puddlesamount )
	self.Properties.fPuddlesAmount = puddlesamount;
end

function Rain:Event_RainDropsAmount( sender, raindropsamount )
	self.Properties.fRainDropsAmount = raindropsamount;
end

function Rain:Event_RainDropsSpeed( sender, raindropsspeed )
	self.Properties.fRainDropsSpeed = raindropsspeed;
end

Rain.FlowEvents =
{
	Inputs =
	{
		Disable = { Rain.Event_Disable, "bool" },
		Enable = { Rain.Event_Enable, "bool" },
		Amount = { Rain.Event_Amount, "float" },
		Radius = { Rain.Event_Radius, "float" },
		MistAmount = { Rain.Event_MistAmount, "float" },
		PuddlesAmount = { Rain.Event_PuddlesAmount, "float" },
		RainDropsAmount = { Rain.Event_RainDropsAmount, "float" },
		RainDropsSpeed = { Rain.Event_RainDropsSpeed, "float" },
	},
	Outputs =
	{
		Disable = "bool",
		Enable = "bool",
	},
}
