Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (dragging)
     {
         DropCardController controller = collision.gameObject.GetComponent <DropCardController>();
         if (controller != null)
         {
             Colliders.Add(collision.gameObject);
         }
     }
 }
Example #2
0
    public static GameObject DrawBuildProjectCard(Card c, Vector2 coords)
    {
        GameObject         gameObject = DrawCard(c, coords.x, coords.y, D.CardWidth, D.CardHeight, false);
        DropCardController dcc        = gameObject.AddComponent <DropCardController>();

        dcc.Card           = c;
        dcc.DragDropAction = DragDropAction.BuildProject;

        gameObject.AddComponent <ClickActionScript>()
        .ClickMethod = (item) => {
            PopupsController.ShowCardZoomPopup(c);
        };

        return(gameObject);
    }
Example #3
0
 public void HandleCardLeaveAction(GameObject playerCardObject, GameObject targetCardObject)
 {
     targetCardObject.ResetColor();
     DropCardController controller = targetCardObject.GetDragDropController();
 }
Example #4
0
    public static DropCardController GetDragDropController(this GameObject obj)
    {
        DropCardController controller = obj.GetComponent <DropCardController>();

        return(controller);
    }