Esempio n. 1
0
    public override void OnEndDrag(PointerEventData eventData)
    {
        float scaledStartPositionX = StartPositionX * Scaler.transform.localScale.x;
        float scaledStartPositionY = StartPositionY * Scaler.transform.localScale.y;

        if (GameManager.instance.PreparationPhase)
        {
            //Deploy Unit
            if (LastTileObject != null)
            {
                transform.position = LastTile;
                LastTileObject.GetComponent <Tile>().Occupied = true;
                BodyDeployed = true;
            }
            //Snap back to start
            else
            {
                ReturnToStart(scaledStartPositionX, scaledStartPositionY);
            }
            StopLightingAllTiles();
        }
        if (!DefDeployed && LastTileObject != null)
        {
            /*Champion.instance.gameObject.SetActive(false);
            *  Bomber.instance.gameObject.SetActive(false);
            *  Engineer.instance.gameObject.SetActive(false);*/
            LightAllTiles();
            GameManager.instance.SetInstructions("Deploy your Defender's shield");
        }
        BeingDragged = false;
    }
Esempio n. 2
0
 public virtual void OnBeginDrag(PointerEventData eventData)
 {
     if (LastTileObject != null)
     {
         LastTileObject.GetComponent <Tile>().Occupied = false;
     }
 }
Esempio n. 3
0
 public override void OnEndDrag(PointerEventData eventData)
 {
     LastTileObject.GetComponent <Tile>().Occupied = true;
 }