예제 #1
0
        public SlideModel ExtractModel()
        {
            var model = new SlideModel();

            model.name     = name;
            model.position = transform.position;

            foreach (var comp in GetComponentsInChildren <AbstractIMComponent>())
            {
                model.components.Add(comp.model);
            }
            return(model);
        }
예제 #2
0
        public PresentationModel MakeDefault()
        {
            var model = new PresentationModel();

            var slide1 = new SlideModel();

            slide1.name = "Test slide 1";
            model.slides.Add(slide1);

            var slide2 = new SlideModel();

            slide2.name = "Test slide 2";
            model.slides.Add(slide2);

            return(model);
        }
예제 #3
0
        public void SetModel(PresentationManager manager, SlideModel slideModel)
        {
            this.manager       = manager;
            name               = slideModel.name;
            transform.position = slideModel.position;

            if (labelText != null)
            {
                labelText.text = name;
            }

            foreach (var compModel in slideModel.components)
            {
                var comp = manager.InstantiateComponent(compModel);
                if (comp != null)
                {
                    comp.transform.parent = transform;
                }
            }
        }