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

@@ -11,6 +11,8 @@ public class Node : MonoBehaviour
public GameObject[] connections;
public GameObject UI;
public bool isUnlocked = true;
// Start is called before the first frame update
void Start()
{
@@ -20,7 +22,10 @@ public class Node : MonoBehaviour
// Update is called once per frame
void Update()
{
if(!isUnlocked)
{
DisableNode();
}
}
public void SetActiveNode()

View File

@@ -9,8 +9,30 @@ public class NodeButton : MonoBehaviour
public Node.Direction direction;
// Start is called before the first frame update
void Start()
{
}
private void Update()
{
if (node.connections[(int)direction] == null)
{
gameObject.GetComponent<Renderer>().material.color = Color.gray;
gameObject.GetComponent<Collider>().enabled = false;
return;
}
//Connected devices have no Node
if(node.connections[(int)direction].GetComponent<Node>() == null)
{
return;
}
if (node.connections[(int)direction].GetComponent<Node>().isUnlocked)
{
gameObject.GetComponent<Renderer>().material.color = Color.green;
gameObject.GetComponent<Collider>().enabled = true;
} else
{
gameObject.GetComponent<Renderer>().material.color = Color.gray;
gameObject.GetComponent<Collider>().enabled = false;

View File

@@ -6,7 +6,6 @@ using UnityEngine.InputSystem;
public class Switch : MonoBehaviour
{
public GameManager gameManager;
public float interactionDistance = 10;
private Renderer renderer;
public Node debugNode;
@@ -14,7 +13,7 @@ public class Switch : MonoBehaviour
// Start is called before the first frame update
void Start()
{
renderer = gameObject.GetComponent<Renderer>();
}
@@ -26,21 +25,21 @@ public class Switch : MonoBehaviour
if (renderer.isVisible)
{
if (Vector3.Distance(transform.position, gameManager.player.transform.position) < interactionDistance) {
//Debug.Log("Switch is visible and in range");
if (Keyboard.current.eKey.wasPressedThisFrame && !gameManager.activeNode)
{
gameManager.previousNode = debugNode;
gameManager.activeNode = debugNode.gameObject;
gameManager.SetActiveCamera(gameManager.networkCamera);
debugNode.SendMessage("SetActiveNode", debugNode.GetComponent<Node>());
gameManager.player.GetComponent<StarterAssets.FirstPersonController>().enabled = false;
}
}
}
}
public void PlayerInteract()
{
if(!gameManager.activeNode)
{
gameManager.previousNode = debugNode;
gameManager.activeNode = debugNode.gameObject;
gameManager.SetActiveCamera(gameManager.networkCamera);
debugNode.SendMessage("SetActiveNode", debugNode.GetComponent<Node>());
gameManager.player.GetComponent<StarterAssets.FirstPersonController>().enabled = false;
Cursor.lockState = CursorLockMode.Confined;
}
}