예제 #1
0
파일: CardBody.cs 프로젝트: MgCohen/Frost
    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));
        }
예제 #5
0
 public void ReleaseDrop(CardBody card)
 {
     card.ExitDrop(this);
     if (card.dummy && getDummy)
     {
         card.dummy.SetActive(false);
         if (holder)
         {
             holder.SetSpaces();
         }
     }
 }
예제 #6
0
 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));
        }
예제 #8
0
파일: CardBody.cs 프로젝트: MgCohen/Frost
    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);
    }
예제 #9
0
 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;
 }
예제 #10
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));
        }
예제 #11
0
파일: Holder.cs 프로젝트: MgCohen/Frost
 public void Discard(CardBody card)
 {
     Discard(card.gameObject);
 }
예제 #12
0
 public CarouselCard(CardBody body, List <CardOption> options) : base(MEDIA_TYPE)
 {
     Body    = body;
     Options = options;
 }