/// <summary> /// Build unity objects from parsed gltf /// </summary> public static void Load(this ImporterContext self) { var meassureTime = new ImporterContextSpeedLog(); var task = self.LoadAsync(default(ImmediateCaller), meassureTime.MeasureTime); if (!task.IsCompleted) { throw new Exception(); } #if VRM_DEVELOP Debug.Log(meassureTime.GetSpeedLog()); #endif }
/// <summary> /// Build unity objects from parsed gltf /// </summary> public static void Load(this ImporterContext self) { var meassureTime = new ImporterContextSpeedLog(); var task = self.LoadAsync(default(ImmediateCaller), meassureTime.MeasureTime); if (!task.IsCompleted) { throw new Exception(); } if (task.IsFaulted) { throw new AggregateException(task.Exception); } #if VRM_DEVELOP Debug.Log($"{self.Parser.TargetPath}: {meassureTime.GetSpeedLog()}"); #endif }
/// <summary> /// Build unity objects from parsed gltf /// </summary> public static RuntimeGltfInstance Load(this ImporterContext self) { var meassureTime = new ImporterContextSpeedLog(); var task = self.LoadAsync(new ImmediateCaller(), meassureTime.MeasureTime); if (!task.IsCompleted) { throw new Exception(); } if (task.IsFaulted) { throw new AggregateException(task.Exception); } #if VRM_DEVELOP Debug.Log($"{self.Data.TargetPath}: {meassureTime.GetSpeedLog()}"); #endif return(task.Result); }
/// <summary> /// Build unity objects from parsed gltf /// </summary> public static void Load(this ImporterContext self) { var meassureTime = new ImporterContextSpeedLog(); using (var queue = TaskQueue.Create()) { var task = self.LoadAsync(meassureTime.MeasureTime); // 中断された await を消化する while (!task.IsCompleted) { // execute synchronous queue.ExecuteOneCallback(); } } #if VRM_DEVELOP Debug.Log(meassureTime.GetSpeedLog()); #endif }