private void onPropUsed() { SpawnedInstance = (IsInstance ? PrefabToSpawn : Object.Instantiate(PrefabToSpawn)); if (ParentToUser) { SpawnedInstance.transform.SetParent(prop.PropUserRef.transform, worldPositionStays: false); } else { SpawnedInstance.transform.position = prop.OnUseDestination; CameraCullingMaskHelper.SetLayerRecursive(SpawnedInstance.transform, "AllPlayerInteractibles"); } SpawnedInstance.InstanceId = prop.ExperienceInstanceId; SpawnedInstance.OwnerId = prop.OwnerId; SpawnedInstance.IsOwnerLocalPlayer = prop.IsOwnerLocalPlayer; SpawnedInstance.PropDef = prop.PropDef; if (HideInitially) { SpawnedInstance.gameObject.SetActive(value: false); } else { SpawnedInstance.StartExperience(); } if (ApplyUserForwardVect) { SpawnedInstance.transform.forward = prop.PropUserRef.transform.forward; } }
private void Awake() { playersToReward = new List <long>(); propExperience = GetComponent <PropExperience>(); propExperience.PropExperienceStarted += onExperienceStarted; dataEntityCollection = Service.Get <CPDataEntityCollection>(); }
private void getPartyGameDefinitionForLocalPlayerPropExperience() { PropExperience componentInChildren = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject.GetComponentInChildren <PropExperience>(); if (componentInChildren == null) { UnityEngine.Object.Destroy(this); } partyGameDefinition = PartyGameUtils.GetPartyGameForTriggerProp(componentInChildren.PropDef.Id); if (partyGameDefinition == null) { UnityEngine.Object.Destroy(this); } }
public void Awake() { serverObjectHandle = DataEntityHandle.NullHandle; originalLayer = base.gameObject.layer; itemRecipientsByPlayerIds = new HashSet <long>(); if (ControlsScreenDefinitionContentKey == null || string.IsNullOrEmpty(ControlsScreenDefinitionContentKey.Key)) { Log.LogError(this, "This item does not have a valid party supplies button layout key"); } propExperience = GetComponent <PropExperience>(); propExperience.PropExperienceStarted += onExperienceStarted; dataEntityCollection = Service.Get <CPDataEntityCollection>(); Service.Get <EventDispatcher>().AddListener <InputEvents.ActionEvent>(onActionEvent); Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionPausedEvent>(onSessionPaused, EventDispatcher.Priority.HIGH); }
private bool isLocalPlayer() { PropExperience component = GetComponent <PropExperience>(); if (component != null) { return(component.IsOwnerLocalPlayer); } Prop component2 = GetComponent <Prop>(); if (component2 != null) { return(component2.IsOwnerLocalPlayer); } return(false); }
private bool isInteractActionValid(object payload) { bool flag = true; GameObject gameObject = (GameObject)payload; if (gameObject != null) { PropExperience componentInChildren = gameObject.GetComponentInChildren <PropExperience>(gameObject); if (componentInChildren != null && componentInChildren.PropDef.ExperienceType == PropDefinition.ConsumableExperience.PartyGameLobby) { flag = false; } if (flag) { AdventureDisabledBehaviourTag componentInChildren2 = gameObject.GetComponentInChildren <AdventureDisabledBehaviourTag>(); if (componentInChildren2 != null) { flag = false; } } } return(flag); }
private void Awake() { propExperience = GetComponent <PropExperience>(); propExperience.PropExperienceStarted += onExperienceStarted; dataEntityCollection = Service.Get <CPDataEntityCollection>(); }