public void CheckSuccessCase()
 {
     if (CheckTriggersAllOccupied())
     {
         Script_PuzzlesEventsManager.PuzzleSuccess(null);
     }
 }
コード例 #2
0
    public override void CompleteState()
    {
        base.CompleteState();

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

        Script_PuzzlesEventsManager.PuzzleSuccess(PuzzleId);

        isDone = true;
    }
コード例 #3
0
    public override void CompleteState()
    {
        if (IsDone)
        {
            return;
        }

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

        IsDone = true;
    }
コード例 #4
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();
                }
            }
        }
    }