Beispiel #1
0
        public ScriptAnalyzeDataManager(System.IO.FileInfo[] fileInfos, bool isUtf16, bool isDebug, Allocator allocator)
#endif
        {
            if (fileInfos is null)
            {
                throw new ArgumentNullException();
            }
            this.allocator = allocator;
#if UNITY_EDITOR
            ShowLog = showLog;
#endif
            FileInfos = fileInfos;
            FullPaths = new string[FileInfos.Length];
            Names     = new string[FileInfos.Length];
            for (int i = 0; i < FullPaths.Length; i++)
            {
                FullPaths[i] = FileInfos[i].FullName;
                Names[i]     = FileInfos[i].Name;
            }
            ScriptPtr              = ScriptAnalyzeDataManager_Internal.CreatePtr(FullPaths.Length, allocator);
            Status                 = (InterpreterStatus *)UnsafeUtility.Malloc(sizeof(InterpreterStatus), 4, allocator);
            handles                = new NativeList <JobHandle>(FullPaths.Length, allocator);
            jobs                   = new NativeArray <ParseJob>(FullPaths.Length, allocator);
            commonDatas            = new NativeArray <ParseJob.CommonData>(FullPaths.Length, allocator);
            InitialReadTempDataPtr = InitialReadTempData.CreatePtr(FileInfos, ScriptPtr->FileLength, &ScriptPtr->Files, isUtf16, isDebug);
            currentStage           = Stage.PreLoading;
        }
Beispiel #2
0
        public static ScriptAnalyzeDataManager_Internal *CreatePtr(int length, Allocator allocator)
        {
            var answer = (ScriptAnalyzeDataManager_Internal *)UnsafeUtility.Malloc(sizeof(ScriptAnalyzeDataManager_Internal), 4, allocator);

            answer[0] = new ScriptAnalyzeDataManager_Internal(length, allocator);
            return(answer);
        }