当前位置: 首页>>代码示例>>C#>>正文


C# XmlElement.GetAttribute方法代码示例

本文整理汇总了C#中XmlElement.GetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElement.GetAttribute方法的具体用法?C# XmlElement.GetAttribute怎么用?C# XmlElement.GetAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlElement的用法示例。


在下文中一共展示了XmlElement.GetAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseElement

    public override void ParseElement(XmlElement element)
    {
        string tmpArgVal = "";

        tmpArgVal = element.GetAttribute("type");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            if (tmpArgVal.Equals("none"))
                transition.setType(Transition.TYPE_NONE);
            else if (tmpArgVal.Equals("fadein"))
                transition.setType(Transition.TYPE_FADEIN);
            else if (tmpArgVal.Equals("vertical"))
                transition.setType(Transition.TYPE_VERTICAL);
            else if (tmpArgVal.Equals("horizontal"))
                transition.setType(Transition.TYPE_HORIZONTAL);
        }

        tmpArgVal = element.GetAttribute("time");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            transition.setTime(long.Parse(tmpArgVal));
        }

        animation.getTransitions().Add(transition);
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:25,代码来源:TransitionSubParser_.cs

示例2: Rot

 //! initializes from passed-in xml element, in format <someelement x="..." y="..." z="..." s="..."/>
 public Rot( XmlElement xmlelement )
 {
     x = Convert.ToDouble( xmlelement.GetAttribute( "x" ) );
         y = Convert.ToDouble( xmlelement.GetAttribute( "y" ) );
         z = Convert.ToDouble( xmlelement.GetAttribute( "z" ) );
         s = Convert.ToDouble( xmlelement.GetAttribute( "s" ) );
 }
开发者ID:hughperkins,项目名称:SpringMapDesigner,代码行数:8,代码来源:Rot.cs

示例3: loadNode

    private static DialogNode loadNode(XmlElement xmlEl,
        ref Conversation conversation, 
        ref List<DialogResponse> respWithoutChildren,
        ref List<DialogResponse> respThatSwitchConv)
    {
        string id = xmlEl.GetAttribute("id");
        string npcPhrase = xmlEl.GetAttribute("npcPhrase");
        //string voiceFile = xmlEl.GetAttribute("voiceFile");
        DialogNode node = new DialogNode(id, npcPhrase);

        XmlNodeList responsesXNL = xmlEl.ChildNodes;
        for (int j = 0; j < responsesXNL.Count; j++)
        {
            XmlElement responseXE = (XmlElement)responsesXNL[j];
            string pcPhrase = responseXE.GetAttribute("pcPhrase");
            string link = responseXE.GetAttribute("link");
            ResponseLinkType linkType = ResponseLinkType.dialogNode;
            if (responseXE.GetAttribute("linkType").
                Equals("dialogNode"))
                linkType = ResponseLinkType.dialogNode;
            else if (responseXE.GetAttribute("linkType").
                Equals("endConversation"))
                linkType = ResponseLinkType.endConversation;
            else
                linkType = ResponseLinkType.endAndChangeConversation;

            string switchConv = responseXE.
                GetAttribute("switchConversation");
            bool onlyAllowOnce = bool.Parse(responseXE.
                GetAttribute("onlyAllowOnce"));

            DialogResponse response = new DialogResponse(pcPhrase, link,
                onlyAllowOnce, linkType, switchConv);
            node.addResponse(response);
            if (responseXE.HasChildNodes)
            {
                XmlElement childNode = (XmlElement)responseXE.FirstChild;
                DialogNode dn = loadNode(childNode, ref conversation,
                    ref respWithoutChildren, ref respThatSwitchConv);
                response.childNode = dn;
                conversation.addDialogNode(dn);
            }
            else if (linkType == ResponseLinkType.dialogNode)
                respWithoutChildren.Add(response);
            if (linkType == ResponseLinkType.endAndChangeConversation)
                respThatSwitchConv.Add(response);
        }
        return node;
    }
