Commit d2857375 authored by nedboy3's avatar nedboy3
Browse files

IntroScene seems done =)

parent 875f7e22
......@@ -48,14 +48,9 @@ public class PaperSpeech : MonoBehaviour, Character {
public string nothingMoreToSay()
{
currentResponses = new string[] { };
if (Random.Range(0, 1f) < 0.8)
{
return "my beard grows tired of your chitter chatter";
}
else
{
return "Dennis the mennis!";
}
return "WHAT ARE YOU WAITING FOR, JUST WALK TO THE RIGHT TO LEAVE THE CONVERSATION AND START " +
" YOUR CIRCUS CAREER";
}
public string converse()
......
......@@ -11,12 +11,13 @@ public class IntroTent : MonoBehaviour {
private float speechBoxTimer;
public Text box;
private GameObject DialogueUI;
private GameObject response;
private ContactFilter2D filter = new ContactFilter2D();
// Use this for initialization
void Start () {
filter.SetLayerMask(LayerMask.GetMask("Player"));
DialogueUI = GameObject.FindWithTag("DialogueUI");
response = GameObject.FindWithTag("ResponsePanel");
thisCollider = GetComponent<BoxCollider2D>();
}
......@@ -33,7 +34,7 @@ public class IntroTent : MonoBehaviour {
DialogueUI.gameObject.SetActive(true);
faceCamDisplay.SetActive(true);
updateFaceCamDisplay();
GameObject.FindWithTag("ResponsePanel").SetActive(false);
response.SetActive(false);
box.text = "The warm embrace of the tent calls you to interact";
//setting player reply options
//set the text on the reply buttons
......
......@@ -9,7 +9,6 @@ public class PaperController : MonoBehaviour {
public Button interactButton;
private Text speechBox;
private GameObject faceCamDisplay;
private Image LevelMeter;
private InputField inputName;
//character response stuff
private Image responsePanel;
......@@ -45,7 +44,6 @@ public class PaperController : MonoBehaviour {
DialogueUI = GameObject.FindWithTag("DialogueUI");
responsePanel = GameObject.FindWithTag("ResponsePanel").GetComponent<Image>();
speechBox = GameObject.FindWithTag("CharacterSpeech").GetComponent<Text>();
LevelMeter = GameObject.FindWithTag("LevelMeter").GetComponent<Image>();
inputName = GameObject.FindWithTag("playerInput").GetComponent<InputField>();
player = GameObject.FindWithTag("Player").GetComponent<GameObject>();
......@@ -179,7 +177,6 @@ public class PaperController : MonoBehaviour {
DialogueUI.gameObject.SetActive(true);
updateFaceCamDisplay();
box.text = text;
LevelMeter.fillAmount = characterScript.getLevel() % 1;
print(text);
//setting player reply options
for (int i = 0; i < playerResponses.Length; i++)
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TentIntroInteractions : MonoBehaviour {
public Button interactButton;
public Button interactButton2;
//public GameObject particleSystem;
private GameObject player;
private BoxCollider2D thisCollider;
private ContactFilter2D filter = new ContactFilter2D();
private bool interactable;
// Use this for initialization
void Start()
{
player = GameObject.FindWithTag("Player");
thisCollider = GetComponent<BoxCollider2D>();
filter.SetLayerMask(LayerMask.GetMask("Player"));
interactButton.gameObject.SetActive(false);
interactButton2.gameObject.SetActive(false);
}
// Update is called once per frame
void Update()
{
checkNearbyPlayers();
if (interactable)
{
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.E))
{
DaytimeManager.beginPerformance();
}
}
}
private void checkNearbyPlayers()
{
CapsuleCollider2D playerCol = player.GetComponent<CapsuleCollider2D>();
Collider2D[] foundPlayers = new Collider2D[1];
if (thisCollider.OverlapCollider(filter, foundPlayers) > 0)
{
if (!interactable)
{
EnterInteractable();
}
interactable = true;
}
else
{
if (interactable)
{
ExitInteractable();
}
interactable = false;
}
}
void EnterInteractable()
{
interactButton.gameObject.SetActive(true);
interactButton2.gameObject.SetActive(true);
//particleSystem.SetActive(true);
}
void ExitInteractable()
{
interactButton.gameObject.SetActive(false);
interactButton2.gameObject.SetActive(false);
//particleSystem.SetActive(false);
}
}
fileFormatVersion: 2
guid: 09f6e8b7ec0f04c4baa9e3bec8108e56
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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