Example #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name.ToUpper().Contains("PLAYER"))
     {
         PlayerGameMechanics playerGameMechanics = other.gameObject.GetComponent(typeof(PlayerGameMechanics)) as PlayerGameMechanics;
         playerGameMechanics.StartMonsterSpawn();
     }
 }
Example #2
0
    protected virtual void AttackPlayer()
    {
        PlayerGameMechanics playerGameMechanics = player.GetComponent <PlayerGameMechanics>();

        playerGameMechanics.AttackedByMonster(gameObject);

        // Remove this game object
        Destroy(gameObject);
    }
Example #3
0
    public void EndDialogue()
    {
        PlayerGameMechanics playerGameMechanics = player.GetComponent(typeof(PlayerGameMechanics)) as PlayerGameMechanics;

        playerGameMechanics.UnpauseGame();

        theButton.GetComponent <CanvasGroup>().alpha = 0.00f;
        box.GetComponent <CanvasGroup>().alpha       = 0.00f;
        nameText.text     = "";
        dialogueText.text = "";
    }
Example #4
0
    /// <summary>
    /// This method removes the game object. It's a separate method in case we want to add animation later
    /// </summary>
    protected virtual void KillMonster()
    {
        // Let the player object know that there is one fewer monsters
        PlayerGameMechanics playerGameMechanics = player.GetComponent(typeof(PlayerGameMechanics)) as PlayerGameMechanics;

        playerGameMechanics.KillMonster(gameObject);

        //stops particle system
        StopEctoplasm();
        // Remove this game object
        Destroy(gameObject);
    }
Example #5
0
 void PausedInput()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         PlayerGameMechanics playerGameMechanics = player.GetComponent(typeof(PlayerGameMechanics)) as PlayerGameMechanics;
         playerGameMechanics.TogglePause();
     }
     if (Input.GetKeyDown(KeyCode.Return))
     {
         GetComponent <DialogueManager>().theButton.onClick.Invoke();
         //GetComponent<SceneManager>().GetComponent<DialogueManager>().DisplayNextSentence();
     }
 }
Example #6
0
    public void StartDialogue(Dialogue dialogue)
    {
        theButton.GetComponent <CanvasGroup>().alpha = 1.00f;
        box.GetComponent <CanvasGroup>().alpha       = 1.00f;
        nameText.text = dialogue.nameT;

        PlayerGameMechanics playerGameMechanics = player.GetComponent(typeof(PlayerGameMechanics)) as PlayerGameMechanics;

        playerGameMechanics.PauseGame();

        sentences.Clear();

        foreach (string s in dialogue.sentences)
        {
            sentences.Enqueue(s);
        }
        DisplayNextSentence();
    }