Finalized for game jam submission

Lots of bugfixes
New tasks
This commit is contained in:
Jan Groß
2021-06-13 20:37:07 +02:00
parent a202fd5e6a
commit ee7a16dd2e
185 changed files with 46707 additions and 5900 deletions

View File

@@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Battery : MonoBehaviour
{
public float interactionDistance = 5;
public GameObject hint;
private GameManager gameManager;
private Renderer renderer;
// Start is called before the first frame update
void Start()
{
gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
renderer = gameObject.GetComponent<Renderer>();
}
// Update is called once per frame
void Update()
{
}
private void FixedUpdate()
{
hint.SetActive(false);
if(gameManager.playerHasBattery) { return; }
if (renderer.isVisible)
{
if (Vector3.Distance(transform.position, gameManager.player.transform.position) <= interactionDistance)
{
hint.SetActive(true);
hint.transform.rotation = Quaternion.LookRotation(hint.transform.position - gameManager.playerCamera.transform.position);
if (UnityEngine.InputSystem.Keyboard.current.eKey.wasPressedThisFrame)
{
gameManager.playerHasBattery = true;
gameObject.SetActive(false);
}
}
}
}
private void OnDrawGizmos()
{
Gizmos.DrawWireSphere(transform.position, interactionDistance);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03d58ef94ec7c524f8a26083dbb4c2ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -16,6 +16,7 @@ public class DestructibleObject : MonoBehaviour
{
gameObject.GetComponent<Rigidbody>().isKinematic = true;
gameObject.transform.position = originalPosition;
gameObject.transform.parent = null;
gameObject.GetComponent<Rigidbody>().isKinematic = false;
}
}

View File

@@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class USB : MonoBehaviour
{
public float interactionDistance = 10;
public GameObject hint;
private GameManager gameManager;
private Renderer renderer;
// Start is called before the first frame update
void Start()
{
gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
renderer = gameObject.GetComponent<Renderer>();
}
// Update is called once per frame
void Update()
{
}
private void FixedUpdate()
{
hint.SetActive(false);
if (renderer.isVisible)
{
if(Vector3.Distance(transform.position, gameManager.player.transform.position) <= interactionDistance)
{
hint.SetActive(true);
hint.transform.rotation = Quaternion.LookRotation(hint.transform.position - gameManager.playerCamera.transform.position );
if (Keyboard.current.eKey.wasPressedThisFrame)
{
gameManager.playerHasUSB = true;
gameObject.SetActive(false);
}
}
}
}
private void OnDrawGizmos()
{
Gizmos.DrawWireSphere(transform.position, interactionDistance);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d2f476c3d951e8742a0e4f5dffeaacb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: