本文整理匯總了C#中System.Xml.XmlElement.GetInt方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlElement.GetInt方法的具體用法?C# XmlElement.GetInt怎麽用?C# XmlElement.GetInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlElement
的用法示例。
在下文中一共展示了XmlElement.GetInt方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetTimelineKey
protected TimelineKey GetTimelineKey(XmlElement element, Animation animation)
{
int timeline = element.GetInt("timeline", 0);
int key = element.GetInt("key", 0);
var timelineObj = animation.GetTimeline(timeline);
if (timelineObj == null)
{
Debug.LogError(String.Format(
System.Globalization.CultureInfo.InvariantCulture,
"Unable to find timeline {0} in animation {1}",
timeline,
animation.Id));
}
return timelineObj.GetKey(key);
}
示例2: GetFile
File GetFile(XmlElement element)
{
var folderId = element.GetInt("folder", -1);
var fileId = element.GetInt("file", -1);
File file = null;
var folder = Timeline.Animation.Entity.Scml.GetFolder(folderId);
if (folder != null)
{
file = folder.GetFile(fileId);
if (file == null)
{
Debug.LogError(string.Format("File Not Found! folder: {0} file: {1}", folderId, fileId));
}
}
else
{
Debug.LogError(string.Format("Folder Not Found! folder: {0}", folderId));
}
return file;
}
示例3: Parse
protected virtual void Parse(XmlElement element, Entity entity)
{
Entity = entity;
Name = element.GetString("name", "");
Length_Ms = element.GetInt("length", -1);
LoopType = LoopTypeUtils.Parse(element);
LoopTo = element.GetInt("loop_to", 0);
LoadTimelines(element);
LoadMainline(element);
}
示例4: Parse
protected override void Parse(XmlElement element)
{
base.Parse(element);
ZIndex = element.GetInt("z_index", Id);
}
示例5: Parse
protected virtual void Parse(XmlElement element)
{
Id = element.GetInt("id", -1);
}
示例6: Parse
private void Parse(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
{
Referenced = GetTimelineKey(element, animation);
int parentId = element.GetInt("parent", -1);
if(parentId >= 0)
{
Parent = parentKey.GetBoneRef(parentId);
}
}
示例7: Parse
protected virtual void Parse(XmlElement element)
{
Vector2 position;
position.x = element.GetFloat("x", 0.0f);
position.y = element.GetFloat("y", 0.0f);
Position = position;
Vector2 scale = Vector2.one;
scale.x = element.GetFloat("scale_x", 1.0f);
scale.y = element.GetFloat("scale_y", 1.0f);
Scale = scale;
Angle_Deg = element.GetFloat("angle", 0.0f);
int spinVal = element.GetInt("spin", 1);
Spin = (spinVal == -1) ? SpinDirection.Clockwise : SpinDirection.CounterClockwise;
}
示例8: Parse
protected override void Parse(XmlElement element)
{
base.Parse(element);
Time_Ms = element.GetInt("time", 0);
}
示例9: Parse
protected virtual void Parse(XmlElement element, Folder folder)
{
Folder = folder;
var type = element.GetString("type", "image");
switch(type)
{
case "image":
FileType = FileType.Image;
break;
case "atlas_image":
FileType = FileType.AtlasImage;
break;
case "sound_effect":
FileType = FileType.SoundEffect;
break;
case "entity":
FileType = FileType.Entity;
break;
default:
FileType = FileType.INVALID_TYPE;
break;
}
Name = element.GetString("name", "");
Vector2 pivot;
pivot.x = element.GetFloat("pivot_x", 0.0f);
pivot.y = element.GetFloat("pivot_y", 0.0f);
Pivot = pivot;
Vector2 size;
size.x = element.GetInt("width", 0);
size.y = element.GetInt("height", 0);
Size = size;
Vector2 offset;
offset.x = element.GetInt("offset_x", 0);
offset.y = element.GetInt("offset_y", 0);
Offset = offset;
Vector2 originalSize;
originalSize.x = element.GetInt("original_width", 0);
originalSize.y = element.GetInt("original_height", 0);
OriginalSize = originalSize;
}
示例10: Parse
protected virtual void Parse(XmlElement element)
{
Vector2 position;
position.x = element.GetFloat("x", 0.0f);
position.y = element.GetFloat("y", 0.0f);
Position = position;
Vector2 scale = Vector2.one;
scale.x = element.GetFloat("scale_x", 1.0f);
scale.y = element.GetFloat("scale_y", 1.0f);
Scale = scale;
Angle_Deg = element.GetFloat("angle", 0.0f);
Spin = (SpinDirection)element.GetInt("spin", 1);
}