public void SetAbortOnUserInput(GameObject owner, bool value) { if (owner == null) { Log.LogError(this, "Owner is null when trying to abort user input."); return; } int instanceID = owner.GetInstanceID(); if (!sequencerDict.ContainsKey(instanceID)) { return; } State state = sequencerDict[instanceID]; if (state == null) { return; } state.AbortOnUserInput = value; if (!value) { return; } foreach (GameObject target in state.Targets) { PenguinUserControl component = target.GetComponent <PenguinUserControl>(); if (component != null) { component.enabled = true; } } }
protected override void Update() { if (LocomotionHelper.IsCurrentControllerOfType <RunController>(GetTarget())) { RunController component = GetTarget().GetComponent <RunController>(); component.Behaviour = new RunController.ControllerBehaviour { IgnoreTranslation = !Controller, IgnoreCollisions = !Collisions, IgnoreRotation = !Steering, IgnoreGravity = !Gravity }; if (!Gravity) { component.ResetMomentum(); } } PenguinUserControl component2 = GetTarget().GetComponent <PenguinUserControl>(); if (component2 != null) { component2.enabled = UserControls; } Completed(); }
private void sequenceCompleted(State state) { if (state?.Equals(null) ?? true) { return; } foreach (GameObject target in state.Targets) { if (!target.IsDestroyed()) { PenguinUserControl component = target.GetComponent <PenguinUserControl>(); if (component != null) { component.enabled = true; } Animator component2 = target.GetComponent <Animator>(); if (component2 != null) { component2.SetBool(AnimationHashes.Params.Scripted, value: false); } } } if (state.Owner != null && state.Owner.CompareTag("Player")) { Service.Get <EventDispatcher>().DispatchEvent(default(ActionSequencerEvents.ActionSequenceCompleted)); } if (state.Owner != null && !state.Owner.Equals(null) && this.SequenceCompleted != null && this.SequenceCompleted.Target != null && !this.SequenceCompleted.Target.Equals(null)) { this.SequenceCompleted(state.Owner); } }
protected override void Update() { PenguinUserControl component = GetTarget().GetComponent <PenguinUserControl>(); if (component != null) { component.enabled = On; } Completed(); }
public override void OnEnter() { GameObject gameObject = (this.gameObject.OwnerOption == OwnerDefaultOption.UseOwner) ? base.Owner : this.gameObject.GameObject.Value; if (gameObject != null) { PenguinUserControl component = gameObject.GetComponent <PenguinUserControl>(); if (component != null) { component.enabled = EnableControls; } } Finish(); }
private void enablePenguinControl(bool isEnabled) { if (userControl == null) { userControl = penguinObj.GetComponent <PenguinUserControl>(); } if (userControl != null) { userControl.enabled = isEnabled; } else { Log.LogError(this, "No PenguinControl component found"); } enableUIControls(isEnabled); }
private void getReferences() { minigameService = Service.Get <MinigameService>(); eventDispatcher = Service.Get <EventDispatcher>(); questService = Service.Get <QuestService>(); player = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject; locomotionBroadcaster = player.GetComponent <LocomotionEventBroadcaster>(); fishingRod = getChildByName(player, "FishingRodProp(Clone)"); _rodPropLineEndTransform = getChildByName(fishingRod, "string_end_jnt").transform; playerAnimator = player.GetComponent <Animator>(); fishingRodAnimator = fishingRod.GetComponent <Animator>(); prizeDropContainerAnimator = prizeDropContainer.GetComponentInChildren <Animator>(); _bobberAnimator = bobberRootTransform.GetComponentInChildren <Animator>(); GameObject gameObject = GameObject.Find("CinematicFishing"); cinematicCameraFishingController = gameObject.GetComponent <CameraController>(); GameObject gameObject2 = GameObject.Find("CinematicFishingZoom"); cinematicCameraFishingControllerZoom = gameObject2.GetComponent <CameraController>(); for (int i = 0; i < cinematicCameraFishingController.GoalPlanners.Length; i++) { RailDollyGoalPlanner railDollyGoalPlanner = cinematicCameraFishingController.GoalPlanners[i] as RailDollyGoalPlanner; if (railDollyGoalPlanner != null) { _cameraDolly = railDollyGoalPlanner.Dolly; break; } } RailDollyFramer railDollyFramer = cinematicCameraFishingController.Framer as RailDollyFramer; if (railDollyFramer != null) { _cameraDollyFocus = railDollyFramer.Dolly; } userControl = player.GetComponent <PenguinUserControl>(); }