Example #1
0
 // 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>();
 }
Example #2
0
 /// <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();
     }
 }
Example #3
0
 /// <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();
     }
 }
Example #4
0
 // 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>();
 }