hi
i have the next code to make the dialog sistem of my game, but it doesn´t work, i don´t know why because unity not show errors, pls help
using UnityEngine;
using System.Collections;
public class dialogo : MonoBehaviour {
public string [] botones;
public string [] respuestas;
public bool displaydialog=true;
public int quest=0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGui()
{
GUILayout.BeginArea (new Rect (700, 600, 400, 400));
if (displaydialog && quest == 0)
{
GUILayout.Label(respuestas[0]);
GUILayout.Label(respuestas[1]);
if(GUILayout.Button(botones[0]))
{
quest=1;displaydialog=false;
}
if (GUILayout.Button (botones [1])) {
displaydialog=false;
}
}
if (displaydialog && quest == 0)
{
GUILayout.Label(respuestas[2]);
if(GUILayout.Button(botones[2]))displaydialog=false;
}
GUILayout.EndArea ();
}
void OnTriggerEnter()
{ displaydialog=true;
}
void OnTriggerExit()
{ displaydialog=false;
}
}