Baked Lighting maps

This commit is contained in:
brausjonas
2023-02-05 21:06:31 +01:00
parent 59c7021388
commit b0ddf261f4
82 changed files with 8405 additions and 388 deletions
+15 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using TMPro;
using UnityEngine;
using Random = UnityEngine.Random;
@@ -10,6 +11,7 @@ public class Dice : MonoBehaviour
[SerializeField] private TMP_Text[] numbers;
[SerializeField] private Rigidbody rb;
private bool started;
private float timeLastNumberChanged = 0;
private void Start()
@@ -17,6 +19,17 @@ public class Dice : MonoBehaviour
rb.useGravity = false;
gameObject.SetActive(false);
}
private void Update()
{
if(started)
{
if (Time.time - timeLastNumberChanged >= .100f)
{
RandomNumbers();
}
}
}
public void StartRandom()
{
@@ -25,15 +38,13 @@ public class Dice : MonoBehaviour
rb.useGravity = false;
gameObject.SetActive(true);
started = true;
InvokeRepeating("RandomNumbers", 0f, 0.1f);
}
}
public void StopRandom(int dec)
{
started = false;
CancelInvoke("RandomNumbers");
rb.angularVelocity = new Vector3(5, 5, 5);
rb.useGravity = true;
@@ -45,6 +56,7 @@ public class Dice : MonoBehaviour
private void RandomNumbers()
{
timeLastNumberChanged = Time.time;
int random = Random.Range(1, 7);
rb.angularVelocity = new Vector3(5, 5, 5);
+6 -1
View File
@@ -25,8 +25,11 @@ public class Client : MonoBehaviour
[SerializeField] private TMP_Text[] playerNameTexts;
[SerializeField] private GameObject[] playerInfo;
[SerializeField] private TMP_Text fpsText;
private void Start()
{
for (int i = 0; i < 4; i++)
{
playerInfo[i].SetActive(false);
@@ -48,6 +51,8 @@ public class Client : MonoBehaviour
private void Update()
{
fpsText.text = (int)(Time.frameCount / Time.time) + " FPS";
if (jobs.Count > 0)
{
Job job = jobs.Dequeue();
@@ -131,7 +136,7 @@ public class Client : MonoBehaviour
{
for (int i = 0; i < players.Length; i++)
{
if (players[i] != null)
if (!(players[i] is null))
{
if (i == player)
{
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class AnimationHandler : MonoBehaviour
@@ -125,10 +125,12 @@ public class NoPlayablePlayer : Player
}
}
private Vector3 nextPoint;
//Bewegt den Player von einem Punkt(lastPos) zu einem anderen Punkt(moveTo) mit konstanter Geschwindigkeit
private void InterPolerate()
{
Vector3 nextPoint = Vector3.Lerp(lastPos, moveTo, interPol);
nextPoint = Vector3.Lerp(lastPos, moveTo, interPol);
transform.position = new Vector3(nextPoint.x, transform.position.y, nextPoint.z);
interPol += (Time.deltaTime * speed) / Mathf.Abs(Vector3.Distance(moveTo, lastPos));
}
@@ -31,7 +31,7 @@ public class PlayablePlayer : Player
activated = false;
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 59;
Application.targetFrameRate = 61;
diceScript = dice.GetComponent<Dice>();
}
@@ -170,9 +170,11 @@ public class PlayablePlayer : Player
}
//Bewegt den Player von einem Punkt(lastPos) zu einem anderen Punkt(moveTo) mit konstanter Geschwindigkeit
private Vector3 nextPoint;
private void InterPolerate()
{
Vector3 nextPoint = Vector3.Lerp(lastPos, moveTo, interPol);
nextPoint = Vector3.Lerp(lastPos, moveTo, interPol);
transform.position = new Vector3(nextPoint.x, transform.position.y, nextPoint.z);
interPol += (Time.deltaTime * speed) / Mathf.Abs(Vector3.Distance(moveTo, lastPos));
}