private bool onLocalPlayerSpawned(PlayerSpawnedEvents.LocalPlayerSpawned evt) { if (LocalPlayerPropUser == null) { LocalPlayerPropUser = evt.LocalPlayerGameObject.GetComponent <PropUser>(); } SessionIdData component = dataEntityCollection.GetComponent <SessionIdData>(evt.Handle); if (component != null) { userIdToPropUser[component.SessionId] = LocalPlayerPropUser; DHeldObject heldObject = dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityCollection.LocalPlayerHandle).HeldObject; if (heldObject != null && heldObject.ObjectId != null) { onPlayerPropRetrieved(heldObject.ObjectId, GetPropDefinition(heldObject.ObjectId).PropAssetContentKey, component.SessionId); } loadExistingPlayerHeldExperiences(component.SessionId); loadExistingWorldExperiences(); if (dataEntityCollection.TryGetComponent <PropToBeRestoredData>(evt.Handle, out var component2)) { LocalPlayerRetrieveProp(component2.PropId); dataEntityCollection.RemoveComponent <PropToBeRestoredData>(evt.Handle); } } return(false); }
private bool onLevelUp(RewardServiceEvents.LevelUp evt) { if (!base.gameObject.IsDestroyed() && avatarDataHandle != null && !avatarDataHandle.Handle.IsNull) { SessionIdData component = dataEntityCollection.GetComponent <SessionIdData>(avatarDataHandle.Handle); if (component != null && evt.SessionId == component.SessionId) { base.gameObject.AddComponent <LevelUpParticlesRemote>(); } } return(false); }