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);