Commit a86ba9df authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

updated the other characters scripts to give replies

parent 01edf6c6
......@@ -236,14 +236,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.01886791, g: 0.01886791, b: 0.01886791, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 9731ee7c67f86481aab7cece5317c667, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -412,8 +412,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -31}
m_SizeDelta: {x: 240, y: 0}
m_AnchoredPosition: {x: 0, y: -21}
m_SizeDelta: {x: 300, y: 22}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &134449647
MonoBehaviour:
......@@ -559,14 +559,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.01886791, g: 0.01886791, b: 0.01886791, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 9731ee7c67f86481aab7cece5317c667, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -795,6 +795,11 @@ Prefab:
m_Modification:
m_TransformParent: {fileID: 1936604887}
m_Modifications:
- target: {fileID: 114613926750057822, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a,
type: 2}
propertyPath: playerResponses.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4549546449924174, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a, type: 2}
propertyPath: m_LocalPosition.x
value: 16.18
......@@ -855,6 +860,26 @@ Prefab:
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114613926750057822, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a,
type: 2}
propertyPath: playerResponses.Array.data[0]
value:
objectReference: {fileID: 1199441910}
- target: {fileID: 114613926750057822, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a,
type: 2}
propertyPath: playerResponses.Array.data[1]
value:
objectReference: {fileID: 173653533}
- target: {fileID: 114613926750057822, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a,
type: 2}
propertyPath: playerResponses.Array.data[2]
value:
objectReference: {fileID: 1231582144}
- target: {fileID: 114613926750057822, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a,
type: 2}
propertyPath: playerResponses.Array.data[3]
value:
objectReference: {fileID: 72725770}
m_RemovedComponents:
- {fileID: 81365263224242478, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a, type: 2}
m_SourcePrefab: {fileID: 100100000, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a, type: 2}
......@@ -1218,8 +1243,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -31}
m_SizeDelta: {x: 240, y: 0}
m_AnchoredPosition: {x: 0, y: -21}
m_SizeDelta: {x: 300, y: 22}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &511771229
MonoBehaviour:
......@@ -1561,8 +1586,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.0000038147, y: -33}
m_SizeDelta: {x: 240, y: 0}
m_AnchoredPosition: {x: 0, y: -21}
m_SizeDelta: {x: 300, y: 22}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &832870305
MonoBehaviour:
......@@ -1640,8 +1665,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 54.999985, y: -51.375004}
m_SizeDelta: {x: -130, y: -117.25}
m_AnchoredPosition: {x: 54.999985, y: -46}
m_SizeDelta: {x: -130, y: -108}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &850495251
MonoBehaviour:
......@@ -1885,8 +1910,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -31}
m_SizeDelta: {x: 240, y: 0}
m_AnchoredPosition: {x: 0, y: -21}
m_SizeDelta: {x: 300, y: 22}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &928319864
MonoBehaviour:
......@@ -2349,14 +2374,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.01886791, g: 0.01886791, b: 0.01886791, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 9731ee7c67f86481aab7cece5317c667, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -2620,14 +2645,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.01886791, g: 0.01886791, b: 0.01886791, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 9731ee7c67f86481aab7cece5317c667, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -7496,6 +7521,11 @@ Prefab:
m_Modification:
m_TransformParent: {fileID: 1936604887}
m_Modifications:
- target: {fileID: 114001346337691594, guid: 36e15d0d933814ddd8f60f70726d5cdd,
type: 2}
propertyPath: playerResponses.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4118635779259584, guid: 36e15d0d933814ddd8f60f70726d5cdd, type: 2}
propertyPath: m_LocalPosition.x
value: 23.26
......@@ -7556,6 +7586,26 @@ Prefab:
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114001346337691594, guid: 36e15d0d933814ddd8f60f70726d5cdd,
type: 2}
propertyPath: playerResponses.Array.data[0]
value:
objectReference: {fileID: 1199441910}
- target: {fileID: 114001346337691594, guid: 36e15d0d933814ddd8f60f70726d5cdd,
type: 2}
propertyPath: playerResponses.Array.data[1]
value:
objectReference: {fileID: 173653533}
- target: {fileID: 114001346337691594, guid: 36e15d0d933814ddd8f60f70726d5cdd,
type: 2}
propertyPath: playerResponses.Array.data[2]
value:
objectReference: {fileID: 1231582144}
- target: {fileID: 114001346337691594, guid: 36e15d0d933814ddd8f60f70726d5cdd,
type: 2}
propertyPath: playerResponses.Array.data[3]
value:
objectReference: {fileID: 72725770}
m_RemovedComponents:
- {fileID: 81206696293522424, guid: 36e15d0d933814ddd8f60f70726d5cdd, type: 2}
m_SourcePrefab: {fileID: 100100000, guid: 36e15d0d933814ddd8f60f70726d5cdd, type: 2}
......
......@@ -56,7 +56,7 @@ public class CharacterInteractions : MonoBehaviour {
//if player presses up, begin the interaction.
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) {
interacting = true;
setText(speechBox, characterScript.GreetingMessage(), 5, characterScript.getResponses());
setText(speechBox, characterScript.GreetingMessage(), Mathf.Infinity, characterScript.getResponses());
interactButton.gameObject.SetActive(false);
}
//generate speech every so often while the player is nearby
......@@ -67,7 +67,7 @@ public class CharacterInteractions : MonoBehaviour {
}
} else {//if the player is currently interacting
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) {
setText(speechBox, characterScript.converse(), 5, characterScript.getResponses());
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
}
}
......@@ -124,7 +124,6 @@ public class CharacterInteractions : MonoBehaviour {
for (int i = 0; i < playerResponses.Length; i++) {
//find spacing to arrange buttons
float spacing = responsePanel.rectTransform.rect.width / (replies.Length + 1);
print("spacing" + spacing);
//set the text on the reply buttons
if (i < replies.Length) {
//arrange buttons
......@@ -156,7 +155,7 @@ public class CharacterInteractions : MonoBehaviour {
}
public void ButtonPress() {
if (interacting) {
setText(speechBox, characterScript.converse(), 5, characterScript.getResponses());
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
}
}
......@@ -6,26 +6,31 @@ using UnityEngine;
public class SilasSpeech : MonoBehaviour, Character {
private Queue<string> conversation = new Queue<string>();
private Queue<string[]> responseQueue = new Queue<string[]>();
private string[] currentResponses;
public string GreetingMessage(){
loadConversation();
currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
return "...";
}
public string GoodbyeMessage(){
currentResponses = new string[] { };
return "mime mime mime mime cya bye mime";
}
public string ProximityMessage(){
currentResponses = new string[] { "yes, me, i did"};
return "did someone enter my invivible box";
}
public string butthurtGoodbye(){
currentResponses = new string[] { };
return "its just white makeup, i swear!";
}
public string nothingMoreToSay() {
currentResponses = new string[] {"wow, tell me more", "my ears are bleeding" };
switch (Random.Range(0,10)) {
case 0: return "1";
case 1: return "2";
......@@ -44,6 +49,7 @@ public class SilasSpeech : MonoBehaviour, Character {
public string converse() {
if (conversation.Count > 0) {
currentResponses = responseQueue.Dequeue();
return conversation.Dequeue();
} else {
return nothingMoreToSay();
......@@ -52,12 +58,25 @@ public class SilasSpeech : MonoBehaviour, Character {
private void loadConversation() {
conversation.Clear();
responseQueue.Clear();
conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
responseQueue.Enqueue(new string[] { "wow you fooled me!", "nah not really" });
conversation.Enqueue("The names Silas, they call me the unspeakable round here");
responseQueue.Enqueue(new string[] { "why is that", "cant think why" });
conversation.Enqueue("Not really sure why they call me unspeakable but it sounds cool doesnt it.");
responseQueue.Enqueue(new string[] { "Yes!", "people are taking the piss m8" });
conversation.Enqueue("anyway have you seen my show 'Mime Mime' its the talk of the circus");
responseQueue.Enqueue(new string[] { "not yet", "ive played it!", "isnt that just a rip off?" });
conversation.Enqueue("...well its mostly just me talking about it but they say its the best");
responseQueue.Enqueue(new string[] { "keep talking!", "okay stop now" });
conversation.Enqueue("...well i say its the best");
responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
}
public string[] getResponses() {
......
......@@ -6,6 +6,7 @@ using UnityEngine;
public class SimonSpeech : MonoBehaviour, Character {
private Queue<string> conversation = new Queue<string>();
private Queue<string[]> responseQueue = new Queue<string[]>();
private string[] currentResponses;
......@@ -15,17 +16,21 @@ public class SimonSpeech : MonoBehaviour, Character {
return "(happy) grr";
}
public string GoodbyeMessage(){
currentResponses = new string[] { };
return "(relieved) grr";
}
public string ProximityMessage(){
currentResponses = new string[] { };
return "(thoughtful) grr";
}
public string butthurtGoodbye(){
currentResponses = new string[] { };
return "(angry) GRR";
}
public string nothingMoreToSay() {
currentResponses = new string[] { };
if (Random.Range(0, 1f) < 0.8) {
return "grr?";
} else {
......@@ -35,6 +40,7 @@ public class SimonSpeech : MonoBehaviour, Character {
public string converse() {
if (conversation.Count > 0) {
currentResponses = responseQueue.Dequeue();
return conversation.Dequeue();
} else {
return nothingMoreToSay();
......@@ -43,12 +49,25 @@ public class SimonSpeech : MonoBehaviour, Character {
private void loadConversation() {
conversation.Clear();
responseQueue.Clear();
conversation.Enqueue("grR");
responseQueue.Enqueue(new string[] { "GRR", "..." });
conversation.Enqueue("GrR");
responseQueue.Enqueue(new string[] { "GRR", "umm" });
conversation.Enqueue("gRR");
responseQueue.Enqueue(new string[] { "GRR", "you sound funny" });
conversation.Enqueue("GRr");
responseQueue.Enqueue(new string[] { "GRR", "sorta, non bearish" });
conversation.Enqueue("GRR");
responseQueue.Enqueue(new string[] { "GRR", "..." });
conversation.Enqueue("grr");
responseQueue.Enqueue(new string[] { "GRR", "..." });
}
public string[] getResponses() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment