Resolve WES-90 "Integrate signpredictor in courses"

This commit is contained in:
Louis Adriaens
2023-03-18 19:53:17 +00:00
committed by Jerome Coudron
parent 1a75791d62
commit 746906294b
463 changed files with 99422 additions and 1187 deletions

View File

@@ -0,0 +1,42 @@
using System;
using UnityEngine;
namespace Unity.Barracuda
{
/// <summary>
/// Barracuda Model asset
/// </summary>
public class NNModel : ScriptableObject
{
/// <summary>
/// Model data
/// </summary>
[HideInInspector]
public NNModelData modelData;
[NonSerialized]
Model m_Model;
[NonSerialized]
float m_LastLoaded;
internal Model GetDeserializedModel(bool verbose = false, bool skipWeights = true)
{
if (m_Model == null)
{
m_Model = ModelLoader.Load(this, verbose, skipWeights);
m_LastLoaded = Time.realtimeSinceStartup;
}
return m_Model;
}
void OnEnable()
{
// Used for detecting re-serialized models (e.g. adjusting import settings in the editor)
// Force a reload on next access
if (Time.realtimeSinceStartup >= m_LastLoaded)
m_Model = null;
}
}
}