/// <summary> /// Method is called when unit is deselected. /// </summary> public virtual void OnUnitDeselected() { SetState(new UnitStateMarkedAsFriendly(this)); if (UnitDeselected != null) { UnitDeselected.Invoke(this, new EventArgs()); } }
//Metoda jest wywoływana w momencie odznaczenia jednostki public virtual void OnUnitDeselected() { uiManager = FindObjectOfType <UiManager>(); SetState(new UnitStateMarkedAsFriendly(this)); if (UnitDeselected != null) { UnitDeselected.Invoke(this, new EventArgs()); } uiManager.CloseScorePanel(); }
public override void Deselect() { Selected = false; try { UnitDeselected?.Invoke(this); } catch (Exception e) { Urho.IO.Log.Write(LogLevel.Warning, $"There was an unexpected exception during the invocation of {nameof(UnitDeselected)}: {e.Message}"); } }
/// <summary> /// Method is called when unit is deselected. /// </summary> public virtual void OnUnitDeselected() { //SetState(new UnitStateMarkedAsFriendly(this)); if (UnitDeselected != null) { UnitDeselected.Invoke(this, new EventArgs()); } for (int i = 0; i < rend.Length; i++) { if (rend[i].material.shader.name == "Shader/ToonOutLine") { rend[i].material.SetColor("_OutLineColor", new Color(0, 0, 0, 1)); } } }
/// <summary> /// Method is called when unit is deselected. /// </summary> public virtual void OnUnitDeselected() { SetState(new UnitStateMarkedAsFriendly(this)); if (UnitDeselected != null) { UnitDeselected.Invoke(this, new EventArgs()); } SpaceMover mover = this.GetComponent <SpaceMover>(); if (mover != null) { mover.turnManager.inUse = null; } }
/// <summary> /// Method is called when unit is deselected. /// </summary> public virtual void OnUnitDeselected() { SetState(new UnitStateMarkedAsFriendly(this)); if (UnitDeselected != null) { UnitDeselected.Invoke(this, new EventArgs()); } if (hasMoved) { MovementPoints = 0; } if (ActionPoints > 0) { GetComponent <Renderer>().material.color = LeadingColor; } else if (ActionPoints == 0) { SetDeselectedColor(); } selected = false; }
/// <summary> /// Method is called when unit is deselected. /// </summary> public virtual void OnUnitDeselected() { SetState(new UnitStateMarkedAsFriendly(this)); UnitDeselected?.Invoke(this); }