- Jail phone now also uses standard VRCObjectSync.
- Live indicator placard no longer has a grabbable component. - Choice cards now have their LightSync components inside their prefabs.
This commit is contained in:
@@ -431,7 +431,7 @@ public class GameManagerRound2 : GameManagerBase
|
||||
BetweenRoundsInterface.HeaderUI.text = "Phone Call: " + _CaseManager.GetCrookName();
|
||||
BetweenRoundsInterface.CommentUI.text = "- You and I are going to " + _CaseManager.ContinentToString(_CaseManager.GetFinalRoundContinent());
|
||||
|
||||
_JailPhone.Activate(true);
|
||||
_JailPhone.Activate(true, _CaseManager.GetCurrentWinningPlayers()[0]);
|
||||
|
||||
_CameraControllerRound2.DeactivateHostWinnerCameraTrigger();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
Data: 4
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -116,13 +116,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _UseDownCallbackFunction
|
||||
Data: _OnPickupCallbackFunction
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _UseDownCallbackFunction
|
||||
Data: _OnPickupCallbackFunction
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
@@ -185,13 +185,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _UseUpCallbackFunction
|
||||
Data: _UseDownCallbackFunction
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _UseUpCallbackFunction
|
||||
Data: _UseDownCallbackFunction
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
@@ -234,6 +234,60 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _UseUpCallbackFunction
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _UseUpCallbackFunction
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
|
||||
@@ -9,10 +9,21 @@ public class PickupUseCallback : UdonSharpBehaviour
|
||||
{
|
||||
[SerializeField] private UdonSharpBehaviour _CallbackObject;
|
||||
[Space]
|
||||
[SerializeField] private string _OnPickupCallbackFunction;
|
||||
[SerializeField] private string _UseDownCallbackFunction;
|
||||
[SerializeField] private string _UseUpCallbackFunction;
|
||||
|
||||
|
||||
public override void OnPickup()
|
||||
{
|
||||
if (_OnPickupCallbackFunction != "" && Utilities.IsValid(_CallbackObject))
|
||||
{
|
||||
_CallbackObject.SendCustomEvent(_OnPickupCallbackFunction);
|
||||
}
|
||||
|
||||
base.OnPickup();
|
||||
}
|
||||
|
||||
public override void OnPickupUseDown()
|
||||
{
|
||||
if (_UseDownCallbackFunction != "" && Utilities.IsValid(_CallbackObject))
|
||||
|
||||
@@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 5
|
||||
Data: 6
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -116,25 +116,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _ObjectSync
|
||||
Data: _PhonePickup
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ObjectSync
|
||||
Data: _PhonePickup
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: MMMaellon.LightSync.LightSync, com.mmmaellon.lightsync
|
||||
Data: VRC.SDK3.Components.VRCPickup, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 4
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -236,10 +236,70 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _CallHasBeenPlayed
|
||||
Data: _CallRecipient
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _CallRecipient
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 16|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 16
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 3
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _CallHasBeenPlayed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _CallHasBeenPlayed
|
||||
@@ -263,13 +323,13 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 17|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
Data: 21|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -293,7 +353,7 @@ MonoBehaviour:
|
||||
Data: _Active_Cached
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _Active_Cached
|
||||
@@ -317,7 +377,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using MMMaellon.LightSync;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Components;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
@@ -11,53 +12,32 @@ using VRC.Udon.Common.Interfaces;
|
||||
public class JailPhone : UdonSharpBehaviour
|
||||
{
|
||||
[SerializeField] private GameManagerRound2 _GameManager;
|
||||
[SerializeField] private LightSync _ObjectSync;
|
||||
[SerializeField] private VRCPickup _PhonePickup;
|
||||
|
||||
[UdonSynced] private bool _Active = false;
|
||||
[UdonSynced] private string _CallRecipient = "";
|
||||
[UdonSynced] private bool _CallHasBeenPlayed = false;
|
||||
|
||||
private bool _Active_Cached = false;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
_ObjectSync = GetComponent<LightSync>();
|
||||
}
|
||||
|
||||
public override void OnDeserialization(DeserializationResult Result)
|
||||
{
|
||||
_Activate_Synced();
|
||||
base.OnDeserialization(Result);
|
||||
}
|
||||
|
||||
public override void OnPickup()
|
||||
public void JailPhonePickedUp()
|
||||
{
|
||||
if (Networking.LocalPlayer != _GameManager.GetHostOwner())
|
||||
{
|
||||
Networking.SetOwner(Networking.LocalPlayer, gameObject);
|
||||
}
|
||||
base.OnPickup();
|
||||
}
|
||||
|
||||
public override void OnPickupUseDown()
|
||||
{
|
||||
if (_GameManager.IsRoundInitialised())
|
||||
{
|
||||
if (Networking.LocalPlayer == _GameManager.GetHostOwner())
|
||||
{
|
||||
PlayJailCall(Networking.LocalPlayer);
|
||||
}
|
||||
}
|
||||
base.OnPickupUseDown();
|
||||
}
|
||||
VRCPlayerApi LocalPlayer = Networking.LocalPlayer;
|
||||
Networking.SetOwner(LocalPlayer, gameObject);
|
||||
|
||||
public override void OnOwnershipTransferred(VRCPlayerApi Player)
|
||||
{
|
||||
if (_GameManager.IsRoundInitialised())
|
||||
if (LocalPlayer.displayName == _CallRecipient)
|
||||
{
|
||||
PlayJailCall(Player);
|
||||
PlayJailCall();
|
||||
}
|
||||
base.OnOwnershipTransferred(Player);
|
||||
|
||||
base.OnPickup();
|
||||
}
|
||||
|
||||
|
||||
@@ -69,13 +49,13 @@ public class JailPhone : UdonSharpBehaviour
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public void Activate(bool Active)
|
||||
public void Activate(bool Active, string CallRecipient = "")
|
||||
{
|
||||
if (_GameManager.IsRoundInitialised())
|
||||
{
|
||||
_Active = Active;
|
||||
_CallRecipient = CallRecipient;
|
||||
_Activate_Synced();
|
||||
_ObjectSync.pickup.pickupable = _Active;
|
||||
RequestSerialization();
|
||||
}
|
||||
}
|
||||
@@ -94,15 +74,17 @@ public class JailPhone : UdonSharpBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
_PhonePickup.pickupable = _Active && (Networking.LocalPlayer == _GameManager.GetHostOwner() || Networking.LocalPlayer.displayName == _CallRecipient);
|
||||
|
||||
_Active_Cached = _Active;
|
||||
}
|
||||
|
||||
|
||||
private void PlayJailCall(VRCPlayerApi Player)
|
||||
private void PlayJailCall()
|
||||
{
|
||||
if (_Active && !_CallHasBeenPlayed)
|
||||
{
|
||||
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.Owner, "FollowPlayerHoldingPhone", Player.displayName);
|
||||
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.Owner, "FollowPlayerHoldingPhone", _CallRecipient);
|
||||
|
||||
SendCustomEventDelayedSeconds(nameof(PlayJailCall_Delayed), 0.75f);
|
||||
_CallHasBeenPlayed = true;
|
||||
|
||||
Reference in New Issue
Block a user