- Jail phone pickupability syncs better, though still not perfectly.
- Ownership of game objects now transfers on game mode initialisation.
This commit is contained in:
parent
f34a7b6147
commit
7e9f16c493
@ -551,7 +551,7 @@ MonoBehaviour:
|
||||
ThrowVelocityBoostMinSpeed: 1
|
||||
ThrowVelocityBoostScale: 1
|
||||
currentlyHeldBy: {fileID: 0}
|
||||
pickupable: 1
|
||||
pickupable: 0
|
||||
proximity: 0.5
|
||||
--- !u!114 &7664069034163716319
|
||||
MonoBehaviour:
|
||||
@ -582,7 +582,7 @@ MonoBehaviour:
|
||||
lateLooper: {fileID: 637467565593588835}
|
||||
rigid: {fileID: 4575308875957934130}
|
||||
pickup: {fileID: 3019992558134816461}
|
||||
respawnHeight: -10
|
||||
respawnHeight: -1.5
|
||||
smoothingTime: -0.25
|
||||
allowTheftFromSelf: 1
|
||||
allowTheftWhenAttachedToPlayer: 1
|
||||
|
||||
@ -79507,6 +79507,16 @@ PrefabInstance:
|
||||
value:
|
||||
objectReference: {fileID: 7348467109636049180, guid: 60bb1d81845055844877bdeecb84a129,
|
||||
type: 3}
|
||||
- target: {fileID: 7664069034163716319, guid: 60bb1d81845055844877bdeecb84a129,
|
||||
type: 3}
|
||||
propertyPath: lastPickupable
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7664069034163716319, guid: 60bb1d81845055844877bdeecb84a129,
|
||||
type: 3}
|
||||
propertyPath: pickupableFlag
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7664069034163716319, guid: 60bb1d81845055844877bdeecb84a129,
|
||||
type: 3}
|
||||
propertyPath: serializationData.Prefab
|
||||
|
||||
@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 24
|
||||
Data: 23
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@ -1379,19 +1379,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _HostOwner
|
||||
Data: _CaseFileDictionary
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _HostOwner
|
||||
Data: _CaseFileDictionary
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 90|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
|
||||
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@ -1428,60 +1428,6 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _CaseFileDictionary
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 92|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _CaseFileDictionary
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 93|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 93
|
||||
- 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: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 94|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
|
||||
@ -60,8 +60,6 @@ public class CaseManager : UdonSharpBehaviour
|
||||
|
||||
[UdonSynced] private string[] _CurrentWinningPlayers = new string[3];
|
||||
|
||||
private VRCPlayerApi _HostOwner;
|
||||
|
||||
private DataDictionary _CaseFileDictionary;
|
||||
|
||||
|
||||
@ -77,8 +75,6 @@ public class CaseManager : UdonSharpBehaviour
|
||||
|
||||
public override void OnOwnershipTransferred(VRCPlayerApi Player)
|
||||
{
|
||||
_HostOwner = Player;
|
||||
|
||||
_Round1Manager.SetOwnershipOfObjects(Player);
|
||||
_Round2Manager.SetOwnershipOfObjects(Player);
|
||||
_Round3Manager.SetOwnershipOfObjects(Player);
|
||||
@ -88,7 +84,7 @@ public class CaseManager : UdonSharpBehaviour
|
||||
|
||||
public VRCPlayerApi GetHostOwner()
|
||||
{
|
||||
return _HostOwner;
|
||||
return Networking.GetOwner(gameObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -97,6 +97,8 @@ public class GameManagerBase : UdonSharpBehaviour
|
||||
|
||||
public virtual void InitialiseGameMode()
|
||||
{
|
||||
SetOwnershipOfObjects(_CaseManager.GetHostOwner());
|
||||
|
||||
_AllowInteractionFromHostCard = true;
|
||||
|
||||
EnablePlayerMicrophone(true);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
using VRC.SDK3.Data;
|
||||
using VRC.SDK3.UdonNetworkCalling;
|
||||
using VRC.SDKBase;
|
||||
|
||||
@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
Data: 4
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@ -182,25 +182,79 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _CurrentOwner
|
||||
Data: _CallHasBeenPlayed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _CurrentOwner
|
||||
Data: _CallHasBeenPlayed
|
||||
- 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: 3
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 14|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: _ObjectSync
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ObjectSync
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 13|System.RuntimeType, mscorlib
|
||||
Data: 16|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
|
||||
Data: MMMaellon.LightSync.LightSync, com.mmmaellon.lightsync
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 13
|
||||
Data: 4
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@ -215,7 +269,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
using MMMaellon.LightSync;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Components;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
|
||||
@ -11,42 +13,53 @@ public class JailPhone : UdonSharpBehaviour
|
||||
[SerializeField] private GameManagerRound2 _GameManager;
|
||||
|
||||
[UdonSynced, FieldChangeCallback(nameof(Activate))] private bool _Activate = false;
|
||||
[UdonSynced] private bool _CallHasBeenPlayed = false;
|
||||
|
||||
private VRCPlayerApi _CurrentOwner;
|
||||
private LightSync _ObjectSync;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
_ObjectSync = GetComponent<LightSync>();
|
||||
}
|
||||
|
||||
public void Initialise()
|
||||
{
|
||||
_CurrentOwner = _GameManager.GetHostOwner();
|
||||
_ObjectSync.TeleportToLocalSpace(Vector3.zero, Quaternion.identity, false);
|
||||
|
||||
transform.localPosition = Vector3.zero;
|
||||
transform.localRotation = Quaternion.identity;
|
||||
Activate = false;
|
||||
_CallHasBeenPlayed = false;
|
||||
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public override void OnPickup()
|
||||
{
|
||||
if (Networking.LocalPlayer != _GameManager.GetHostOwner())
|
||||
{
|
||||
PlayJailCall();
|
||||
}
|
||||
base.OnPickup();
|
||||
}
|
||||
|
||||
public override void OnPickupUseDown()
|
||||
{
|
||||
if (Activate && _CurrentOwner == _GameManager.GetHostOwner())
|
||||
if (Networking.LocalPlayer == _GameManager.GetHostOwner())
|
||||
{
|
||||
PlayJailCall();
|
||||
}
|
||||
base.OnPickupUseDown();
|
||||
}
|
||||
|
||||
public override void OnOwnershipTransferred(VRCPlayerApi Player)
|
||||
{
|
||||
_CurrentOwner = Player;
|
||||
if (Activate && Player != _GameManager.GetHostOwner())
|
||||
{
|
||||
PlayJailCall();
|
||||
}
|
||||
base.OnOwnershipTransferred(Player);
|
||||
}
|
||||
|
||||
|
||||
private void PlayJailCall()
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayJailCall", 0.75f);
|
||||
Activate = false;
|
||||
if (Activate && !_CallHasBeenPlayed)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayJailCall", 0.75f);
|
||||
_CallHasBeenPlayed = true;
|
||||
RequestSerialization();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,9 +70,10 @@ public class JailPhone : UdonSharpBehaviour
|
||||
_Activate = value;
|
||||
if (_Activate)
|
||||
{
|
||||
_CurrentOwner = _GameManager.GetHostOwner();
|
||||
_GameManager.PhoneRing();
|
||||
}
|
||||
_ObjectSync.pickup.pickupable = _Activate;
|
||||
Debug.Log("[JailPhone] Pickupable status is now " + (_ObjectSync.pickup.pickupable ? "true" : "false"));
|
||||
RequestSerialization();
|
||||
}
|
||||
get => _Activate;
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: BoneFollower
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: ccbda9bf23e2f714c9226283c77a92e5,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 52ecc8a73071e8e40928c3609699fcf4,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: InteractToggle
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 405e38d3dfb2f514daeed0e28fbb4864,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 873dfce61b1514e429c92e0d2fded7de,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: PlayerModSetter
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: f938e6c4ff027a74da405a1f9353fd2b,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: e81558796a212ab4d88e305e2010f24b,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: GlobalToggleObject
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: c49c9265a3ef24642a6a4465d0a78872,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 2fe8ced6184000f49bca526cd2c5891c,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: MasterToggleObject
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 04024a76ab1924042ba521e11cb76d91,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: a2d01d9f36ac6df49831be249e48ecc4,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: TrackingDataFollower
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 17f8fbbe6cc186d4f8dbb057b01a4ec2,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 1b89d4552983c0448a7389decec3b555,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: WorldAudioSettings
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 128d924a3066b7546b2d1c73e61006ab,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 994b559b0f158b4499f8937980ed8694,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user