Пример #1
0
        public static GameProjectLoadResult LoadProject(GameProjectData objectData)
        {
            GameProjectLoadResult result;

            if (objectData == null || objectData.ObjectData == null)
            {
                result = null;
            }
            else
            {
                GameProjectLoadResult          gameProjectLoadResult = new GameProjectLoadResult();
                Dictionary <int, VisualObject> dictionary            = new Dictionary <int, VisualObject>();
                CSCocosHelp.RefreshLayoutSystemState(false);
                BaseRecorder.IsCreateDefaultRecorder     = false;
                gameProjectLoadResult.RootObject         = GameProjectLoader.ConvertObject(objectData.ObjectData, gameProjectLoadResult, dictionary);
                gameProjectLoadResult.RootObject.CanEdit = true;
                CSCocosHelp.RefreshLayoutSystemState(true);
                BaseRecorder.IsCreateDefaultRecorder = true;
                GameProjectLoader.RefreshObjectsRecorder(gameProjectLoadResult.RootObject);
                if (objectData.Animation != null)
                {
                    gameProjectLoadResult.TimelineAction = GameProjectLoader.ConvertTimeLineAction(objectData.Animation, gameProjectLoadResult.RootObject, dictionary);
                }
                result = gameProjectLoadResult;
            }
            return(result);
        }