protected virtual void OnLoaded(GameObject model, VRMMetaObject meta = null) { Debug.Log(model + "has been loaded"); OnModelLoaded?.Invoke(model); if (meta != null) { OnMetaDataLoaded?.Invoke(meta); } }
private IModel InternalLoad(string modelName, bool throwOnFailure) { if (_models.TryGetValue(modelName, out var model)) { return(model); } model = LoadModel(modelName); if (model != null) { _models.Add(modelName, model); OnModelLoaded?.Invoke(model); } else { if (FallbackModel == null) { if (throwOnFailure) { throw new InvalidOperationException($"Couldn't load model {modelName}; no fallback model loaded"); } //Used by fallback model loading return(null); } model = FallbackModel; //Insert it anyway to avoid constant load attempts _models.Add(modelName, model); } return(model); }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously public async Task __ModelLoaded__() { OnModelLoaded?.Invoke(); }
public void __ModelLoaded__() { OnModelLoaded?.Invoke(); }
private void AddModel(string modelName, IModel model) { _models.Add(modelName, model); OnModelLoaded?.Invoke(model); }