Component:SimpleAvatarProtection: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page SimpleAvatarProtection (Component) to Component:SimpleAvatarProtection: Creating component Namespace
add sync delegate desc
 
(8 intermediate revisions by 5 users not shown)
Line 8: Line 8:


<!--T:2-->
<!--T:2-->
== Intoduction ==
SimpleAvatarProtection prevents other users from wearing an avatar or saving it.
SimpleAvatarProtection prevents other users from wearing an avatar or saving it.


Line 15: Line 13:
== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|User|User|The user who is permitted to use the avatar.
|User|{{RootFieldType|CloudUserRef}}|TypeAdv0=true|The user who is permitted to use the avatar.
|_userId|String|Internal
|ReassignUserOnPackageImport|Bool| See [[ResonitePackage#Simple_Avatar_Protection_handling]].
}}
 
== Sync Delegates ==
{{Table ComponentTriggers
|OnRemoveSingleInstance:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Removes this component as long as the activating user is allowed to do so.
|OnRemoveAllInstances:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Removes components in the hiearchy as long as the activating user is allowed to do so.
}}
}}


Line 24: Line 28:
When attached anywhere on an avatar, the SimpleAvatarProtection component prevents all users, other than the single user listed on the component, from saving the avatar, grabbing materials off of it, or equipping it.
When attached anywhere on an avatar, the SimpleAvatarProtection component prevents all users, other than the single user listed on the component, from saving the avatar, grabbing materials off of it, or equipping it.


The component is automatically attached to an avatar if "Protect Avatar" is checked when creating it.
The component is automatically attached to an avatar if "Protect Avatar" is checked in the [[Avatar Creator]] when creating it.


All instances of SimpleAvatarProtection on an avatar can be removed ''by its owner'' by clicking the "Remove All Instances" button. No other user can remove the component. This is useful if you are trying to clear protection from an avatar, but cannot remember where the component was; you can simply add another instance and remove them all at once.
All instances of SimpleAvatarProtection on an avatar can be removed ''by its owner'' by clicking the "Remove All Instances" button. No other user can remove the component. This is useful if you are trying to clear protection from an avatar, but cannot remember where the component was; you can simply add another instance and remove them all at once.


</translate>
</translate>
[[Category:Components{{#translation:}}|SimpleAvatarProtection (Component){{#translation:}}]]
[[Category:Components{{#translation:}}|Simple Avatar Protection]]
[[Category:ComponentStubs]]
[[Category:Components:Users:Common Avatar System{{#translation:}}|Simple Avatar Protection]]
[[Category:Components:Users:Common Avatar System{{#translation:}}|SimpleAvatarProtection (Component){{#translation:}}]]

Latest revision as of 18:00, 8 April 2025

Component image 
SimpleAvatarProtection component as seen in the Scene Inspector


SimpleAvatarProtection prevents other users from wearing an avatar or saving it.

Usage

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. Some components stop their functionality when this field is disabled, but some don't.
User direct CloudUserRef The user who is permitted to use the avatar.
ReassignUserOnPackageImport Bool See ResonitePackage#Simple_Avatar_Protection_handling.

Sync Delegates

Triggers
Method Name Method type and Arguments. Is the method hidden? Description
OnRemoveSingleInstance:ButtonEventHandler ButtonEventHandler Removes this component as long as the activating user is allowed to do so.
OnRemoveAllInstances:ButtonEventHandler ButtonEventHandler Removes components in the hiearchy as long as the activating user is allowed to do so.

Behavior

When attached anywhere on an avatar, the SimpleAvatarProtection component prevents all users, other than the single user listed on the component, from saving the avatar, grabbing materials off of it, or equipping it.

The component is automatically attached to an avatar if "Protect Avatar" is checked in the Avatar Creator when creating it.

All instances of SimpleAvatarProtection on an avatar can be removed by its owner by clicking the "Remove All Instances" button. No other user can remove the component. This is useful if you are trying to clear protection from an avatar, but cannot remember where the component was; you can simply add another instance and remove them all at once.