开发者ID:VicBoss,项目名称:KR,代码行数:49,代码来源:XmlReader.cs

示例4: Conversation

    public Conversation(XmlElement element, LineCatalogue catalogue)
    {
        persistentConversation = new PersistentConversation();
        persistentConversation.name = element.GetAttribute("name");

        if(SaveLoad.SaveExits()) {
            PersistentConversation tmp = (PersistentConversation)SaveLoad.ReadSaveFile(PersistentConversation.GetSaveFileName(persistentConversation.name));
            if(tmp != null) {
                persistentConversation = tmp;
            }
            else {
                SaveLoad.ResetSave();
            }

        }

        //Debug.Log("Conversation.Conversation() name=" + persistentConversation.name );
        participants = new ArrayList();
        XmlNodeList participantNodeList = element.GetElementsByTagName("participant");
        foreach (XmlElement participantElement in participantNodeList){
            string participantName = participantElement.GetAttribute("name");
            participants.Add(CharacterManager.GetCharacter(participantName));
        }

        XmlElement rootLineElement = (XmlElement)element.GetElementsByTagName("root_line").Item(0);
        rootLine = new RootLine(rootLineElement, catalogue, this);
        rootLine.ConnectLinks(catalogue);
        currentController = null;
    }
开发者ID:kiichi7,项目名称:Lies_and_Seductions,代码行数:29,代码来源:Conversation.cs

示例5: ParseElement

    public override void ParseElement(XmlElement element)
    {
        XmlNodeList
            conditions = element.SelectNodes("condition");

        string tmpArgVal;

        int x = 0, y = 0, width = 0, height = 0;

        tmpArgVal = element.GetAttribute("x");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            x = int.Parse(tmpArgVal);
        }
        tmpArgVal = element.GetAttribute("y");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            y = int.Parse(tmpArgVal);
        }
        tmpArgVal = element.GetAttribute("width");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            width = int.Parse(tmpArgVal);
        }
        tmpArgVal = element.GetAttribute("height");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            height = int.Parse(tmpArgVal);
        }
        barrier = new Barrier(generateId(), x, y, width, height);

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

        foreach (XmlElement ell in conditions)
        {
            currentConditions = new Conditions();
            new ConditionSubParser_(currentConditions, chapter).ParseElement(ell);
            this.barrier.setConditions(currentConditions);
        }

        scene.addBarrier(barrier);
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:43,代码来源:BarrierSubParser_.cs

示例6: DeserializeElement

            public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
            {
                if (!parent.HasAttribute("type"))
                    throw new ArgumentException("Element has no Type attribute");

                ReadFromXmlFunc func;
                if (DeserialiseMap.TryGetValue(parent.GetAttribute("type"), out func))
                    return func(parent, parentElement, _solution, _unitTestElementFactory);

                throw new ArgumentException("Element has no Type attribute");
            }
开发者ID:briandonahue,项目名称:simple-testing,代码行数:11,代码来源:SimpleTestingElementSerializer.cs

示例7: AbstractLine

 public AbstractLine(XmlElement element, LineCatalogue catalogue, Conversation conversation)
 {
     responses = new ArrayList();
     int lineId = Int32.Parse(element.GetAttribute("id"));
     catalogue.AddLine(lineId, this);
     string responseSpeakerTypeString = element.GetAttribute("response_speaker_type");
     if (responseSpeakerTypeString.Equals("PC")){
         responseSpeakerType = SpeakerType.PC;
     } else if (responseSpeakerTypeString.Equals("NPC")){
         responseSpeakerType = SpeakerType.NPC;
     }
     XmlNodeList nodeList = element.ChildNodes;
     for (int i = 0; i < nodeList.Count; i++){
         XmlElement responseElement = (XmlElement)nodeList.Item(i);
         //Debug.Log("AbstractLine.AbstractLine(): responceElement=" + responseElement.ToString());
         if (responseElement.Name.Equals("regular_line")){
             responses.Add(new RegularLine(responseElement, catalogue, conversation));
         } else {
             responses.Add(new Link(responseElement, catalogue));
         }
     }
     haveConnectedLinks = false;
 }
