本文整理匯總了C#中Attributes類的典型用法代碼示例。如果您正苦於以下問題:C# Attributes類的具體用法?C# Attributes怎麽用?C# Attributes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Attributes類屬於命名空間,在下文中一共展示了Attributes類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Start
void Start()
{
nma = GetComponent<NavMeshAgent>();
attri = GetComponent<Attributes>();
StartCoroutine("WaitATick");
nma.stoppingDistance = attri.range;
}
示例2: attribute
protected Attributes _attributes; // start tags get attributes on construction. End tags get attributes on first new attribute (but only for parser convenience, not used).
public void NewAttribute()
{
if (_attributes == null)
{
_attributes = new Attributes();
}
if (_pendingAttributeName != null)
{
NSoup.Nodes.Attribute attribute;
if (_pendingAttributeValue == null)
{
attribute = new NSoup.Nodes.Attribute(_pendingAttributeName, "");
}
else
{
attribute = new NSoup.Nodes.Attribute(_pendingAttributeName, _pendingAttributeValue.ToString());
}
_attributes.Add(attribute);
}
_pendingAttributeName = null;
if (_pendingAttributeValue != null)
{
_pendingAttributeValue.Remove(0, _pendingAttributeValue.Length);
}
}
示例3: ControllerContext
public ControllerContext(ILog log, Attributes startupAttributes)
{
Ensure.NotNull(log, nameof(log));
Log = log;
StartupAttributes = startupAttributes ?? new Attributes();
}
示例4: CopyAttributes
private static Attributes CopyAttributes(Attributes source) {
if (source == null) {
return null;
} else {
return new Attributes(source.Name, source.Args, CopyAttributes(source.Prev));
}
}
示例5: Calculate
public override int Calculate(Attributes propertyAttrs, int val)
{
if (!Empty)
foreach (List<EffectNode> list in effects)
list.ForEach(node => node.Effect.Affect(propertyAttrs, node.Attributes, ref val));
return val;
}
示例6: Weapon
/// <summary>
/// Creates a new weapon with specified name and attributes.
/// </summary>
public Weapon(WeaponProperties data, CombatProperties propes, Attributes attri, StatusEffectProperties effect)
{
WeaponData = data;
CombatProperties = propes;
Attributes = attri;
Effect = effect;
}
示例7: NewAttribute
// attribute names are generally caught in one hop, not accumulated
// but values are accumulated, from e.g. & in hrefs
// start tags get attributes on construction. End tags get attributes on first new attribute (but only for parser convenience, not used).
internal void NewAttribute()
{
if (attributes == null)
{
attributes = new Attributes();
}
if (pendingAttributeName != null)
{
Attribute attribute;
if (pendingAttributeValue == null)
{
attribute = new Attribute(pendingAttributeName, string.Empty);
}
else
{
attribute = new Attribute(pendingAttributeName, pendingAttributeValue.ToString());
}
attributes.Put(attribute);
}
pendingAttributeName = null;
if (pendingAttributeValue != null)
{
pendingAttributeValue.Remove(0, pendingAttributeValue.Length);
}
}
示例8: equipment
public equipment(string name, equipSlots.equipmentType type, equipSlots.slots slot, int equipmentTier, int minlevel, int maxlevel, float health, float resource, float power, float defense, float mindmg, float maxdmg, float movespeed, float attackspeed, string flavortxt)
{
equipmentAttributes = new Attributes();
equipmentName = name;
equipmentType = type;
flavorText = flavortxt;
validSlot = slot;
tier = equipmentTier;
minlvl = minlevel;
maxlvl = maxlevel;
equipmentAttributes.Health = health;
equipmentAttributes.Resource = resource;
equipmentAttributes.Power = power;
equipmentAttributes.Defense = defense;
equipmentAttributes.MinDamage = mindmg;
equipmentAttributes.MaxDamage = maxdmg;
equipmentAttributes.AttackSpeed = attackspeed;
equipmentAttributes.MovementSpeed = movespeed;
slotList.Add("Head", equipSlots.slots.Head);
slotList.Add("Legs", equipSlots.slots.Legs);
slotList.Add("Feet", equipSlots.slots.Feet);
slotList.Add("Chest", equipSlots.slots.Chest);
slotList.Add("Main", equipSlots.slots.Main);
slotList.Add("Off", equipSlots.slots.Off);
twohand = false;
ranged = false;
onhit = "";
prefixname = "";
suffixname = "";
modelname = "default";
}
示例9: Screen
public Screen(int x, int y)
{
Width = x;
Height = y;
Buffer = new char[y * x];
Attributes = new Attributes[Buffer.Length];
}
示例10: affix
public affix(string name, equipSlots.affixtype type, float health, float resource, float power, float defense, float mindmg, float maxdmg, float movespeed, float attackspeed, equipSlots.slots[] validslots)
{
affixAttributes = new Attributes();
affixName = name;
affixType = type;
affixAttributes.Health = health;
affixAttributes.Resource = resource;
affixAttributes.Power = power;
affixAttributes.Defense = defense;
affixAttributes.MinDamage = mindmg;
affixAttributes.MaxDamage = maxdmg;
affixAttributes.AttackSpeed = attackspeed;
affixAttributes.MovementSpeed = movespeed;
foreach (equipSlots.slots slot in validslots)
{
affixSlots.Add(slot);
}
slotList.Add("Head", equipSlots.slots.Head);
slotList.Add("Legs", equipSlots.slots.Legs);
slotList.Add("Feet", equipSlots.slots.Feet);
slotList.Add("Chest", equipSlots.slots.Chest);
slotList.Add("Main", equipSlots.slots.Main);
slotList.Add("Off", equipSlots.slots.Off);
}
示例11: InitializeStats
public void InitializeStats(int level)
{
Attributes tempatts = new Attributes();
_entity = GetComponent<Entity>();
tempatts.Health = baseHP + scalingHP * (level - 1);
tempatts.Resource = baseResource + scalingResource * (level - 1);
tempatts.Power = basePower + scalingPower * (level - 1);
tempatts.Defense = baseDefense + scalingDefense * (level - 1);
tempatts.MinDamage = baseMinDmg + scalingMinDmg * (level - 1);
tempatts.MaxDamage = baseMaxDmg + scalingMaxDmg * (level - 1);
tempatts.MovementSpeed = baseMoveSpd + scalingMoveSpd * (level - 1);
tempatts.AttackSpeed = baseAttackSpd + scalingAttackSpd * (level - 1);
LootDropChance = UnityEngine.Random.Range(0f, 3f);
MinLootDrops = 1;
MaxLootDrops = 5;
_entity.baseAtt = tempatts;
GetComponent<Entity>().UpdateCurrentAttributes();
GetComponent<AIController>().doesWander = wanders;
GetComponent<AIController>().aggroRadius = _aggroRadius;
GetComponent<AIPursuit>().doesFlee= flees;
}
示例12: TestVideoConversion
internal string TestVideoConversion()
{
var readWriteFactory = new ReadWriteClassFactory();
var attributes = new Attributes
{
ReadWriterEnableHardwareTransforms = true,
SourceReaderEnableVideoProcessing = true
};
var readers = VideoFiles.Select(f => f.CreateSourceReader(readWriteFactory, attributes)).ToArray();
var testOuputFile = readers.First().FileName + ".tmp.test.wmv";
try
{
using (var sinkWriter = readWriteFactory.CreateSinkWriterFromURL(testOuputFile, attributes))
{
var writeToSink = ConnectStreams(readers, sinkWriter);
}
}
catch(Exception e)
{
return e.Message;
}
finally
{
if (readers != null)
foreach (var r in readers)
r.Dispose();
File.Delete(testOuputFile);
}
return null;
}
示例13: CreateSourceReader
public SourceReaderExtra CreateSourceReader(ReadWriteClassFactory readWriteFactory, Attributes attributes)
{
TraceDebug.WriteLine("Attempting to open file {0}".F(this.FileName));
var reader = readWriteFactory.CreateSourceReaderFromURL(this.FileName, attributes);
TraceDebug.WriteLine("Opened file {0}. Duration: {1}".F(this.FileName, reader.Duration.FromNanoToSeconds()));
return new SourceReaderExtra(this.FileName, this.State, reader);
}
示例14: Node
/// <summary>
/// Create a new Node.
/// </summary>
/// <param name="baseUri">base URI</param>
/// <param name="attributes">attributes (not null, but may be empty)</param>
internal Node(string baseUri, Attributes attributes)
{
Validate.NotNull(baseUri);
Validate.NotNull(attributes);
childNodes = new List<Node>(4);
this.baseUri = baseUri.Trim();
this.attributes = attributes;
}
示例15: RenderControl
public override System.Web.UI.WebControls.WebControl RenderControl(Attributes.Setting setting, Object sender)
{
tb.ID = setting.GetName();
tb.TextMode = TextBoxMode.Password;
tb.CssClass = "guiInputText guiInputStandardSize";
return tb;
}