public UnitCommand(Unit _unit, UnitCommandType _type, Unit _target, int _x, int _y, int _extra) : this(bwapiPINVOKE.new_UnitCommand__SWIG_1(Unit.getCPtr(_unit), UnitCommandType.getCPtr(_type), Unit.getCPtr(_target), _x, _y, _extra), true) { if (bwapiPINVOKE.SWIGPendingException.Pending) { throw bwapiPINVOKE.SWIGPendingException.Retrieve(); } }
public void SetIconActiveAlpha(Vector2Int tile, UnitCommandType cmdType, bool activeness, float alpha) { Color color = Color.white; color.a = alpha; switch (cmdType) { case UnitCommandType.MOVE: { tiles[tile.x, tile.y].moveIcon.SetActive(activeness); tiles[tile.x, tile.y].moveIconSR.color = color; } break; case UnitCommandType.DIG: { tiles[tile.x, tile.y].shovelIcon.SetActive(activeness); tiles[tile.x, tile.y].shovelIconSR.color = color; } break; case UnitCommandType.EXTINGUISH: { tiles[tile.x, tile.y].extinguishIcon.SetActive(activeness); tiles[tile.x, tile.y].extinguishIconSR.color = color; } break; } }
public bool Equals(UnitCommandType obj) { if (obj == null) { return(false); } return(obj.swigCPtr.Handle == this.swigCPtr.Handle); }
private void OnGameTileClickedEvent(GameTile tile, GameClickEventData clickEventData) { if (currentCommand == UnitCommandType.Move && selectedUnit != null && selectedUnit is MapMobileUnit) { var mobileUnit = selectedUnit as MapMobileUnit; mobileUnit.SetMovePosition(tile.position); clickEventData.isUsed = true; } currentCommand = UnitCommandType.None; }
public static float GetCommandTypeCost(UnitCommandType type) { if (type == UnitCommandType.MOVE) { return(0.0f); } if (type == UnitCommandType.DIG) { return(1.0f); } if (type == UnitCommandType.EXTINGUISH) { return(1.0f); } Debug.LogError("Unrecognized command type"); return(0.0f); }
public void OnButtonClicked(int actionIndex) { var actionType = (UnitCommandType)actionIndex; currentCommand = actionType; if (actionType == UnitCommandType.Attack) { } else if (actionType == UnitCommandType.Move) { } else if (actionType == UnitCommandType.Inspect) { //castleWindow.SetCountry(selectedUnit.country); } Hide(); }
public UnitCommand(Unit _unit, UnitCommandType _type, Unit _target, int _x, int _y, int _extra) : this(bwapiPINVOKE.new_UnitCommand__SWIG_1(Unit.getCPtr(_unit), UnitCommandType.getCPtr(_type), Unit.getCPtr(_target), _x, _y, _extra), true) { if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve(); }
public UnitCommandType getType() { UnitCommandType ret = new UnitCommandType(bwapiPINVOKE.UnitCommand_getType(swigCPtr), true); return ret; }
public UnitCommandType getType() { UnitCommandType ret = new UnitCommandType(bwapiPINVOKE.UnitCommand_getType(swigCPtr), true); return(ret); }
private void ResetCommand() { currentCommand = UnitCommandType.None; selectedUnit = null; }
public bool Equals(UnitCommandType obj) { if (obj == null) return false; return (obj.swigCPtr.Handle == this.swigCPtr.Handle); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(UnitCommandType obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(UnitCommandType obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
private void SendCommandRequest(UnitCommandType _commandType, Vector3 _target) { Debug.LogError("call SendCommandRequest"); }
public static UnitCommandType getUnitCommandType(string name) { UnitCommandType ret = new UnitCommandType(bwapiPINVOKE.getUnitCommandType(name), true); if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve(); return ret; }