當前位置: 首頁>>代碼示例>>C#>>正文


C# Animation.getFrames方法代碼示例

本文整理匯總了C#中Animation.getFrames方法的典型用法代碼示例。如果您正苦於以下問題:C# Animation.getFrames方法的具體用法?C# Animation.getFrames怎麽用?C# Animation.getFrames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Animation的用法示例。


在下文中一共展示了Animation.getFrames方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FrameSubParser

 public FrameSubParser(Animation animation)
     : base(null)
 {
     this.animation = animation;
     frame = new Frame(animation.getImageLoaderFactory());
     animation.getFrames().Add(frame);
 }
開發者ID:Synpheros,項目名稱:eAdventure4Unity,代碼行數:7,代碼來源:FrameSubParser.cs

示例2: Parse

    public void Parse(string path_)
    {
        XmlDocument xmld = new XmlDocument();
        xmld.Load(path_);

        XmlElement element = xmld.DocumentElement;

        XmlNodeList
            frames = element.SelectNodes("/animation/frame"),
            transitions = element.SelectNodes("/animation/transition"),
            resources = element.SelectNodes("/animation/resources"),
            assets;

        string tmpArgVal;

        XmlNode animationNode = element.SelectSingleNode("/animation");

        tmpArgVal = animationNode.Attributes["id"].Value;
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            animation = new Animation(tmpArgVal, factory);
            animation.getFrames().Clear();
            animation.getTransitions().Clear();
        }

        tmpArgVal = animationNode.Attributes["slides"].Value;
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            if (tmpArgVal.Equals("yes"))
                animation.setSlides(true);
            else
                animation.setSlides(false);
        }

        tmpArgVal = animationNode.Attributes["usetransitions"].Value;
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            if (tmpArgVal.Equals("yes"))
                animation.setUseTransitions(true);
            else
                animation.setUseTransitions(false);
        }

        if (element.SelectSingleNode("documentation") != null)
            animation.setDocumentation(element.SelectSingleNode("documentation").InnerText);

        foreach (XmlElement el in frames)
        {
            new FrameSubParser_(animation).ParseElement(el);
        }
        foreach (XmlElement el in transitions)
        {
            new TransitionSubParser_(animation).ParseElement(el);
        }

        foreach (XmlElement el in resources)
        {
            currentResources = new ResourcesUni();
            tmpArgVal = el.GetAttribute("name");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                currentResources.setName(el.GetAttribute(tmpArgVal));
            }

            assets = el.SelectNodes("asset");
            foreach (XmlElement ell in assets)
            {
                string type = "";
                string path = "";

                tmpArgVal = ell.GetAttribute("type");
                if (!string.IsNullOrEmpty(tmpArgVal))
                {
                    type = tmpArgVal;
                }
                tmpArgVal = ell.GetAttribute("uri");
                if (!string.IsNullOrEmpty(tmpArgVal))
                {
                    path = tmpArgVal;
                }
                currentResources.addAsset(type, path);
            }

            animation.addResources(currentResources);
        }
    }
開發者ID:Synpheros,項目名稱:eAdventure4Unity,代碼行數:86,代碼來源:AnimationHandler_.cs

示例3: startElement

    public override void startElement(string namespaceURI, string sName, string qName, Dictionary<string, string> attrs)
    {
        if (this.reading == READING_NONE)
        {

            if (qName.Equals("animation"))
            {
                foreach (KeyValuePair<string, string> entry in attrs)
                {
                    if (entry.Key.Equals("id"))
                    {
                        animation = new Animation(entry.Value.ToString(), factory);
                        animation.getFrames().Clear();
                        animation.getTransitions().Clear();
                    }

                    if (entry.Key.Equals("slides"))
                    {
                        if (entry.Value.ToString().Equals("yes"))
                            animation.setSlides(true);
                        else
                            animation.setSlides(false);
                    }

                    if (entry.Key.Equals("usetransitions"))
                    {
                        if (entry.Value.ToString().Equals("yes"))
                            animation.setUseTransitions(true);
                        else
                            animation.setUseTransitions(false);
                    }
                }
            }

            if (qName.Equals("documentation"))
            {
                currentstring = string.Empty;
            }

            if (qName.Equals("resources"))
            {
                currentResources = new ResourcesUni();

                foreach (KeyValuePair<string, string> entry in attrs)
                {
                    if (entry.Key.Equals("name"))
                        currentResources.setName(entry.Value.ToString());
                }
            }

            else if (qName.Equals("asset"))
            {
                string type = "";
                string path = "";

                foreach (KeyValuePair<string, string> entry in attrs)
                {
                    if (entry.Key.Equals("type"))
                        type = entry.Value.ToString();
                    if (entry.Key.Equals("uri"))
                        path = entry.Value.ToString();
                }

                currentResources.addAsset(type, path);
            }

            if (qName.Equals("frame"))
            {
                subParser = new FrameSubParser(animation);
                reading = READING_FRAME;
            }

            if (qName.Equals("transition"))
            {
                subParser = new TransitionSubParser(animation);
                reading = READING_TRANSITION;
            }
        }
        if (reading != READING_NONE)
        {
            subParser.startElement(namespaceURI, sName, qName, attrs);
        }
    }
開發者ID:Synpheros,項目名稱:eAdventure4Unity,代碼行數:83,代碼來源:AnimationHandler.cs


注:本文中的Animation.getFrames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。