Sticky Notes
This addon provides a ready to use sticky notes dispenser.
A pen can be used to modify the sticky note texture, and each sticky note can be snapped to a magnetic surface.
The drawing itself is handled by the TextureDrawing addon, while the sticky aspect is dealed with the Magnets addon
StickyNoteDispenser
StickyNoteDispenser
is in charge to spawn a sticky note prefab when the user grab/ungrab the sticky note sample (uneditable) located on the dispenser.
It is a subclass of the XRShared GrabbablePrefabSpawner
class, that spawns an object when a reference grabbable is moved far enough.
It overrides the Awake()
& ResetReferencePose()
methods in to order to call the MoveStickyNote()
function when a sticky note is spawned, to animate the reference grabbable after it returns to its default position, to give the impression a new post-it is printed.
StickyNoteColorSelection
StickyNoteColorSelection
is in charge of synchronizing the sticky note background color. It is a subclass of the XRShared's GrabbableColorSelection
class, that is a generic purpose color changing and synchronization class.
This class stores the color in the networked variable CurrentColor
.
The CheckColorModification()
method is called during the FixedUpdateNetwork()
to check if the local user used the joystick to change the sticky note color.
In this case, ChangeColor()
updates the networked variable CurrentColor
.
So, OnColorChanged()
is called on all players thanks to the ChangeDetector
.
Then, the ApplyColorChange()
override here updates the sticky note texture.
The default sticky note color will be the first of the colorList
.
StickyNote prefab
In addition to the usual components required for a networked grabbable object, this prefab contains :
StickyNoteColorSelection
to manage the sticky note color,MagnetPoint
from theMagnets
addon to stick the note on a magnetic surface,TextureDrawing
&TextureSurface
to manage the sticky note texture,LayerSetter
&Blocking surface
on theDrawerContactzone
object to set the layer and prevent the pencil from passing through the note
For a more complex prefab with a text layer, take a look at the Meeting sample.
Dependencies
- TextureDrawing addon
- BlockingContact addon
- Magnets addon
Demo
A demo scene can be found in the Assets\Photon\FusionAddons\StickyNotes\Demo\Scenes\
folder.
Download
This addon latest version is included into the Industries addon project
It is also included into the free XR addon project
Supported topologies
- shared mode
Changelog
- Version 2.0.1: Prefab update for compatibility with Sticky notes samples
- Version 2.0.0: First release