Component:SimpleAwayIndicator: Difference between revisions

From Resonite Wiki
Automated: update Fields, Categories
Added a bit more info about this component.
 
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=SimpleAwayIndicatorComponent.png
|Image=SimpleAwayIndicatorComponent.png
Line 9: Line 8:


<!--T:2-->
<!--T:2-->
== Intoduction ==
The '''SimpleAwayIndicator''' indicates when a user doesn't have the session focused by temporarily replacing the [[Material|materials]] of a [[Component:MeshRenderer|MeshRenderer]] with the specified ''Away Material''.
 
Usually found on the body [[Slot|slot]] of an [[Avatar|avatar]] (but can be put anywhere in the [[World|world]]), this just needs a [[Reference Type|reference]] to the [[Component:MeshRenderer|MeshRenderer]] or [[Component:SkinnedMeshRenderer|SkinnedMeshRenderer]] components to work.


<!--T:3-->
<!--T:3-->
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|User|User|
|User|User|User whose away state will be watched. ''On avatars, may be set by an [[Component:AvatarUserReferenceAssigner|AvatarUserReferenceAssigner]] component.''
|AwayMaterial|{{RootFieldType|AssetRef`1|[[Type:Material|Material]]}}|TypeAdv1=true|
|AwayMaterial|{{RootFieldType|AssetRef`1|[[Type:Material|Material]]}}|TypeAdv1=true|Material to display when the user is away.
|Renderer|'''[[Component:MeshRenderer|MeshRenderer]]'''|TypeAdv2=true|
|Renderer|'''[[Component:MeshRenderer|MeshRenderer]]'''|TypeAdv2=true|Mesh renderer component whose materials should be replaced
|_oldMaterials|{{RootFieldType|SyncAssetList`1|[[Type:Material|Material]]}}|TypeAdv3=true|
|_oldMaterials|{{RootFieldType|SyncAssetList`1|[[Type:Material|Material]]}}|TypeAdv3=true|Backup of the renderer's original material list. ''Written automatically when "Away" state is triggered.''
}}
}}


{{Table ComponentMethods
|SetAway()||Stores the renderer's material list in <code>_oldMaterials</code> and replaces them with the <code>AwayMaterial</code>.
|Restore()||Restores the renderer's materials from <code>_oldMaterials</code>.
}}
<!--T:4-->
<!--T:4-->
== Behavior ==
== Usage ==
This is used to make a customized or fancier way of stating that you are focused away into another [[World|world]].


<!--T:5-->
<!--T:5-->
Line 30: Line 35:
</translate>
</translate>
[[Category:Components{{#translation:}}|Simple Away Indicator]]
[[Category:Components{{#translation:}}|Simple Away Indicator]]
[[Category:ComponentStubs]]
[[Category:Components:Users{{#translation:}}|Simple Away Indicator]]
[[Category:Components:Users{{#translation:}}|Simple Away Indicator]]

Latest revision as of 05:56, 6 October 2024

Component image 
SimpleAwayIndicator component as seen in the Scene Inspector


The SimpleAwayIndicator indicates when a user doesn't have the session focused by temporarily replacing the materials of a MeshRenderer with the specified Away Material.

Usually found on the body slot of an avatar (but can be put anywhere in the world), this just needs a reference to the MeshRenderer or SkinnedMeshRenderer components to work.

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
User User User whose away state will be watched. On avatars, may be set by an AvatarUserReferenceAssigner component.
AwayMaterial Material Material to display when the user is away.
Renderer MeshRenderer Mesh renderer component whose materials should be replaced
_oldMaterials list of Material Backup of the renderer's original material list. Written automatically when "Away" state is triggered.
Methods
Method Parameters Description
SetAway() none Stores the renderer's material list in _oldMaterials and replaces them with the AwayMaterial.
Restore() none Restores the renderer's materials from _oldMaterials.

Usage

This is used to make a customized or fancier way of stating that you are focused away into another world.

Examples

Related Components