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

starting work on player replies

parent 605f8143
......@@ -339,14 +339,14 @@ RectTransform:
m_Children:
- {fileID: 1207186496}
- {fileID: 865213186}
- {fileID: 1199441909}
- {fileID: 850495250}
m_Father: {fileID: 1949598428}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 76, y: -85}
m_SizeDelta: {x: -172, y: 150}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 76, y: 134}
m_SizeDelta: {x: 700, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &237130076
MonoBehaviour:
......@@ -1152,6 +1152,76 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 832870303}
m_CullTransparentMesh: 0
--- !u!1 &850495249
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 850495250}
- component: {fileID: 850495252}
- component: {fileID: 850495251}
m_Layer: 0
m_Name: PlayerResponses
m_TagString: ResponsePanel
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &850495250
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 850495249}
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: 1199441909}
m_Father: {fileID: 237130075}
m_RootOrder: 2
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_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &850495251
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 850495249}
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: 0.392}
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: 10907, 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 &850495252
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 850495249}
m_CullTransparentMesh: 0
--- !u!1 &865213185
GameObject:
m_ObjectHideFlags: 0
......@@ -1208,7 +1278,7 @@ MonoBehaviour:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 31
m_FontSize: 29
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
......@@ -1219,7 +1289,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
m_Text: such text much wow.
--- !u!222 &865213188
CanvasRenderer:
m_ObjectHideFlags: 0
......@@ -1655,12 +1725,12 @@ RectTransform:
m_LocalScale: {x: 0.438, y: 0.438, z: 43.8}
m_Children:
- {fileID: 832870304}
m_Father: {fileID: 237130075}
m_RootOrder: 2
m_Father: {fileID: 850495250}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 31}
m_AnchoredPosition: {x: -182, y: 31}
m_SizeDelta: {x: 60, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1199441910
......@@ -1701,7 +1771,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1199441911}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 0}
m_MethodName:
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &1199441911
......@@ -2013,6 +2094,11 @@ Prefab:
m_Modification:
m_TransformParent: {fileID: 1936604887}
m_Modifications:
- target: {fileID: 114787342697137634, guid: 2c7917ac87eca42679b31ab33e2eec29,
type: 2}
propertyPath: playerResponses.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4885089913599246, guid: 2c7917ac87eca42679b31ab33e2eec29, type: 2}
propertyPath: m_LocalPosition.x
value: -3.38
......@@ -2045,6 +2131,26 @@ Prefab:
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114787342697137634, guid: 2c7917ac87eca42679b31ab33e2eec29,
type: 2}
propertyPath: playerResponses.Array.data[0]
value:
objectReference: {fileID: 1199441910}
- target: {fileID: 114787342697137634, guid: 2c7917ac87eca42679b31ab33e2eec29,
type: 2}
propertyPath: playerResponses.Array.data[1]
value:
objectReference: {fileID: 0}
- target: {fileID: 114787342697137634, guid: 2c7917ac87eca42679b31ab33e2eec29,
type: 2}
propertyPath: playerResponses.Array.data[2]
value:
objectReference: {fileID: 0}
- target: {fileID: 114787342697137634, guid: 2c7917ac87eca42679b31ab33e2eec29,
type: 2}
propertyPath: playerResponses.Array.data[3]
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2c7917ac87eca42679b31ab33e2eec29, type: 2}
m_IsPrefabAsset: 0
......
......@@ -9,7 +9,9 @@ public class CharacterInteractions : MonoBehaviour {
public Button interactButton;
private Text speechBox;
private GameObject faceCamDisplay;
private Button playerbutton1;
//character response stuff
private Image responsePanel;
public Button[] playerResponses;
//old speech boxes
public Text secondarySpeechBox;
......@@ -25,8 +27,8 @@ public class CharacterInteractions : MonoBehaviour {
private float proximityTimer;
private float speechBoxTimer;
private bool wasInteracting;//prevents other characters from removing the dialogue box that this character is using
private string[] testReplies = { "Yes", "no" };
// Use this for initialization
void Awake()
{
......@@ -35,7 +37,7 @@ public class CharacterInteractions : MonoBehaviour {
faceCamDisplay = GameObject.FindWithTag("FaceCam");
DialogueUI = GameObject.FindWithTag("DialogueUI");
playerbutton1 = GameObject.FindWithTag("Button1").GetComponent<Button>();
responsePanel = GameObject.FindWithTag("ResponsePanel").GetComponent<Image>();
speechBox = GameObject.FindWithTag("CharacterSpeech").GetComponent<Text>();
}
private void Start() {
......@@ -55,19 +57,18 @@ 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);
setText(speechBox, characterScript.GreetingMessage(), 5, testReplies);
interactButton.gameObject.SetActive(false);
}
//generate speech every so often while the player is nearby
if (Time.time % 5 < 0.01) {
if (Random.Range(0f, 1f) < 0.3) {
setText(speechBox, characterScript.ProximityMessage(), 2);
setText(speechBox, characterScript.ProximityMessage(), 2, testReplies);
}
}
} else {//if the player is currently interacting
playerbutton1.gameObject.SetActive(true);
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) {
setText(speechBox, characterScript.converse(), 5);
setText(speechBox, characterScript.converse(), 5, testReplies);
}
}
}
......@@ -105,21 +106,25 @@ public class CharacterInteractions : MonoBehaviour {
DialogueUI.gameObject.SetActive(false);
if (interacting)
{
setText(speechBox, characterScript.GoodbyeMessage(), 2);
setText(speechBox, characterScript.GoodbyeMessage(), 2, testReplies);
}
else{
setText(speechBox, characterScript.butthurtGoodbye(), 2);
setText(speechBox, characterScript.butthurtGoodbye(), 2, testReplies);
}
interacting = false;
}
//sets the text of a given text box and sets it to active.
void setText(Text box, string text, float uptime){
void setText(Text box, string text, float uptime, string[] replies){
speechBoxTimer = Time.time + uptime;
wasInteracting = true;
DialogueUI.gameObject.SetActive(true);
updateFaceCamDisplay();
box.text = text;
print(text);
//setting player reply options
for (int i = 0; i < replies.Length; i++) {
}
}
public void updateFaceCamDisplay() {
......@@ -134,4 +139,7 @@ public class CharacterInteractions : MonoBehaviour {
faceCamDisplay.transform.localScale = newScale;
}
}
public void ButtonPress() {
setText(speechBox, characterScript.converse(), 5, testReplies);
}
}
......@@ -12,6 +12,7 @@ TagManager:
- Button1
- CharacterSpeech
- Manager
- ResponsePanel
layers:
- Default
- TransparentFX
......
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