开发者ID:kiichi7,项目名称:Lies_and_Seductions,代码行数:23,代码来源:AbstractLine.cs

示例8: RegularLine

 public RegularLine(XmlElement element, LineCatalogue catalogue, Conversation conversation)
     : base(element, catalogue, conversation)
 {
     text = element.GetAttribute("text");
     speakerName = element.GetAttribute("speaker");
     if (speakerName.Equals("")){
         speakerName = "Abby";
     }
     prerequisite = new Prerequisite(element.GetAttribute("prerequisite"), speakerName, conversation);
     consequence = new Consequence(element.GetAttribute("consequence"), speakerName, conversation);
     cameraAngle = CameraAngle.GetCameraAngle(element.GetAttribute("camera_angle"));
     emotion = Emotion.GetEmotion(element.GetAttribute("expression"));
     id = element.GetAttribute("id");
 }
开发者ID:kiichi7,项目名称:Lies_and_Seductions,代码行数:14,代码来源:RegularLine.cs

示例9: parse

 public void parse(XmlElement xmlElement)
 {
     string tmpStr;
     string[] tmpStrs;
     int i;
     this.id = xmlElement.GetAttribute("Id");
     this.name = xmlElement.GetAttribute("Name");
     this.description = xmlElement.GetAttribute("Description");
     this.type = xmlElement.GetAttribute("Type");
     this.hitPoint = int.Parse(xmlElement.GetAttribute("HitPoint"));
     this.mobilityBase = int.Parse(xmlElement.GetAttribute("Mobility"));
     this.attackBase = int.Parse(xmlElement.GetAttribute("AttackPower"));
     //this.defenceBase = int.Parse(xmlElement.GetAttribute("Defence"));
     string range = xmlElement.GetAttribute("AttackRange");
     string[] rangeList = range.Split(',');
     if ( rangeList.Length == 1 )
     {
         this.minAttackRange = 0;
         this.maxAttackRange = int.Parse(rangeList[0]);
     }
     else
     {
         this.minAttackRange = int.Parse(rangeList[0]);
         this.maxAttackRange = int.Parse(rangeList[1]);
     }
     tmpStr = xmlElement.GetAttribute("isEnable");
     isEnable = tmpStr == "" ? 0 : int.Parse(tmpStr);
     this.cardTexture = xmlElement.GetAttribute("CardTexture");
     this.characterTexture = xmlElement.GetAttribute("CharacterTexture");
     if ( this.characterTexture == "" )
     {
         this.characterTexture = "Unit_1";
     }
     // 技能
     tmpStr = xmlElement.GetAttribute("Skills");
     tmpStrs = tmpStr.Split(',');
     List<string> strList = new List<string>();
     for (i=0;i<tmpStrs.Length;i++)
     {
         if ( tmpStrs[i] != "" )
         {
             strList.Add(tmpStrs[i]);
         }
     }
     this.skillIds = strList.ToArray();
 }
开发者ID:LostTemple1990,项目名称:TouHouExploding,代码行数:46,代码来源:UnitCfg.cs

