wiki.sine.space | sinespace

Difference between revisions of "Scripting/SPostProcessVolume"

From wiki.sine.space
Jump to: navigation, search
(Created page with " ==Members== {{ScriptFunction|bool|Enabled|{get; set;}|Enable or disable post effect volume.|5= volume = Space.Scene.Find("Main Camera").PostProcessVolume<br> ''--get post pr...")
 
Line 7: Line 7:
 
volume = Space.Scene.Find(“Main Camera”).PostProcessVolume<br>
 
volume = Space.Scene.Find(“Main Camera”).PostProcessVolume<br>
 
''--disable post process volume, post process should be disabled.''<br>
 
''--disable post process volume, post process should be disabled.''<br>
volume.Enabled = false
+
volume.Enabled = false|6=<pre>--clicking this object will Enable/Disable it's Post Process Volume component
 +
thisGameObject = Space.Host.ExecutingObject
 +
component = thisGameObject.PostProcessVolume
 +
 
 +
OnClick = function()
 +
component.Enabled =  not component.Enabled
 +
end
 +
 
 +
 
 +
thisGameObject.AddClickable()
 +
thisGameObject.Clickable.OnClick(OnClick)</pre>
 
}}
 
}}
  

Revision as of 03:56, 13 October 2021

Members

Enabled

bool Enabled {get; set;}

Enable or disable post effect volume.

volume = Space.Scene.Find("Main Camera").PostProcessVolume

--get post process volume from main camera.
volume = Space.Scene.Find(“Main Camera”).PostProcessVolume
--disable post process volume, post process should be disabled.

volume.Enabled = false


--clicking this object will Enable/Disable it's Post Process Volume component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.PostProcessVolume

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

IsGlobal

bool IsGlobal {get; set;}

Should this volume be applied to the whole scene?

volume = Space.Scene.Find("Main Camera").PostProcessVolume

--get post process volume from main camera.
--disable IsGlobal, this post process volume and the layer bound won't take effect if camera is not in the trigger post process volume bound to.

volume.IsGlobal = false



BlendDistance

float BlendDistance {get; set;}

The outer distance to start blending from. A value of 0 means no blending and the volume overrides will be applied immediately upon entry.

volume = Space.Scene.Find("Main Camera").PostProcessVolume

--get post process volume from main camera.
volume.IsGlobal = false
--disable IsGlobal.
--set blend distance to 50, and if the camera is near to the trigger post process layer bound to it would take effection and blend this volume with blend distance.

volume.BlendDistance = 50


Weight

float Weight {get; set;}

The total weight of this volume in the scene. 0 means it won't do anything, 1 means full effect.

volume = Space.Scene.Find("Main Camera").PostProcessVolume

--get post process volume from main camera.
volume.Weight = 0.5

--set weight to 0.5, post effect should be weakened.


Priority

float Priority {get; set;}

The volume priority in the stack. Higher number means higher priority. Negative values are supported.

volume = Space.Scene.Find("Main Camera").PostProcessVolume

--get post process volume from main camera.
volume.Priority = 2

--set priority to 2, if there are multiple post process volume, it would take effect.