Init
This commit is contained in:
34
Assets/ThirdParty/DestroyIt/Scripts/Runtime/Helpers/Check.cs
vendored
Normal file
34
Assets/ThirdParty/DestroyIt/Scripts/Runtime/Helpers/Check.cs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DestroyIt
|
||||
{
|
||||
public static class Check
|
||||
{
|
||||
public static bool IsDefaultParticleAssigned()
|
||||
{
|
||||
if (DestructionManager.Instance == null) return false;
|
||||
|
||||
if (DestructionManager.Instance.defaultParticle == null)
|
||||
{
|
||||
Debug.LogError("DestructionManager: Default Particle is not assigned. You should assign a default particle effect for simple destructible objects.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool LayerExists(string layerName, bool logMessage)
|
||||
{
|
||||
if (DestructionManager.Instance == null) return false;
|
||||
|
||||
int layer = LayerMask.NameToLayer(layerName);
|
||||
if (layer == -1)
|
||||
{
|
||||
if (logMessage)
|
||||
Debug.LogWarning(String.Format("[DestroyIt Core] Layer \"{0}\" does not exist. Please add a layer named \"{0}\" to your project.", layerName));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user