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


C# Attributes类代码示例

本文整理汇总了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;
 }
开发者ID:Tiakiana,项目名称:Kingdomizer3,代码行数:7,代码来源:MonsterBehave.cs

示例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);
                }
            }
开发者ID:fengweijp,项目名称:NSoup,代码行数:29,代码来源:Token.cs

示例3: ControllerContext

        public ControllerContext(ILog log, Attributes startupAttributes)
        {
            Ensure.NotNull(log, nameof(log));

            Log = log;
            StartupAttributes = startupAttributes ?? new Attributes();
        }
开发者ID:alaidas,项目名称:PlugNPay,代码行数:7,代码来源:ControllerContext.cs

示例4: CopyAttributes

 private static Attributes CopyAttributes(Attributes source) {
   if (source == null) {
     return null;
   } else {
     return new Attributes(source.Name, source.Args, CopyAttributes(source.Prev));
   }
 }
开发者ID:ggrov,项目名称:tacny,代码行数:7,代码来源:QuantifierSplitter.cs

示例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;
 }
开发者ID:Owen4ever,项目名称:Monicais.Game.Framework,代码行数:7,代码来源:EffectListImpl.cs

示例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;
 }
开发者ID:Octanum,项目名称:Corvus,代码行数:10,代码来源:Weapon.cs

示例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);
     }
 }
开发者ID:bkzhn,项目名称:dcsoup,代码行数:28,代码来源:Token.cs

示例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";
    }
开发者ID:ryanadair009,项目名称:CMPS427,代码行数:35,代码来源:equipment.cs

示例9: Screen

 public Screen(int x, int y)
 {
     Width = x;
     Height = y;
     Buffer = new char[y * x];
     Attributes = new Attributes[Buffer.Length];
 }
开发者ID:stangelandcl,项目名称:Actors,代码行数:7,代码来源:Screen.cs

示例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);
    }
开发者ID:jpd5367,项目名称:VirtualTableTop,代码行数:26,代码来源:affix.cs

示例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;
    }
开发者ID:ryanadair009,项目名称:CMPS427,代码行数:27,代码来源:EnemyBaseAtts.cs

示例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;
        }
开发者ID:vipoo,项目名称:iRacingReplayOverlay.net,代码行数:35,代码来源:Transcoder.cs

示例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);
        }
开发者ID:vipoo,项目名称:iRacingReplayOverlay.net,代码行数:8,代码来源:Transcoder.cs

示例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;
 }
开发者ID:bkzhn,项目名称:dcsoup,代码行数:13,代码来源:Node.cs

示例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;
        }
开发者ID:perploug,项目名称:PackageBootstrap,代码行数:8,代码来源:Password.cs


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