當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。