init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
43
Assets/Scripts/FakeShop/FakeShopSeller.cs
Normal file
43
Assets/Scripts/FakeShop/FakeShopSeller.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class FakeShopSeller : MonoBehaviour{
|
||||
|
||||
[SerializeField] GameObject sellerText = default;
|
||||
[SerializeField] TMP_Animated text = default;
|
||||
[SerializeField] Dialogue dialogue = default;
|
||||
[SerializeField] GameObject arrow = default;
|
||||
|
||||
void Awake(){
|
||||
arrow.SetActive(false);
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider col){
|
||||
if (col.CompareTag("Player")){
|
||||
arrow.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerStay(Collider col){
|
||||
if (col.CompareTag("Player")){
|
||||
if(Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)){
|
||||
Time.timeScale = 0;
|
||||
sellerText.SetActive(true);
|
||||
text.ClearText();
|
||||
text.ReadText(dialogue.sentences[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider col){
|
||||
if (col.CompareTag("Player")){
|
||||
arrow.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void EndConversation(){
|
||||
Time.timeScale = 1;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue