Commit 7ae36752 authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

ahava asks for players name

parent f6afab40
......@@ -191,33 +191,33 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 277655077}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 3
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1603569833}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 3
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 383337993}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 3
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
......@@ -668,33 +668,33 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 277655077}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 1
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1603569833}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 1
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 383337993}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 1
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
......@@ -6368,6 +6368,7 @@ RectTransform:
- {fileID: 173653536}
- {fileID: 1231582147}
- {fileID: 72725769}
- {fileID: 1530427905}
m_Father: {fileID: 237130075}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -11353,6 +11354,83 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4685995443603026, guid: c4f70e7842d9045408379dd4227dc3fb,
type: 2}
m_PrefabInternal: {fileID: 929555949}
--- !u!1 &1021047122
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1021047123}
- component: {fileID: 1021047125}
- component: {fileID: 1021047124}
m_Layer: 0
m_Name: Placeholder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1021047123
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1021047122}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1530427905}
m_RootOrder: 0
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: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1021047124
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1021047122}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5}
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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Jimbo
'
--- !u!222 &1021047125
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1021047122}
m_CullTransparentMesh: 0
--- !u!1 &1193059960
GameObject:
m_ObjectHideFlags: 0
......@@ -11581,7 +11659,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 277655077}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
......@@ -11592,7 +11670,7 @@ MonoBehaviour:
m_CallState: 2
- m_Target: {fileID: 1603569833}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
......@@ -11603,7 +11681,7 @@ MonoBehaviour:
m_CallState: 2
- m_Target: {fileID: 383337993}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
......@@ -11777,33 +11855,33 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 277655077}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 2
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1603569833}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 2
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 383337993}
m_MethodName: ButtonPress
m_Mode: 1
m_Mode: 3
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_IntArgument: 2
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
......@@ -16637,6 +16715,152 @@ Prefab:
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9e7fbf1a7c7a84dbc9e793c25c9e722a, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &1530427904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1530427905}
- component: {fileID: 1530427908}
- component: {fileID: 1530427907}
- component: {fileID: 1530427906}
m_Layer: 0
m_Name: PlayerName
m_TagString: playerInput
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1530427905
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1530427904}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1021047123}
- {fileID: 2045631712}
m_Father: {fileID: 850495250}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 27}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1530427906
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1530427904}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1530427907}
m_TextComponent: {fileID: 2045631713}
m_Placeholder: {fileID: 1021047124}
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 241155500}
m_MethodName: changePlayerName
m_Mode: 2
m_Arguments:
m_ObjectArgument: {fileID: 1530427904}
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
--- !u!114 &1530427907
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1530427904}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
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: 10911, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1530427908
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1530427904}
m_CullTransparentMesh: 0
--- !u!1001 &1532274092
Prefab:
m_ObjectHideFlags: 0
......@@ -17449,6 +17673,81 @@ Canvas:
m_SortingLayerID: -1020251125
m_SortingOrder: 2
m_TargetDisplay: 0
--- !u!1 &2045631711
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2045631712}
- component: {fileID: 2045631714}
- component: {fileID: 2045631713}
m_Layer: 0
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2045631712
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2045631711}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1530427905}
m_RootOrder: 1
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: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2045631713
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2045631711}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &2045631714
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2045631711}
m_CullTransparentMesh: 0
--- !u!1 &2080760844
GameObject:
m_ObjectHideFlags: 0
......
......@@ -1810,7 +1810,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e8199870fdccbda429d8da476630df26, type: 3}
m_Name:
m_EditorClassIdentifier:
trapezeCooldown: 0.5
trapezeCooldown: 0.25
--- !u!1 &2023603708
GameObject:
m_ObjectHideFlags: 0
......
......@@ -10,6 +10,7 @@ public class CharacterInteractions : MonoBehaviour {
private Text speechBox;
private GameObject faceCamDisplay;
private Image LevelMeter;
private InputField inputName;
//character response stuff
private Image responsePanel;
public Button[] playerResponses;
......@@ -25,6 +26,7 @@ public class CharacterInteractions : MonoBehaviour {
private bool interacting;
private float speechBoxTimer;
private bool wasInteracting;//prevents other characters from removing the dialogue box that this character is using
// Use this for initialization
void Awake()
......@@ -38,11 +40,13 @@ public class CharacterInteractions : MonoBehaviour {
responsePanel = GameObject.FindWithTag("ResponsePanel").GetComponent<Image>();
speechBox = GameObject.FindWithTag("CharacterSpeech").GetComponent<Text>();
LevelMeter = GameObject.FindWithTag("LevelMeter").GetComponent<Image>();
inputName = GameObject.FindWithTag("playerInput").GetComponent<InputField>();
}
private void Start() {
interactButton.gameObject.SetActive(false);
DialogueUI.gameObject.SetActive(false);
inputName.gameObject.SetActive(false);
//playerbutton1.gameObject.SetActive(false);
}
......@@ -68,13 +72,14 @@ public class CharacterInteractions : MonoBehaviour {
}
}
} else {//if the player is currently interacting
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.E)) {//conversing
if (!DaytimeManager.enteringName && (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.E))) {//conversing
//stage 1, ahava asks player for name
if (characterScript.getName() == "Ahava" && GameManager.ConversationStage == 1 && GameManager.speechState == 4) {
//create input field
print("GetMame");
if (characterScript.getName() == "Ahava" && GameManager.ConversationStage == 1) {
askPlayerForName();
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
} else {
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
}
}
......@@ -161,7 +166,7 @@ public class CharacterInteractions : MonoBehaviour {
faceCamDisplay.transform.localScale = newScale;
}
}
public void ButtonPress() {
public void ButtonPress(int buttonNum) {
if (interacting) {
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
......@@ -174,4 +179,18 @@ public class CharacterInteractions : MonoBehaviour {
anim.SetBool("Talking", false);
}
}
private bool askPlayerForName() {
if (GameManager.speechState == 5) {
//create input field for player name
DaytimeManager.enteringName = true;
inputName.gameObject.SetActive(true);
inputName.ActivateInputField();
//string nameQuestion = "What Is Your Name1";
//string[] nameResponse = new string[] { "okay" };
//setText(speechBox, nameQuestion, Mathf.Infinity, nameResponse);
return true;
}
return false;
}
}
......@@ -104,24 +104,24 @@ public class AhavaSpeech : MonoBehaviour, Character {
conversation.Enqueue("welcome to the circus");
responseQueue.Enqueue(new string[] { "response 1" });
//GameManager.speechState will be the size of the queue when this is in front
//GameManager.speechState will be the size of the queue when this dequeued
//make sure to change the check integer in CharacterInteractins when changing dialogue
conversation.Enqueue("What Is Your Name");
responseQueue.Enqueue(new string[] {});
responseQueue.Enqueue(new string[] {"okay"});
conversation.Enqueue("Great Name! How about we call you John Smith instead");
responseQueue.Enqueue(new string[] { "I Love it!", "I Hate it!", "I know a guy called John Smith" });
conversation.Enqueue("Maybe We'll just call you Dennnis");
conversation.Enqueue("Maybe we'll just call you Dennnis");
responseQueue.Enqueue(new string[] { "fine", "not Dennis!" });
conversation.Enqueue("No Takebacksies");
responseQueue.Enqueue(new string[] { "" });
responseQueue.Enqueue(new string[] { "..." });
}
private void conversationStage2() {
conversation.Enqueue("youre fitting in nicely here, you remind me of Myself when i was younger");
conversation.Enqueue("youre fitting in nicely here " + GameManager.playerName + ", you remind me of Myself when i was younger");
responseQueue.Enqueue(new string[] { "great", "you were young once?", "thanks mum" });
}
......
......@@ -11,6 +11,8 @@ public class DaytimeManager : MonoBehaviour {
public Canvas pauseMenu;
private bool pauseMenuActive = false;
public static bool enteringName;
void Start() {
pauseMenu.gameObject.SetActive(false);
......@@ -29,4 +31,11 @@ public class DaytimeManager : MonoBehaviour {
public static void beginPerformance() {
SceneManager.LoadScene("NightMenu");
}
public void changePlayerName(GameObject name) {
GameManager.playerName = name.GetComponent<InputField>().text;
print(GameManager.playerName);
name.SetActive(false);
enteringName = false;
}
}
......@@ -9,6 +9,8 @@ public class GameManager : MonoBehaviour {
public static float SimonLevel = 1.3f;
public static float JohnLevel = 1.1f;
public static string playerName = "goddamn";
public static int ConversationStage;
public static int speechState;
......@@ -27,4 +29,5 @@ public class GameManager : MonoBehaviour {