Resolve WES-90 "Integrate signpredictor in courses"
This commit is contained in:
committed by
Jerome Coudron
parent
1a75791d62
commit
746906294b
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user