public bool RequestInteraction() { if (AvatarDataHandle.TryGetPlayerHandle(base.gameObject, out var _) && participationData.CurrentParticipationState == ParticipationState.Pending) { ParticipationRequest.Type type = ParticipationRequest.Type.Start; if (participationController.StartParticipation(new ParticipationRequest(type, participationData.ParticipatingGO.Value, "PenguinInteraction"))) { participantReference = participationData.ParticipatingGO; currentActionGraphGameObject = participationData.ParticipatingGO.Value; interactRequest.Set(); return(true); } } return(false); }
protected override void Update() { PropUser component = GetComponent <PropUser>(); ParticipationController component2 = GetComponent <ParticipationController>(); ParticipationState participationState = (ParticipationState)Enum.Parse(typeof(ParticipationState), State); if (component != null && component2 != null) { Competitor <GameObject> currentInteractingParticipantReference = component2.GetCurrentInteractingParticipantReference(); if (component2.IsInteractingWithGameObject(base.gameObject) && participationState == ParticipationState.Pending) { component2.StopParticipation(new ParticipationRequest(ParticipationRequest.Type.Stop, currentInteractingParticipantReference, "SetPlayerParticipationStateAction")); } else if (participationState == ParticipationState.Participating) { component2.StartParticipation(new ParticipationRequest(ParticipationRequest.Type.Start, base.gameObject, "SetPlayerParticipationStateAction")); } } Completed(); }
private void startPropInteraction() { if (PlayerHandle.IsNull || !dataEntityCollection.TryGetComponent <GameObjectReferenceData>(PlayerHandle, out var component)) { return; } Animator component2 = component.GameObject.GetComponent <Animator>(); if (component2 != null) { AnimatorStateInfo animatorStateInfo = LocomotionUtils.GetAnimatorStateInfo(component2, 1); if (!LocomotionUtils.IsHolding(animatorStateInfo)) { component2.Play(AnimationHashes.States.TorsoHold, AnimationHashes.Layers.Torso); } } ParticipationController component3 = component.GameObject.GetComponent <ParticipationController>(); if (component3 != null) { component3.StartParticipation(new ParticipationRequest(ParticipationRequest.Type.Start, Prop.gameObject, "PropUser")); } }