/// <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 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);
        }
    }
Exemplo n.º 3
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
                    );
            }
        }
    }
    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();
                }
            }
        }
    }