public void OnEndDrag(PointerEventData eventData) { interaction.OnEndDrag(); if (dropper == null || !dropper.isActiveAndEnabled) { ResetDrop(); } dropper.OnDrop(gameObject); Debug.Log(dropper.gameObject.name + " " + lastDropper.gameObject.name); if (dropper != null) { lastDropper = dropper; } transform.DOScale(1, 0.2f); transform.SetParent(dropper.transform); if (dummy) { transform.SetSiblingIndex(dummy.transform.GetSiblingIndex()); dummy.gameObject.SetActive(false); Destroy(dummy); } cardDrop.Raise(); cardDrop.Raise(); dragged = null; }
public ActionResult DeleteConfirmed(int id) { CardBody cardBody = db.CardBodies.Find(id); db.CardBodies.Remove(cardBody); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,MainTitle,Title,Content,Icon")] CardBody cardBody) { if (ModelState.IsValid) { db.Entry(cardBody).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cardBody)); }
public ActionResult Create([Bind(Include = "Id,MainTitle,Title,Content,Icon")] CardBody cardBody) { if (ModelState.IsValid) { db.CardBodies.Add(cardBody); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cardBody)); }
public void ReleaseDrop(CardBody card) { card.ExitDrop(this); if (card.dummy && getDummy) { card.dummy.SetActive(false); if (holder) { holder.SetSpaces(); } } }
public void SetDrop(CardBody card) { card.SetDrop(this); if (card.dummy && getDummy) { card.dummy.transform.SetParent(transform); card.dummy.SetActive(true); if (holder) { holder.SetSpaces(); } } }
// GET: Admin/CardBodiy/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CardBody cardBody = db.CardBodies.Find(id); if (cardBody == null) { return(HttpNotFound()); } return(View(cardBody)); }
public void OnBeginDrag(PointerEventData eventData) { interaction.OnDrag(); SetDummy(); var index = transform.GetSiblingIndex(); dummy.transform.SetSiblingIndex(index); dropper = transform.parent.GetComponent <Dropper>(); dragged = this; lastDropper = dropper; transform.SetParent(null); cardDrag.Raise(); transform.DOScale(1.25f, 0.2f); }
public void OnEndDrag(PointerEventData eventData) { if (dropper == null) { dropper = lastDropper; } transform.DOScale(1, 0.2f); dragged = null; transform.SetParent(dropper.transform); if (dummy) { transform.SetSiblingIndex(dummy.transform.GetSiblingIndex()); dummy.gameObject.SetActive(false); Destroy(dummy); } cardDrop.Raise(); dropper.OnDrop(gameObject); //sortGroup.sortingOrder = 0; }
public async Task <ActionResult <Card> > PostCard(CardBody cardBody) { if (cardBody.Titulo == "" || cardBody.Conteudo == "") { return(BadRequest()); } Card card = new Card { Id = Guid.NewGuid(), Lista = cardBody.Lista, Titulo = cardBody.Titulo, Conteudo = cardBody.Conteudo }; _context.Card.Add(card); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCard", new { id = card.Id }, card)); }
public void Discard(CardBody card) { Discard(card.gameObject); }
public CarouselCard(CardBody body, List <CardOption> options) : base(MEDIA_TYPE) { Body = body; Options = options; }