示例10: LoadTerritoryTagMetadata

 public static PhoneMetadata.Builder LoadTerritoryTagMetadata(String regionCode, XmlElement element,
     String nationalPrefix,
     String nationalPrefixFormattingRule)
 {
     var metadata = new PhoneMetadata.Builder();
     metadata.SetId(regionCode);
     metadata.SetCountryCode(int.Parse(element.GetAttribute(COUNTRY_CODE)));
     if (element.HasAttribute(LEADING_DIGITS))
         metadata.SetLeadingDigits(ValidateRE(element.GetAttribute(LEADING_DIGITS)));
     metadata.SetInternationalPrefix(ValidateRE(element.GetAttribute(INTERNATIONAL_PREFIX)));
     if (element.HasAttribute(PREFERRED_INTERNATIONAL_PREFIX))
     {
         String preferredInternationalPrefix = element.GetAttribute(PREFERRED_INTERNATIONAL_PREFIX);
         metadata.SetPreferredInternationalPrefix(preferredInternationalPrefix);
     }
     if (element.HasAttribute(NATIONAL_PREFIX_FOR_PARSING))
     {
         metadata.SetNationalPrefixForParsing(
             ValidateRE(element.GetAttribute(NATIONAL_PREFIX_FOR_PARSING)));
         if (element.HasAttribute(NATIONAL_PREFIX_TRANSFORM_RULE))
         {
             metadata.SetNationalPrefixTransformRule(
             ValidateRE(element.GetAttribute(NATIONAL_PREFIX_TRANSFORM_RULE)));
         }
     }
     if (!String.IsNullOrEmpty(nationalPrefix))
     {
         metadata.SetNationalPrefix(nationalPrefix);
         if (!metadata.HasNationalPrefixForParsing)
             metadata.SetNationalPrefixForParsing(nationalPrefix);
     }
     if (element.HasAttribute(PREFERRED_EXTN_PREFIX))
     {
         metadata.SetPreferredExtnPrefix(element.GetAttribute(PREFERRED_EXTN_PREFIX));
     }
     if (element.HasAttribute(MAIN_COUNTRY_FOR_CODE))
     {
         metadata.SetMainCountryForCode(true);
     }
     if (element.HasAttribute(LEADING_ZERO_POSSIBLE))
     {
         metadata.SetLeadingZeroPossible(true);
     }
     return metadata;
 }
开发者ID:sariputra,项目名称:libphonenumber-wp7,代码行数:45,代码来源:XmlParser.cs

示例11: ParseSingleActionElement

	// this kind of message is from the opencog, and it's not a completed plan,
	// but a single action that current the robot want to do
	private void ParseSingleActionElement(XmlElement element)
	{
		OCActionController oca = GameObject.FindGameObjectWithTag("OCAGI").GetComponent<OCActionController>() as OCActionController;
		if(oca == null)
		{
			return;
		}
		
		string actionName = element.GetAttribute(OCEmbodimentXMLTags.NAME_ATTRIBUTE);
			
		if(actionName == "BuildBlockAtPosition")
		{
			int x = 0, y = 0, z = 0;
			XmlNodeList list = element.GetElementsByTagName(OCEmbodimentXMLTags.PARAMETER_ELEMENT);
			for(int i = 0; i < list.Count; i++)
			{
				XmlElement paraElement = (XmlElement)list.Item(i);
				string paraName = paraElement.GetAttribute(OCEmbodimentXMLTags.NAME_ATTRIBUTE);
				if(paraName == "x")
				{
					x = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				} else if(paraName == "y")
				{
					y = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				} else if(paraName == "z")
				{
					z = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				}
				
			}
			Vector3i blockBuildPoint = new Vector3i(x, y, z);
			
			oca.BuildBlockAtPosition(blockBuildPoint);
		} else if(actionName == "MoveToCoordinate")
		{
			int x = 0, y = 0, z = 0;
			XmlNodeList list = element.GetElementsByTagName(OCEmbodimentXMLTags.PARAMETER_ELEMENT);
			for(int i = 0; i < list.Count; i++)
			{
				XmlElement paraElement = (XmlElement)list.Item(i);
				string paraName = paraElement.GetAttribute(OCEmbodimentXMLTags.NAME_ATTRIBUTE);
				if(paraName == "x")
				{
					x = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				} else if(paraName == "y")
				{
					y = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				} else if(paraName == "z")
				{
					z = int.Parse(paraElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));
				}
				
			}
			UnityEngine.Vector3 vec = new UnityEngine.Vector3(x, z, y);
			oca.MoveToCoordinate(vec);
		}
 
	}
开发者ID:Nemquae,项目名称:unity3d-opencog-game,代码行数:60,代码来源:OCConnectorSingleton.cs

