本文整理汇总了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();
}
示例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;
}
示例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;
}
示例4: Swap
void Swap(ref Elements first, ref Elements second)
{
Elements aux;
aux = first;
first = second;
second = aux;
}
示例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;
}
示例6: Block
public Block(IElementCreationContext context, string id)
: base(context)
{
_id = id;
_elements = new Elements(context.Owner);
}
示例7: SetValueAndDefaults
public void SetValueAndDefaults( Elements value, Elements defaults )
{
elements = value;
this.defaults = defaults;
Enabled = true;
UpdateView();
}
示例8: Show
public void Show(Elements element)
{
transform.position = originalPos;
rigidBody.velocity = Vector2.zero;
spriteRenderer.sprite = Game.attackByType[element];
spriteRenderer.enabled = true;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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"));
}
示例13: Add
public void Add(float h, float w)
{
Elements temp = new Elements(h, w, Pila);
Quad.Add(temp);
//Render();
//BigChek();
}
示例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>"));
}
示例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"));
}