SyncItemCollection
Jump To Parameters
Jump To Function Definitions
Parameter Definitions
Select the parameter name from below to jump directly to it on this page.
OnPressActionInput
OnSceneEnterUpdate
holder
onPressActionDelay
onPressActionInputWithTarget
references
resourcesPrefab
skipStartCheck
syncCreateDestroy
syncCrossScenes
OnPressActionInput
UnityEvent, called when you press the action button.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | UnityEvent | None |
OnSceneEnterUpdate
UnityEvent, call when you first enter a room and the
DoScenesReplay“
from the NetworkManager indicates this object has had actions performed on it “
by another player previously.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | UnityEvent | None |
holder
This is only important if "syncCrossScenes" is true. \n\nThe object you want to track “
the position of. When trying to sync this item across the scene it uses it’s name and this “
holder position to try and figure out what object to update.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | Transform | null |
onPressActionDelay
This should be copied exactly from vItemCollection.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | None |
onPressActionInputWithTarget
UnityEvent, called when you press the action button with a gameobject.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | OnDoActionWithTarget | None |
references
The list of items this object has.
| Exposed Value | Type | Default Value |
|---|---|---|
| None | List |
new List |
resourcesPrefab
Only matters if "Sync Cross Scenes" is true.\n\n”
The prefab name in the resources folder that corresponds to this object. Must be exact in “
order to spawn from the resources folder.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | string | null |
skipStartCheck
If false, will check to make sure this has been instantiated with item data via the network call. “
If not it will destroy itself in favor of another ItemCollection. Enable this ONLY if you DON’T dynamically “
add items to the ItemCollection component.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | false |
syncCreateDestroy
Only matters if "Sync Cross Scenes" is true.\n\n”
Enable if this object is dynamically added to the scene. Will instantiate/destroy this object across “
Unity Scenes and for all networked players.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | false |
syncCrossScenes
Whether or not you want this to be a globally updated item. (EX: If a player “
in scene 1 collects this then when other players enter this scene they will see “
this as already collected.)
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | true |
Function Definitions
Select the function name from below to jump directly to it on this page.
ChatBoxBroadCastCollect
Collect
Collect
E_OnPressAction
EnableVItemCollection
ItemWrapper
SceneCollected
Start
UpdateDatabase
UpdateScenesDatabase
public virtual void ChatBoxBroadCastCollect()
Sends data via the data channel in the chatbox to everyone in the session to tell them that this item has been collected when they entire this unity scene.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
public virtual void Collect()
This is designed to be called from the vItemCollection OnPress* UnityEvent. This calls
NetworkCollectRPC and broadcasts the collect command via the Chatbox to all those in the session (viaChatBoxBroadCastCollectfunction).
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
public virtual void Collect(GameObject target = null)
This is designed to be called from the vItemCollection OnPress* UnityEvent. This calls
NetworkCollectRPC and broadcasts the collect command via the Chatbox to all those in the session (viaChatBoxBroadCastCollectfunction).
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
protected virtual IEnumerator E_OnPressAction(GameObject target = null, bool sendNetwork = true)
Used to call the
NetworkDestroySelfRPC, which destroys this object for everyone currently in the scene and everyone going to enter this scene.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True |
| Parameter Name | Description |
|---|---|
| target | *No found decription |
| sendNetwork | *No found decription |
public virtual void EnableVItemCollection(bool isEnabled)
Enables/Disables the
vItemCollectioncomponent on this object.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| isEnabled | *No found decription |
ItemWrapper wrapper = new ItemWrapper(items);
Takes a list of
ItemReference’s and serializes that list and returns it.
| Expose Value | Overrideable | Returns |
|---|---|---|
| private | False | A serialized version of the input list |
| Parameter Name | Description |
|---|---|
| items | List |
public virtual void SceneCollected()
Calls the
NetworkSceneCollectedRPC for everyone. This calls theE_OnPressActionfunction for everyone.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
protected virtual void Start()
Wehn first started will check to see if this has been instantiated from the owning player with item data. If not it will destroy this object because it was instantiated from Invector and not photon. This is to prevent duplicates appearing for the player that originally dropped this.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void UpdateDatabase(List items)
Takes a serialized List
and converts it back to a list from a string. Calls the `UpdateScenesDatabase` IEnumerator function. This will send the item update information over the ChatBox data channel so others entering this scene will see the updates to this list of items.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | returns the original List |
| Parameter Name | Description |
|---|---|
| serializedItems | *No found decription |
| items | List |
protected virtual IEnumerator UpdateScenesDatabase(List items)
Send this item and its item list to all other players in the session so when they join this scene they will have an up to date accurate item in the scene. Done via sending this information over the data channel on the chatbox.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| items | List |