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();
     }
 }
Пример #2
0
    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);
 }
Пример #4
0
    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;
    }
Пример #5
0
    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);
    }
Пример #6
0
    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();
    }
Пример #7
0
 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();
 }
Пример #8
0
 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);
        }
Пример #10
0
 private void ResetCommand()
 {
     currentCommand = UnitCommandType.None;
     selectedUnit   = null;
 }
Пример #11
0
public bool Equals(UnitCommandType obj) 
{
    if (obj == null) return false;
    return (obj.swigCPtr.Handle == this.swigCPtr.Handle);
}
Пример #12
0
 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);
 }
Пример #14
0
 private void SendCommandRequest(UnitCommandType _commandType, Vector3 _target)
 {
     Debug.LogError("call SendCommandRequest");
 }
Пример #15
0
 public static UnitCommandType getUnitCommandType(string name) {
   UnitCommandType ret = new UnitCommandType(bwapiPINVOKE.getUnitCommandType(name), true);
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }