public void CheckSuccessCase()
 {
     if (CheckTriggersAllOccupied())
     {
         Script_PuzzlesEventsManager.PuzzleSuccess(null);
     }
 }
    public void FloorSwitch2Up(bool isInitialize = false)
    {
        // Avoid calling this On Disable for ReliableStayTriggers.
        if (!gameObject.activeInHierarchy)
        {
            return;
        }

        if (IsDone || isWallsMoving)
        {
            return;
        }

        isWallsMoving = true;

        if (!isInitialize)
        {
            game.ChangeStateCutScene();
        }

        Script_PuzzlesEventsManager.ClearDoorways();

        if (isInitialize)
        {
            FastForwardTransform(3);
        }
        else
        {
            StartCoroutine(WaitToPuzzleTransformTimeline(3));
        }
    }
Ejemplo n.º 3
0
    public override void CompleteState()
    {
        base.CompleteState();

        Debug.Log($"PUZZLE COMPLETE!!!!!!!!!!!!!!!!!!!!!!!!");

        Script_PuzzlesEventsManager.PuzzleSuccess(PuzzleId);

        isDone = true;
    }
 /// <summary>
 /// called by trigger, if was the last trigger to be activated, give a more
 /// dramatic indication of progress (that player is done, just need to verify)
 /// </summary>
 /// <param name="Id">trigger Id</param>
 /// <param name="other">trigger collider obj</param>
 public override void TriggerActivated(string Id, Collider other)
 {
     if (CheckTriggersAllOccupied())
     {
         Script_PuzzlesEventsManager.PuzzleProgress2();
     }
     else
     {
         Script_PuzzlesEventsManager.PuzzleProgress();
     }
 }
    public override void CompleteState()
    {
        if (IsDone)
        {
            return;
        }

        Debug.Log("PUZZLE IS DONE!!!!!!!!! BOTH TARGETS ON PLATFORM");
        Script_PuzzlesEventsManager.PuzzleSuccess(PuzzleId);

        IsDone = true;
    }
    public void FloorSwitch2Down()
    {
        if (IsDone || isWallsMoving)
        {
            return;
        }

        isWallsMoving = true;

        game.ChangeStateCutScene();
        Script_PuzzlesEventsManager.ClearDoorways();

        StartCoroutine(WaitToPuzzleTransformTimeline(2));
    }
    public void OnPuzzleComplete(string arg)
    {
        Script_PuzzlesEventsManager.PuzzleProgress();

        isDone = true;

        game.ChangeStateCutScene();
        game.DisableExits(false, 0);

        float defaultFastFadeTime = Script_AudioEffectsManager.GetFadeTime(FadeSpeeds.Fast);

        StartCoroutine(
            Script_AudioMixerFader.Fade(
                audioMixer,
                Const_AudioMixerParams.ExposedBGVolume,
                beforeShakeFadeOutMusicTime,
                0f,
                () => { game.StopBgMusic(); }
                )
            );

        // Bind Player & Player Ghost to the Retreat Timeline & play.
        Script_Player player = Script_Game.Game.GetPlayer();

        playerObjsToBind.Clear();

        // Player Transform Track
        playerObjsToBind.Add(player.gameObject);
        // Player Signal Receiver Track
        playerObjsToBind.Add(player.gameObject);

        playerPlayableDirector.BindTimelineTracks(playerRetreatTimeline, playerObjsToBind);

        StartCoroutine(WaitForExplosionCutScene());

        // Zoom camera back in.
        IEnumerator WaitForExplosionCutScene()
        {
            Script_VCamManager.VCamMain.SwitchToMainVCam(staticZoomOutVCam);

            yield return(new WaitForSeconds(zoomBackInTime));

            // play manually do to dynamic handling of Player timeline via Script_TimelineController
            GetComponent <Script_TimelineController>().PlayableDirectorPlayFromTimelines(0, 0);

            playerPlayableDirector.Play(playerRetreatTimeline);
        }
    }
    // ------------------------------------------------------------------
    // Trigger Unity Events
    public void FloorSwitchDown()
    {
        // If puzzle is done, the Labyrinth should be gone.
        if (IsDone || isWallsMoving)
        {
            return;
        }

        isWallsMoving = true;

        game.ChangeStateCutScene();
        // Send event to clear doorways in case a Player/Puppet is blocking a door.
        Script_PuzzlesEventsManager.ClearDoorways();

        StartCoroutine(WaitToPuzzleTransformTimeline(0));
    }
Ejemplo n.º 9
0
    public override void TriggerActivated(string Id, Collider other)
    {
        Debug.Log($"Activating with collectible {Id}; collider {other}");

        /// If it's a success case, we'll handle the season change here instead
        /// to be sure to prevent any race cases
        if (CheckSuccessCase())
        {
            // Success by moving pushable Rock
            if (Id == rockTrigger.Id)
            {
                // pass the rock trigger Id
                Script_PuzzlesEventsManager.PuzzleSuccess(Id);
            }
            // Success by dropping a stone
            else
            {
                // otherwise give the season stone Id to know which season to change to
                if (other.transform.parent.GetComponent <Script_CollectibleObject>() != null)
                {
                    Script_PuzzlesEventsManager.PuzzleSuccess(
                        other.transform.parent
                        .GetComponent <Script_CollectibleObject>().Item.id
                        );
                }
            }
        }
        /// Feedback for Rock Pushable
        else if (Id == rockTrigger.Id)
        {
            Script_PuzzlesEventsManager.PuzzleProgress();
        }
        /// Change the season based on the season stone dropped, but ONLY if it'll lead to solution
        else if (CheckForSeasonsChange())
        {
            // change garden sprite & SFX
            if (other.transform.parent.GetComponent <Script_CollectibleObject>() != null)
            {
                LB20.ChangeSeason(
                    other.transform.parent
                    .GetComponent <Script_CollectibleObject>().Item.id
                    );
            }
        }
    }
Ejemplo n.º 10
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == Const_Tags.Player)
        {
            ResetSFX();

            if (
                myLevelBehavior != null &&
                myLevelBehavior.HasProp(completionProperty) &&
                myLevelBehavior.GetProp <bool>(completionProperty)
                )
            {
                return;
            }

            Debug.Log("Reset trigger firing event.");
            Script_PuzzlesEventsManager.PuzzleReset();
        }
    }
    private void TrackTriggerActivation(string triggerId, string pushableId)
    {
        for (int i = 0; i < activatedTriggersIds.Length; i++)
        {
            // fill in the next available trigger slot
            // also add pushableId to List
            if (activatedTriggersIds[i] == null)
            {
                activatedTriggersIds[i] = triggerId;
                activatedPushableIds.Add(pushableId);

                // we're filling in last trigger
                if (i == activatedTriggersIds.Length - 1)
                {
                    print($"Delay between syncing was: {timeBuffer - time}");
                    StopTracking();
                    currentSuccessCount--;

                    ProgressSFX();

                    // notify subscribers of success or progress
                    if (currentSuccessCount == 0)
                    {
                        print("NOTIFY SUCCESS PUZZLE COMPLETE!!!!!!!!!!!!!!!!!!!!!");
                        isComplete = true;
                        Script_PuzzlesEventsManager.PuzzleSuccess(null);
                    }
                    else
                    {
                        print("NOTIFY PUZZLE PROGRESS!");
                        Script_PuzzlesEventsManager.PuzzleProgress();
                    }
                }
                // it's not the last trigger so it's not a progress case
                else
                {
                    NonprogressSFX();
                }
            }
        }
    }