示例12: ParsePsiDemandElement

	private void ParsePsiDemandElement(XmlElement element)
	{
		string avatarId = element.GetAttribute(OCEmbodimentXMLTags.ENTITY_ID_ATTRIBUTE);

		// Parse all demands and add them to a map.
		XmlNodeList list = element.GetElementsByTagName(OCEmbodimentXMLTags.DEMAND_ELEMENT);
		for(int i = 0; i < list.Count; i++)
		{
			XmlElement demandElement = (XmlElement)list.Item(i);
			string demand = demandElement.GetAttribute(OCEmbodimentXMLTags.NAME_ATTRIBUTE);
			float value = float.Parse(demandElement.GetAttribute(OCEmbodimentXMLTags.VALUE_ATTRIBUTE));

			// group all demands to be updated only once
			_demandValueMap[demand] = value;

			OCLogger.Debugging("Avatar[" + _ID + "] -> parsePsiDemandElement: Demand '" + demand + "' value '" + value + "'.");
		}
	}
开发者ID:Nemquae,项目名称:unity3d-opencog-game,代码行数:18,代码来源:OCConnectorSingleton.cs

示例13: ParseElement

    public override void ParseElement(XmlElement element)
    {
        XmlNodeList speakschar,
            speaksplayer,
            childs,
            effects,
            conditions;

        XmlNode end_conversation;

        string tmpArgVal;

        // Store the name
        conversationName = "";
        tmpArgVal = element.GetAttribute("id");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            conversationName = tmpArgVal;
        }

        graphNodes = new List<ConversationNode>();
        nodeLinks = new List<List<int>>();

        foreach (XmlElement el in element) {
            if (el.Name == "dialogue-node") {
                // Create the node depending of the tag
                editorX = editorY = int.MinValue;

                //If there is a "waitUserInteraction" attribute, store if the lines will wait until user interacts
                tmpArgVal = element.GetAttribute ("keepShowing");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    if (tmpArgVal.Equals ("yes"))
                        keepShowingDialogue = true;
                    else
                        keepShowingDialogue = false;
                }

                //If there is a "editor-x" and "editor-y" attributes
                tmpArgVal = element.GetAttribute ("editor-x");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    editorX = Mathf.Max (0, int.Parse (tmpArgVal));
                }

                tmpArgVal = element.GetAttribute ("editor-y");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    editorY = Mathf.Max (0, int.Parse (tmpArgVal));
                }

                currentNode = new DialogueConversationNode (keepShowingDialogue);
                if (editorX > int.MinValue) {
                    currentNode.setEditorX (editorX);
                }
                if (editorY > int.MinValue) {
                    currentNode.setEditorY (editorY);
                }

                // Create a new vector for the links of the current node
                currentLinks = new List<int> ();
                parseLines (currentNode, el);

                end_conversation = el.SelectSingleNode ("end-conversation");
                if (end_conversation != null)
                    effects = end_conversation.SelectNodes ("effect");
                else
                    effects = el.SelectNodes ("effect");

                foreach (XmlElement ell in effects) {
                    currentEffects = new Effects ();
                    new EffectSubParser_ (currentEffects, chapter).ParseElement (ell);
                    currentNode.setEffects (currentEffects);
                }

                // Add the current node to the node list, and the set of children references into the node links
                graphNodes.Add (currentNode);
                nodeLinks.Add (currentLinks);

            } else if (el.Name == "option-node") {

                editorX = editorY = int.MinValue;

                //If there is a "waitUserInteraction" attribute, store if the lines will wait until user interacts
                tmpArgVal = element.GetAttribute ("keepShowing");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    if (tmpArgVal.Equals ("yes"))
                        keepShowingDialogue = true;
                    else
                        keepShowingDialogue = false;
                }

                //If there is a "editor-x" and "editor-y" attributes
                tmpArgVal = element.GetAttribute ("editor-x");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    editorX = Mathf.Max (0, int.Parse (tmpArgVal));
                }
                tmpArgVal = element.GetAttribute ("editor-y");
                if (!string.IsNullOrEmpty (tmpArgVal)) {
                    editorY = Mathf.Max (0, int.Parse (tmpArgVal));
                }

                tmpArgVal = element.GetAttribute ("random");
