Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public interface IDialog
- {
- void SystemDialog(Text text, string txt_Active);
- void SetDialot(string[] SetWordDialod, string[] GetWorldDialog);
- }
- public class Dialog : MonoBehaviour
- {
- [SerializeField] string[] Dictionary_Positive;//ответы негативные/позитивные от игрока
- [SerializeField] string[] Dictionary_Negative;
- [SerializeField] string[] Answers_Positve;//ответы позитивные/неативные от бота
- [SerializeField] string[] Answers_Negative;
- [SerializeField] Text [] Option_text;//варианты ответов
- [SerializeField] Text DefoultText;//полученый текст от варианта ответа
- [SerializeField] int id_Answers = 0, id_TextAnswers = 0;
- [SerializeField] Intruder intruder_GM;
- [SerializeField] GameObject GM_Dir;
- private void Start()
- {
- if(intruder_GM==null)
- intruder_GM = GameObject.Find("SA_Character").GetComponent<Intruder>();
- }
- public void SetAnswers()
- {
- if (id_Answers >= Dictionary_Positive.Length)
- {
- intruder_GM.IsActiveDirections_Obj = false;
- gameObject.SetActive(false);
- intruder_GM.isRun = false;
- }
- else
- {
- Option_text[1].text = Dictionary_Positive[id_Answers];
- Option_text[0].text = Dictionary_Negative[id_Answers];
- id_Answers++;
- }
- }
- public void SetTextBotPositive()
- {
- if (id_Answers >= 1)
- {
- DefoultText.text = Answers_Positve[id_TextAnswers];
- id_TextAnswers++;
- }
- }
- public void Asnwer(int id)
- {
- switch (id)
- {
- case 0:
- SetTextBotPositive();
- SetAnswers();
- break;
- case 1:
- gameObject.SetActive(false);
- intruder_GM.IsFight = true;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement