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

daytime now has a dialogue ui box that the characters use to speak, still needs a lottle work

parent b94652ef
......@@ -11,23 +11,6 @@ Prefab:
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1155454820059914}
m_IsPrefabAsset: 1
--- !u!1 &1078496347797816
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224916060231633246}
- component: {fileID: 222681485437998954}
- component: {fileID: 114746618577721884}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1155454820059914
GameObject:
m_ObjectHideFlags: 0
......@@ -43,23 +26,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1251348060865462
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224153010147985166}
- component: {fileID: 222742258881861274}
- component: {fileID: 114847986967612684}
m_Layer: 5
m_Name: PrimarySpeech
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1417095342401676
GameObject:
m_ObjectHideFlags: 0
......@@ -79,43 +45,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1655020588730810
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224516315276490334}
- component: {fileID: 222063085855978614}
- component: {fileID: 114362154838789014}
- component: {fileID: 114085418804974162}
m_Layer: 5
m_Name: PlayerButton1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1685558829426766
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224778898687761304}
- component: {fileID: 223935213268643878}
- component: {fileID: 114887812095659318}
- component: {fileID: 114517934827964954}
- component: {fileID: 114328050124247878}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4326011112805000
Transform:
m_ObjectHideFlags: 1
......@@ -127,7 +56,6 @@ Transform:
m_LocalScale: {x: 0.01, y: 0.01, z: 1}
m_Children:
- {fileID: 4845015650358456}
- {fileID: 224778898687761304}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -138,7 +66,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1417095342401676}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -262, z: 0}
m_LocalPosition: {x: -29, y: -262, z: 0}
m_LocalScale: {x: 100, y: 100, z: 1}
m_Children: []
m_Father: {fileID: 4326011112805000}
......@@ -179,102 +107,6 @@ CapsuleCollider2D:
m_Offset: {x: 0.12, y: -0.06}
m_Size: {x: 1.11, y: 2.52}
m_Direction: 0
--- !u!114 &114085418804974162
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1655020588730810}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, 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: 114362154838789014}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114328050124247878
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1685558829426766}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e974c821358a54736b845863bbbaef8b, type: 3}
m_Name:
m_EditorClassIdentifier:
character: {fileID: 1417095342401676}
--- !u!114 &114362154838789014
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1655020588730810}
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: 0.01886791, g: 0.01886791, b: 0.01886791, 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: 21300000, guid: 9731ee7c67f86481aab7cece5317c667, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114517934827964954
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1685558829426766}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114569653573630594
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -290,93 +122,6 @@ MonoBehaviour:
sprintSpeed: 8
gravity: 9.8
jumpForce: 4
--- !u!114 &114746618577721884
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1078496347797816}
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: 34
m_FontStyle: 1
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 7
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Continue
--- !u!114 &114847986967612684
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1251348060865462}
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.01886791, g: 0.01886791, b: 0.01886791, 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: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 7
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!114 &114887812095659318
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1685558829426766}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!212 &212712217922994598
SpriteRenderer:
m_ObjectHideFlags: 1
......@@ -409,9 +154,9 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: -1966733235
m_SortingLayer: 2
m_SortingOrder: 2
m_Sprite: {fileID: 21300000, guid: 3fa214d604776462cb99a2d4f78a8f79, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
......@@ -423,119 +168,3 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!222 &222063085855978614
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1655020588730810}
m_CullTransparentMesh: 0
--- !u!222 &222681485437998954
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1078496347797816}
m_CullTransparentMesh: 0
--- !u!222 &222742258881861274
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1251348060865462}
m_CullTransparentMesh: 0
--- !u!223 &223935213268643878
Canvas:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1685558829426766}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224153010147985166
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1251348060865462}
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: 224778898687761304}
m_RootOrder: 1
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: 5}
m_SizeDelta: {x: 300, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224516315276490334
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1655020588730810}
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: 224916060231633246}
m_Father: {fileID: 224778898687761304}
m_RootOrder: 0
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: -80}
m_SizeDelta: {x: 60, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224778898687761304
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1685558829426766}
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: 224516315276490334}
- {fileID: 224153010147985166}
m_Father: {fileID: 4326011112805000}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 50, y: 50}
m_SizeDelta: {x: 400, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224916060231633246
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1078496347797816}
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: 224516315276490334}
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: -21.7}
m_SizeDelta: {x: 126, y: 19.5}
m_Pivot: {x: 0.5, y: 0.5}
......@@ -5,12 +5,14 @@ using UnityEngine.UI;
public class CharacterInteractions : MonoBehaviour {
public Button interactButton;
public Text speechBox;
public Text secondarySpeechBox;
public Button playerbutton1;
public Character characterScript;
public Camera faceCam;
private Text speechBox;
private Button playerbutton1;//make these private
private GameObject DialogueUI;
private bool interactable;
private bool interacting;
private float proximityTimer;
......@@ -18,16 +20,21 @@ public class CharacterInteractions : MonoBehaviour {
private CharacterMovement moveScript;
private GameObject faceCamDisplay;
// Use this for initialization
void Start()
void Awake()
{
moveScript = GetComponent<CharacterMovement>();
interactButton.gameObject.SetActive(false);
speechBox.gameObject.SetActive(false);
secondarySpeechBox.gameObject.SetActive(false);
characterScript = GetComponent<Character>();
playerbutton1.gameObject.SetActive(false);
faceCamDisplay = GameObject.FindWithTag("FaceCam");
DialogueUI = GameObject.FindWithTag("DialogueUI");
playerbutton1 = GameObject.FindWithTag("Button1").GetComponent<Button>();
speechBox = GameObject.FindWithTag("CharacterSpeech").GetComponent<Text>();
}
private void Start() {
interactButton.gameObject.SetActive(false);
secondarySpeechBox.gameObject.SetActive(false);
DialogueUI.gameObject.SetActive(false);
//playerbutton1.gameObject.SetActive(false);
}
// Update is called once per frame
......@@ -42,7 +49,8 @@ public class CharacterInteractions : MonoBehaviour {
interacting = true;
setText(speechBox, characterScript.GreetingMessage());
interactButton.gameObject.SetActive(false);
DialogueUI.gameObject.SetActive(true);
updateFaceCamDisplay();
}
//generate speech every so often while the player is nearby
if (Time.time % 5 < 0.01) {
......@@ -62,12 +70,10 @@ public class CharacterInteractions : MonoBehaviour {
}
}
}
//remove speechBoxes after certain time
if(Time.time > speechBoxTimer + 5){
speechBox.gameObject.SetActive(false);
secondarySpeechBox.gameObject.SetActive(false);
}
////deactivate the dialogue UI
//if (Time.time > speechBoxTimer + 5) {
// DialogueUI.gameObject.SetActive(false);
//}
}
//characterMovement script sets this for us when the player
//enters or exits characters range
......@@ -81,7 +87,7 @@ public class CharacterInteractions : MonoBehaviour {
}
//player enters characters range
void enterInteractable(){
speechBox.gameObject.SetActive(false);
//speechBox.gameObject.SetActive(false);
interactButton.gameObject.SetActive(true);
faceCam.gameObject.SetActive(true);
updateFaceCamDisplay();
......@@ -89,8 +95,9 @@ public class CharacterInteractions : MonoBehaviour {
//player exits characters range
void exitInteractable(){
interactButton.gameObject.SetActive(false);
playerbutton1.gameObject.SetActive(false);
faceCam.gameObject.SetActive(false);
speechBoxTimer = Time.time;
DialogueUI.gameObject.SetActive(false);
if (interacting)
{
setText(speechBox, characterScript.GoodbyeMessage());
......@@ -103,20 +110,21 @@ public class CharacterInteractions : MonoBehaviour {
//sets the text of a given text box and sets it to active.
void setText(Text box, string text){
speechBoxTimer = Time.time;
box.gameObject.SetActive(true);
//box.gameObject.SetActive(true);
box.text = text;
print(text);
}
public void updateFaceCamDisplay() {
//set the sign of the scale of the faceDisplay to be equal to the sign of the characters transform
Vector3 newScale = faceCamDisplay.transform.localScale;
if (transform.localScale.x > 0) {
newScale.x = Mathf.Abs(newScale.x);
} else {
newScale.x = (-1) * Mathf.Abs(newScale.x);
if (DialogueUI.gameObject.activeSelf) {
Vector3 newScale = faceCamDisplay.transform.localScale;
if (transform.localScale.x > 0) {
newScale.x = Mathf.Abs(newScale.x);
} else {
newScale.x = (-1) * Mathf.Abs(newScale.x);
}
faceCamDisplay.transform.localScale = newScale;
}
faceCamDisplay.transform.localScale = newScale;
print(newScale);
}
}
......@@ -39,6 +39,7 @@ public class AhavaSpeech : MonoBehaviour, Character {
}
private void loadConversation() {
conversation.Clear();
conversation.Enqueue("welcome to the circus");
conversation.Enqueue("line 2");
conversation.Enqueue("line 3");
......
......@@ -48,6 +48,7 @@ public class SilasSpeech : MonoBehaviour, Character {
}
private void loadConversation() {
conversation.Clear();
conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
conversation.Enqueue("The names Silas, they call me the unspeakable round here");
conversation.Enqueue("Not really sure why they call me unspeakable but it sounds cool doesnt it.");
......