//.........这里部分代码省略.........
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:101,代码来源:GraphConversationSubParser_.cs

示例14: GetInt

 int GetInt(XmlElement xmlelement, string attributename)
 {
     try
         {
             int value = Convert.ToInt32(xmlelement.GetAttribute(attributename));
             return value;
         }
         catch
         {
             EmergencyDialog.WarningMessage("In the config.xml file, the value " + attributename + " in section " + xmlelement.Name + " needs to be a whole number.  MapDesigner may not run correctly.");
             return 0;
         }
 }
开发者ID:hughperkins,项目名称:SpringMapDesigner,代码行数:13,代码来源:Config.cs

示例15: ParseElement

    public override void ParseElement(XmlElement element)
    {
        XmlNodeList
            speakschar = element.SelectNodes("speak-char"),
            speaksplayer = element.SelectNodes("speak-player"),
            responses = element.SelectNodes("response"),
            options = element.SelectNodes("option"),
            effects = element.SelectNodes("effect"),
            gosback = element.SelectNodes("go-back");

        string tmpArgVal;

        // Store the name
        string conversationName = "";

        tmpArgVal = element.GetAttribute("id");
        if (!string.IsNullOrEmpty(tmpArgVal))
        {
            conversationName = tmpArgVal;
        }

        // Create a dialogue node (which will be the root node) and add it to a new tree
        // The content of the tree will be built adding nodes directly to the root
        currentNode = new DialogueConversationNode();
        conversation = new TreeConversation(conversationName, currentNode);
        pastOptionNodes = new List<ConversationNode>();

        foreach (XmlElement el in speakschar)
        {
            // Set default name to "NPC"
            characterName = "NPC";
            audioPath = "";

            // If there is a "idTarget" attribute, store it
            tmpArgVal = el.GetAttribute("idTarget");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                characterName = tmpArgVal;
            }

            // If there is a "uri" attribute, store it as audio path
            tmpArgVal = el.GetAttribute("uri");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                audioPath = tmpArgVal;
            }

            // If there is a "uri" attribute, store it as audio path
            tmpArgVal = el.GetAttribute("synthesize");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                string response = tmpArgVal;
                if (response.Equals("yes"))
                    synthesizerVoice = true;
                else
                    synthesizerVoice = false;
            }

            // Store the read string into the current node, and then delete the string. The trim is performed so we
            // don't
            // have to worry with indentations or leading/trailing spaces
            ConversationLine line = new ConversationLine(characterName, el.InnerText);
            if (audioPath != null && !this.audioPath.Equals(""))
            {
                line.setAudioPath(audioPath);
            }

            if (synthesizerVoice != null)
                line.setSynthesizerVoice(synthesizerVoice);
            currentNode.addLine(line);

        }

        foreach (XmlElement el in speaksplayer)
        {
            audioPath = "";

            // If there is a "uri" attribute, store it as audio path
            tmpArgVal = el.GetAttribute("uri");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                audioPath = tmpArgVal;
            }
            // If there is a "uri" attribute, store it as audio path
            tmpArgVal = el.GetAttribute("synthesize");
            if (!string.IsNullOrEmpty(tmpArgVal))
            {
                string response = tmpArgVal;
                if (response.Equals("yes"))
                    synthesizerVoice = true;
                else
                    synthesizerVoice = false;
            }

            // Store the read string into the current node, and then delete the string. The trim is performed so we
            // don't have to worry with indentations or leading/trailing spaces
            ConversationLine line = new ConversationLine(ConversationLine.PLAYER, el.InnerText);
            if (audioPath != null && !this.audioPath.Equals(""))
            {
                line.setAudioPath(audioPath);
//.........这里部分代码省略.........
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:101,代码来源:TreeConversationSubParser_.cs


注:本文中的XmlElement.GetAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。