Used asserts instead of if
This commit is contained in:
parent
0a521b51c8
commit
a54c7df3c8
|
@ -3,6 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using ComputeShaderUtility;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
public struct Droplet
|
||||
|
@ -61,6 +62,8 @@ public class BloodComputeShader : MonoBehaviour
|
|||
[SerializeField]
|
||||
uint bufferLookPointer = 0;
|
||||
|
||||
private bool gameHasStarted = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null)
|
||||
|
@ -137,12 +140,17 @@ public class BloodComputeShader : MonoBehaviour
|
|||
{
|
||||
mop1 = players[0].GetComponent<Mop>();
|
||||
mop2 = players[1].GetComponent<Mop>();
|
||||
|
||||
gameHasStarted = true;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (mop1 == null || mop2 == null) return;
|
||||
if (!gameHasStarted) return;
|
||||
|
||||
Assert.IsNotNull(mop1);
|
||||
Assert.IsNotNull(mop2);
|
||||
|
||||
bloodCompute.SetFloat("deltaTime", Time.deltaTime);
|
||||
bloodCompute.SetInt("numParticles", numParticles);
|
||||
|
|
Loading…
Reference in New Issue