Exemple #1
0
    IEnumerator TriggerDialogueDelay(DialogueSystemTrigger _trigger, float _delayTime)
    {
        yield return(new WaitForSeconds(_delayTime));

        Debug.Log("delay");
        playerController.StopPlayer();
        Debug.Log("Stopped player");
        _trigger.OnUse();
        Debug.Log($"Triggered convo: {_trigger.gameObject.name}");
    }
Exemple #2
0
    private void TriggerFirstDialogue()
    {
        introduction0.OnUse();
        introduction0.GetComponent <DialogueSystemEvents>().conversationEvents.onConversationEnd.AddListener(delegate { TriggerDialogue(introduction1); });


        introduction1.GetComponent <DialogueSystemEvents>().conversationEvents.onConversationEnd.AddListener(delegate {
            if (DialogueLua.GetVariable("endTutorial").asBool == false)
            {
                playerController.UnstopPlayer(); introductionConvoOver = true; StartCoroutine(TriggerDialogueDelay(stop, 5));
            }
        });
    }
    public GameObject OnSwipe()
    {
        if (DialogueManager.isConversationActive)
        {
            return(this.gameObject);
        }

        if (hasUserSwiped == true)
        {
            return(this.gameObject);
        }

        lastSwipeDirection = TouchManager.instance.lastSwipe;
        Debug.Log($"Last swipe was {lastSwipeDirection}");

        switch (lastSwipeDirection)
        {
        case SwipeDirection.Up:
            DialogueLua.SetVariable("Swipe Up", true);
            hasUserSwiped = true;
            break;

        case SwipeDirection.Down:
            DialogueLua.SetVariable("Swipe Down", true);
            hasUserSwiped = true;
            break;

        case SwipeDirection.Left:
            DialogueLua.SetVariable("Swipe Left", true);
            hasUserSwiped = true;
            break;

        case SwipeDirection.Right:
            DialogueLua.SetVariable("Swipe Right", true);
            hasUserSwiped = true;
            break;

        case SwipeDirection.None:
            Debug.Log("Nothing was swiped");
            break;

        default:
            break;
        }

        systemTrigger.OnUse();
        return(this.gameObject);
    }
Exemple #4
0
 public void EndGameFromFailure()
 {
     countdownTimerIsActive = false;
     playerHasQuest         = false;
     playerHasDelivery      = false;
     // Enable/Disable gameobjects
     NoQuestActiveGameObjects();
     // Play game over convo
     if (gameOverConvo != null)
     {
         gameOverConvo.OnUse();
     }
     else
     {
         EndGame();
     }
 }
Exemple #5
0
    public void EndQuestFromFailure()
    {
        // Enable/Disable gameobjects
        NoQuestActiveGameObjects();
        if (failedDeliveryConvo != null)
        {
            failedDeliveryConvo.OnUse();
        }
        GameObject.FindObjectOfType <PlayerUIManager>().SubtractLiveStar();

        bossQuestIsActive      = false;
        countdownTimerIsActive = false;
        playerHasQuest         = false;
        playerHasBossQuest     = false;
        playerHasDelivery      = false;
        playerHasBossDelivery  = false;
        DialogueLua.SetVariable("BossQuestIsActive", false);
        //SubXpToPlayerLevelingSystem(currentPlayerDifficulty);
        CalculatePlayersCurrentDifficulty();
        currentPlayerFailedQuests         -= 1;
        currentPlayerCollisionsPerDelivery = maxPlayerCollisionsPerDelivery;
    }
Exemple #6
0
 public virtual GameObject OnTouch()
 {
     systemTrigger.OnUse();
     
     return this.gameObject;
 }
Exemple #7
0
 private void TriggerDialogue(DialogueSystemTrigger _trigger)
 {
     playerController.StopPlayer();
     _trigger.OnUse();
 }
 public void OnRayHit()
 {
     _Trigger.OnUse();
 }
Exemple #9
0
 private void StartConversation()
 {
     dialogueSystemTrigger.OnUse();
 }