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


C# Elements类代码示例

本文整理汇总了C#中Elements的典型用法代码示例。如果您正苦于以下问题:C# Elements类的具体用法?C# Elements怎么用?C# Elements使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: makeNeutral

 public void makeNeutral()
 {
     UnitHandler.currentHero.convertMana(school);
     school = Elements.NORMAL;
     img.color = Color.white;
     gameObject.transform.SetAsLastSibling();
 }
开发者ID:ExaltedBagel,项目名称:TargetPractice,代码行数:7,代码来源:HarvestedCrystal.cs

示例2: HandleInput

        public EnemyState HandleInput(Elements.Enemy enemy, EStateInput input, EnemyState state)
        {
            switch (input)
            {
                case EStateInput.Move:
                    return new EnemyRunning(direction);
                case EStateInput.SwitchDir:
                    if (direction != 0)
                    {
                        enemy.velocity.X = 0;
                        direction = (EDirection)((int)direction * -1);
                    }
                    return state;
                case EStateInput.Dead:
                    return new EnemyDead();
                case EStateInput.Hit:
                    break;
                case EStateInput.AnimEnd:

                    break;
                case EStateInput.PlayerCollision:
                    enemy.velocity = Vector2.Zero;
                    return new EnemyAttack(direction);
                case EStateInput.Stop:
                    if (state.GetType() != typeof(EnemyIdle))
                        return new EnemyIdle();
                    return this;
                default:
                    break;
            }
            return state;
        }
开发者ID:AaronCC,项目名称:Dread-Dungeon,代码行数:32,代码来源:EnemyActionState.cs

示例3: ChangeColor

    void ChangeColor()
    {
        elements = (Elements)Random.Range (0,4);
        Color newColor = new Color ();
        Debug.Log (elements);

        switch (elements)
        {
        case Elements.Earth:
            newColor = Color.black;
            break;
        case Elements.Water:
            newColor = Color.blue;
            break;

        case Elements.Fire:
            newColor = Color.red;
            break;

        case Elements.Wind:
            newColor = Color.grey;
            break;

        default:
            newColor = Color.red;
            break;
        }

        renderer.material.color = newColor;
    }
开发者ID:18839,项目名称:GD2A_2D_Endless_Runner,代码行数:30,代码来源:RandomGenerator.cs

示例4: Swap

 void Swap(ref Elements  first, ref Elements  second)
 {
     Elements aux;
     aux = first;
     first = second;
     second = aux;
 }
开发者ID:RazvanHidan,项目名称:Probleme,代码行数:7,代码来源:Cuvinte.cs

示例5: Elemental

        public Elemental(Elements element, Movements movement, Vector2 pos, Vector2 velocity, Animation animation, Animation creationAnimation,
            int width, int height, int attack, int defense, int speed, int health)
        {
            this.created = false;
            this.visible = false;
            this.element = element;
            this.movement = movement;
            this.pos = pos;
            this.velocity = velocity;

            this.width = width;
            this.height = height;
            this.animation = animation;
            this.animation.TargetWidth = width;
            this.animation.TargetHeight = height;
            this.creationAnimation = creationAnimation;
            this.creationAnimation.TargetWidth = width;
            this.creationAnimation.TargetHeight = height;

            this.attack = attack;
            this.defense = defense;
            this.speed = speed;
            this.health = this.maxHealth = health;

            this.damageTimeElapsed = damageInterval;
        }
开发者ID:zanagi,项目名称:MelSpaceHunter,代码行数:26,代码来源:Elemental.cs

示例6: Block

        public Block(IElementCreationContext context, string id) 
            : base(context)
        {
            _id = id;

            _elements = new Elements(context.Owner);
        }
开发者ID:CaptiveAire,项目名称:VPL,代码行数:7,代码来源:Block.cs

示例7: SetValueAndDefaults

 public void SetValueAndDefaults( Elements value, Elements defaults )
 {
     elements = value;
     this.defaults = defaults;
     Enabled = true;
     UpdateView();
 }
开发者ID:Glain,项目名称:FFTPatcher,代码行数:7,代码来源:ElementsEditor.cs

示例8: Show

	public void Show(Elements element)
	{
		transform.position = originalPos;
		rigidBody.velocity = Vector2.zero;
		spriteRenderer.sprite = Game.attackByType[element];
		spriteRenderer.enabled = true;
	}
开发者ID:lorenaweder,项目名称:RitualOfRunes,代码行数:7,代码来源:Projectile.cs

