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

Added ability to get to performance from daytime scene

parent 04811962
......@@ -779,6 +779,8 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 601223110}
- component: {fileID: 601223112}
- component: {fileID: 601223111}
m_Layer: 0
m_Name: Big Tent
m_TagString: Untagged
......@@ -803,6 +805,42 @@ Transform:
m_Father: {fileID: 757305217}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &601223111
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 601223109}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b09055ef51c376479f7b3466f44b7f6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!61 &601223112
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 601223109}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 4.2, y: -4}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1.5, y: 3}
m_EdgeRadius: 0
--- !u!1 &627483500
GameObject:
m_ObjectHideFlags: 0
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class DaytimeManager : MonoBehaviour {
......@@ -38,4 +39,8 @@ public class DaytimeManager : MonoBehaviour {
Time.timeScale = 1;
}
}
public static void beginPerformance() {
SceneManager.LoadScene("NightMenu");
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectInteractions : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: b2a740c5d73a76e488293ce86a8ae697
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TentInteractoins : MonoBehaviour {
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"));
}
// Update is called once per frame
void Update() {
checkNearbyPlayers();
if (interactable) {
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) {
DaytimeManager.beginPerformance();
}
}
}
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() {
print(":ENTERED INTERACTION");
}
void ExitInteractable() {
print("EXIT INTERACTION");
}
}
fileFormatVersion: 2
guid: 6b09055ef51c376479f7b3466f44b7f6
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