private static ISlideshow LoadSlides(string inputUrl, Func <slideshowSlideContent, ISlideSection, IContent> factoryLoader) { JabberPoint.Data.slideshow data; JabberPoint.Domain.Slideshow slideshow; SlideshowXmlLoader loader = new SlideshowXmlLoader(inputUrl); data = loader.RootObject; slideshow = new Slideshow(); foreach (var dataslide in data.slides) { ISlideSection slide = new SlideSection(slideshow); slideshow.Slides.Add(slide); foreach (var datacontent in dataslide.contents) { slide.Contents.Add(slide.Contents.Count, factoryLoader(datacontent, slide)); } } SetMetaData(slideshow, data.metainfos); return(slideshow); }
void Start() { sections = new List <SlideSection>(); SlideSection section = Instantiate(slideSectionPrefab, transform).GetComponent <SlideSection>(); section.Init(Vector3.zero, Vector3.forward, maxRadius, sectionLength); sections.Add(section); generatedSections += 1; UpdateSections(); }
public static void SetFooter(ISlideshow slideshow) { slideshow.Footers.Clear(); var theme = Themes.GetSingleton(); foreach (var footer in theme.GetFooterData()) { ISlideSection footerSection = new SlideSection(slideshow); foreach (var footerdata in footer.Value) { footerSection.Contents.Add(footerSection.Contents.Count, new TextContentFactory(footerdata.Text, footerdata.Level).GetContent(slideshow)); } slideshow.Footers.Add(footer.Key, footerSection); } }
void UpdateSections() { for (int i = 0; i < centerProgress + forwardBufferSections - generatedSections; i++) { int sign = Mathf.RoundToInt(Random.value) * 2 - 1; float radius = (Random.Range(0, 1000) / 1000.0f) * (maxRadius - minRadius) + minRadius; SlideSection last = sections[sections.Count - 1]; SlideSection section = Instantiate(slideSectionPrefab, transform).GetComponent <SlideSection>(); section.Init(last.endPoint, last.endDirection, radius * sign, sectionLength); sections.Add(section); generatedSections += 1; } int sectionsToDelete = Mathf.Max(sections.Count - (forwardBufferSections + rearBufferSections), 0); for (int i = 0; i < sectionsToDelete; i++) { Destroy(sections[i].gameObject); } sections.RemoveRange(0, sectionsToDelete); }
void Awake() { section = GetComponent <SlideSection>(); }