示例9: AddElement

        /// <summary>
        /// Adds a new GUI element to this GUI.
        /// </summary>
        /// <param name="element">
        /// The element to add to the GUI.
        /// </param>
        public void AddElement(Elements.AElement element)
        {
            Elements.Add(element);

            if (element is Elements.Button)
                Buttons.Add((Elements.Button)element);
        }
开发者ID:Ragora,项目名称:Emakio,代码行数:13,代码来源:GUI.cs

示例10: OnChosen

    public void OnChosen(ElementChoiceButton button, Elements element)
    {
        if (button.IsSelected)
        {
            return;
        }

        chosenElements.Add(element);
        button.IsSelected = true;
        PrefabAndInstanceContainer.InstantiateAt(PrefabAndInstanceContainer.Instance.ParticlePrefab_ChooseElemental,
                                                 button.MyTransform.position);

        if (chosenElements.Count == 2)
        {
            FSM.Current = new Player(chosenElements[0], chosenElements[1], false);
            Elements[] aiEls = AI.ChooseElements(chosenElements);
            FSM.Opponent = new Player(aiEls[0], aiEls[1], true);

            FSM.StartCoroutine(DealOutCoroutine());
        }
        else if (chosenElements.Count > 2)
        {
            Debug.LogError("More than two elements somehow! " + chosenElements.Count);
        }
    }
开发者ID:heyx3,项目名称:ClubJam2015,代码行数:25,代码来源:ChooseElementsState.cs

示例11: SetObjectData

		public virtual object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
		{
			Diagram diagram = (Diagram) obj;

			diagram.SuspendEvents = true;
			diagram.Suspend();
			
			mShapes = (Elements) info.GetValue("Shapes",typeof(Elements));
			mLines = (Elements) info.GetValue("Lines",typeof(Elements));
			mLayers = (Layers) info.GetValue("Layers",typeof(Layers));
			
			//Diagram is created without a constructor, so need to do some initialization
			diagram.SetRender(new Render());

			diagram.DiagramSize = Serialize.GetSize(info.GetString("DiagramSize"));
			diagram.Zoom = info.GetSingle("Zoom");
			diagram.ShowTooltips = info.GetBoolean("ShowTooltips");
			diagram.Paged = info.GetBoolean("Paged");
			diagram.CheckBounds = info.GetBoolean("CheckBounds");
			diagram.Margin = (Margin) info.GetValue("Margin",typeof(Margin));
			diagram.WorkspaceColor = Color.FromArgb(Convert.ToInt32(info.GetString("WorkspaceColor")));
			if (Serialize.Contains(info,"Animator", typeof(Animator))) diagram.Animator = (Animator) info.GetValue("Animator", typeof(Animator));

			diagram.Resume();
			diagram.SuspendEvents = false;
			return diagram;
		}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:27,代码来源:DiagramSerialize.cs

示例12: Text_MultipleNodes_ReturnsFirstFoundValue

        public void Text_MultipleNodes_ReturnsFirstFoundValue()
        {
            var nodes = GetNodes("<a href='url'>text</a><a href='otherurl'>other</a>");

            var elements = new Elements(nodes);

            Assert.That(elements.Text, Is.EqualTo("text"));
        }
开发者ID:vinntreus,项目名称:HttpGhost,代码行数:8,代码来源:ElementsTests.cs

示例13: Add

        public void Add(float h, float w)
        {
            Elements temp = new Elements(h, w, Pila);
            Quad.Add(temp);

            //Render();
            //BigChek();
        }
开发者ID:qwertyV112,项目名称:Rascroi,代码行数:8,代码来源:Rascroi.cs

示例14: Raw_WithMatch_ReturnsValue

        public void Raw_WithMatch_ReturnsValue()
        {
            var nodes = GetNodes("<a href='someurl'>text</a>");

            var elements = new Elements(nodes);

            Assert.That(elements.Raw, Is.EqualTo("<a href='someurl'>text</a>"));
        }
开发者ID:vinntreus,项目名称:HttpGhost,代码行数:8,代码来源:ElementsTests.cs

示例15: Attribute_WithMatch_ReturnsAttributeValue

        public void Attribute_WithMatch_ReturnsAttributeValue()
        {
            var nodes = GetNodes("<a href='someurl'>text</a>");

            var elements = new Elements(nodes);

            Assert.That(elements.Attribute("href"), Is.EqualTo("someurl"));
        }
开发者ID:vinntreus,项目名称:HttpGhost,代码行数:8,代码来源:ElementsTests.cs


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