コード例 #1
0
 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);
 }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: PropUser.cs プロジェクト: smdx24/CPI-Source-Code
        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"));
            }
        }