Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from CyanLaser/u#1.0
Browse files Browse the repository at this point in the history
v1.1.0 - U# 1.0 fixes
  • Loading branch information
CyanLaser authored Nov 30, 2022
2 parents f6e751c + 1a5dde1 commit 21179c3
Show file tree
Hide file tree
Showing 28 changed files with 2,242 additions and 4,384 deletions.
1,179 changes: 655 additions & 524 deletions Cyan/PlayerObjectPool/Examples/Example PlayerObjectPool UdonSharp.unity

Large diffs are not rendered by default.

304 changes: 160 additions & 144 deletions Cyan/PlayerObjectPool/Examples/UdonGraph/DemoGraphPooledObject.asset

Large diffs are not rendered by default.

521 changes: 38 additions & 483 deletions Cyan/PlayerObjectPool/Examples/UdonSharp/DemoPoolEventListener.asset

Large diffs are not rendered by default.

33 changes: 8 additions & 25 deletions Cyan/PlayerObjectPool/Examples/UdonSharp/DemoPoolEventListener.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

using JetBrains.Annotations;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

namespace Cyan.PlayerObjectPool
{
public class DemoPoolEventListener : UdonSharpBehaviour
public class DemoPoolEventListener : CyanPlayerObjectPoolEventListener
{
public CyanPlayerObjectAssigner objectPool;
private DemoPooledObject _localPoolObject;
Expand All @@ -28,8 +26,7 @@ public override void Interact()
_localPoolObject._IncreaseValue();
}

[PublicAPI]
public void _OnLocalPlayerAssigned()
public override void _OnLocalPlayerAssigned()
{
Debug.Log("The local player has been assigned an object from the pool!");

Expand All @@ -39,29 +36,15 @@ public void _OnLocalPlayerAssigned()
// Allow the user to interact with this object.
DisableInteractive = false;
}

[PublicAPI, HideInInspector]
public VRCPlayerApi playerAssignedPlayer;
[PublicAPI, HideInInspector]
public int playerAssignedIndex;
[PublicAPI, HideInInspector]
public UdonBehaviour playerAssignedPoolObject;
[PublicAPI]
public void _OnPlayerAssigned()

public override void _OnPlayerAssigned(VRCPlayerApi player, int poolIndex, UdonBehaviour poolObject)
{
Debug.Log($"Object {playerAssignedIndex} assigned to player {playerAssignedPlayer.displayName} {playerAssignedPlayer.playerId}");
Debug.Log($"Object {poolIndex} assigned to player {player.displayName} {player.playerId}");
}

[PublicAPI, HideInInspector]
public VRCPlayerApi playerUnassignedPlayer;
[PublicAPI, HideInInspector]
public int playerUnassignedIndex;
[PublicAPI, HideInInspector]
public UdonBehaviour playerUnassignedPoolObject;
[PublicAPI]
public void _OnPlayerUnassigned()

public override void _OnPlayerUnassigned(VRCPlayerApi player, int poolIndex, UdonBehaviour poolObject)
{
Debug.Log($"Object {playerUnassignedIndex} unassigned from player {playerUnassignedPlayer.displayName} {playerUnassignedPlayer.playerId}");
Debug.Log($"Object {poolIndex} unassigned from player {player.displayName} {player.playerId}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ MonoBehaviour:
m_GameObject: {fileID: 7239175875574932085}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
Expand Down Expand Up @@ -162,12 +162,13 @@ MonoBehaviour:
m_GameObject: {fileID: 7239175876222275329}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
Expand All @@ -194,6 +195,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 7239175876297497478}
- component: {fileID: -653023529802255540}
- component: {fileID: 7239175876297497479}
m_Layer: 0
m_Name: DemoPooledObject (0)
Expand All @@ -217,6 +219,30 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &-653023529802255540
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7239175876297497477}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f2969aff4accf794784b87096b734be0, type: 3}
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
_udonSharpBackingUdonBehaviour: {fileID: 7239175876297497479}
text: {fileID: 7239175876222275331}
value: -1
--- !u!114 &7239175876297497479
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -236,10 +262,11 @@ MonoBehaviour:
SynchronizePosition: 0
AllowCollisionOwnershipTransfer: 0
Reliable: 1
serializedProgramAsset: {fileID: 11400000, guid: f41846773c72e1747849bfbcf5ebe98e,
_syncMethod: 3
serializedProgramAsset: {fileID: 11400000, guid: a567fa5250bc609409cbe68aa8e42c84,
type: 2}
programSource: {fileID: 11400000, guid: f2cca2eb14c80914ea60dcdbe25e0416, type: 2}
serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVg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UwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUCLwQAAAABSwAAAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAC4AVQBkAG8AbgBWAGEAcgBpAGEAYgBsAGUAYAAxAFsAWwBTAHkAcwB0AGUAbQAuAEIAbwBvAGwAZQBhAG4ALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAUAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAS4AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBQAGUAcgBzAGkAcwB0AEQAYQB0AGEARgByAG8AbQBVAHAAZwByAGEAZABlAF8AXwBfACcBBAAAAHQAeQBwAGUAARgAAABTAHkAcwB0AGUAbQAuAEIAbwBvAGwAZQBhAG4ALAAgAG0AcwBjAG8AcgBsAGkAYgArAQUAAABWAGEAbAB1AGUAAQcFBwUHBQ==
publicVariablesUnityEngineObjects:
- {fileID: 7239175876222275331}
publicVariablesSerializationDataFormat: 0
Loading

0 comments on commit 21179c3

Please sign in to comment.