Advertisement
kadyr

Untitled

Sep 24th, 2021
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using Random = UnityEngine.Random;
  6.  
  7. public class NPC : MonoBehaviour
  8. {
  9. [SerializeField]
  10. private List<string> greetings = new List<string>();
  11.  
  12. private void OnTriggerEnter(Collider other)
  13. {
  14. if (other.gameObject.GetComponent<PlayerController>())
  15. {
  16. Debug.Log(greetings[Random.Range(0,greetings.Count-1)]);
  17. }
  18. }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement