Example #1
0
        public static LevelData LoadLevel(byte[] data)
        {
            LevelData levelData = BinaryClassChunk.FromData <LevelData>(new BitBuffer(data, false));

            if (levelData != null && levelData.GetResult() != DeserializeResult.InvalidMagicNumber)
            {
                return(levelData);
            }
            Promise <LevelData> promise = Tasker.Task <LevelData>((Func <LevelData>)(() => DuckFile.ConvertLevel(data)));

            promise.WaitForComplete();
            return(promise.Result);
        }