Example #1
0
    public void RotateArrows(Point p)
    {
        OneCardManager myCard = FindCardAtPoint(p);

        // if (myCard.gameObject.tag == "Arrows")
        //    Arrow.gameObject.SetActive(false);
        //arrowss = GameObject.FindGameObjectsWithTag("Arrows");
        //foreach (GameObject r in arrowss)
        //   r.transform.Translate(Direction * movespeed * Time.deltaTime);



        arrows t = arrows.None;

        if ((myCard.arrows & arrows.Up) == arrows.Up)
        {
            t |= arrows.Down;
        }

        if ((myCard.arrows & arrows.Down) == arrows.Down)
        {
            t |= arrows.Up;
        }

        if ((myCard.arrows & arrows.Right) == arrows.Right)
        {
            t |= arrows.Left;
        }

        if ((myCard.arrows & arrows.Left) == arrows.Left)
        {
            t |= arrows.Right;
        }



        if (myCard.cardAsset.Type == CardType.Player)
        {
            foreach (PlayerManager pl in GameManager.Instance.players)
            {
                if (pl.myCardManager == myCard)
                {
                    Debug.Log("rotateplayerArrows");
                    pl.arrows = t;
                    pl.point  = myCard.point;
                }
            }
        }

        myCard.updateArrows(t);
    }