// Use this for initialization void Start() { talk = keepTalking; //NPC Starts at introduction isTalking = false; //Is not talking at first curLine = 0; playerScript = GameObject.Find("Player").GetComponent <PlayerControl>(); gameScripts = GameObject.Find("GameController").GetComponent <game_scripts>(); aiGraph = GameObject.Find("GameController").GetComponent <NPC_Calc>(); speechGraph = gameObject.GetComponent <SpeechGraph>(); }
/// <summary> /// Reads one line from the script then closes when action is hit again /// </summary> /// <param name="arr">Array to be read</param> void talkRandLine(string[] arr) { if (isTalking) { curLine = Random.Range(0, arr.Length); gameScripts.showText(arr[curLine]); talk = stopTalking; } else { stopTalking(); } }
/// <summary> /// Reads one line from the script then closes when action is hit again /// </summary> /// <param name="arr">Array to be read</param> void talkRandLine(string[]arr) { if (isTalking) { curLine = Random.Range(0, arr.Length); gameScripts.showText(arr[curLine]); talk = stopTalking; } else { stopTalking(); } }
// Use this for initialization void Start() { talk = keepTalking;//NPC Starts at introduction isTalking = false;//Is not talking at first curLine = 0; playerScript = GameObject.Find("Player").GetComponent<PlayerControl>(); gameScripts = GameObject.Find("GameController").GetComponent<game_scripts>(); aiGraph = GameObject.Find("GameController").GetComponent<NPC_Calc>(); speechGraph = gameObject.GetComponent<SpeechGraph>(); }