コード例 #1
0
 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;
     }
 }
コード例 #2
0
 private void Awake()
 {
     playersToReward = new List <long>();
     propExperience  = GetComponent <PropExperience>();
     propExperience.PropExperienceStarted += onExperienceStarted;
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);
 }
コード例 #5
0
    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);
    }
コード例 #6
0
        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);
        }
コード例 #7
0
 private void Awake()
 {
     propExperience = GetComponent <PropExperience>();
     propExperience.PropExperienceStarted += onExperienceStarted;
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
 }