@@ -4,10 +4,18 @@

public class OnTriggerWarning : MonoBehaviour
{
[SerializeField]
GameObject textToDisplay;

[SerializeField]
GameObject camera;

[SerializeField]
float displacementAmount = 0.95f;

private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "player")
if (other.tag == "Player")
{
PlayerPizzaController pizzaManager = other.GetComponent<PlayerPizzaController>();
if (pizzaManager.pizza < 1)
@@ -19,9 +27,15 @@ private void OnTriggerEnter2D(Collider2D other)

IEnumerator TellPlayerToPickPizza(Collider2D other)
{
PlayerMovement playerMovement = other.GetComponent<PlayerMovement>();

textToDisplay.SetActive(true);
other.GetComponent<PlayerMovement>().isActiveAndEnabled(false)
other.GetComponent<PlayerMovement>().enabled = false;
camera.GetComponent<Animation>().Play();
yield return new WaitForSeconds(3);
other.GetComponent<PlayerMovement>().enabled = true;
textToDisplay.SetActive(false);
Destroy(this);
}

}
@@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PickPizza : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}

Large diffs are not rendered by default.