wiki.sine.space | sinespace

Scripting/SRenderer

From wiki.sine.space
Revision as of 14:26, 24 January 2022 by Voidtech (Talk | contribs)

Jump to: navigation, search

A renderer is what makes an object appear on the screen.

The SRenderer class component interfaces with Unity's Renderer component, exposing its functions to scripting.

Properties

IsVisible

bool IsVisible { get; }

Returns true if the renderer is visible on any camera.

isVisible = Space.Host.ExecutingObject.Renderer.IsVisible



Enabled

bool Enabled { get; set; }

Get/Set if the rendered object is visible.

Space.Host.ExecutingObject.Renderer.Enabled = false 


--clicking this object will make it disappear/reappear

thisGameObject = Space.Host.ExecutingObject


OnClick = function()
thisGameObject.Renderer.Enabled = not thisGameObject.Renderer.Enabled
end

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


Material

SMaterial Material { get; set; }

Get/Set the material instantiated to the renderer.

Space.Host.ExecutingObject.Renderer.Material.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)


Materials[]

SMaterial Materials[] { get; set; }

Get/Set all materials instantiated to the renderer.

mats = Space.Host.ExecutingObject.Renderer.Materials



SharedMaterial

SMaterial SharedMaterial { get; set; }

Get/Set the shared material used by the renderer.

Refer to member Material.


SharedMaterials[]

SMaterial SharedMaterials[] { get; set; }

Get/Set all shared materials used by the renderer.

Refer to member Materials.