示例#1
0
文件: Card.cs 项目: HaKDMoDz/geff
    public void OnMouseUp()
    {
        if (Game.GameState == GameState.PickCardInHand)
        {
            isSelected = false;
            vecInitialSelection = Vector3.zero;

            if (NextContinentCard != null)
            {
                //---> Déplacement d'une carte par dessus une autre carte
                if (NextContinentCard.Card != null)
                {
                    //---> Déplacement d'une carte issue de la main sur une carte déja posée
                    if (ContinentCard == null)
                    {
                        Game.Player.ListCardInHand.Add(NextContinentCard.Card);
                        Game.Player.SortPileInHand(false);

                        NextContinentCard.Card.ContinentCard = null;
                    }
                    //---> Déplacement d'une carte déja posée sur une carte déja posée
                    else
                    {
                        NextContinentCard.Card.LerpAnimation = new LerpVector3(NextContinentCard.Card.transform.position, Tools.TransYVector(ContinentCard.transform.position), false, false, 0.2f);

                        NextContinentCard.Card.ContinentCard = ContinentCard;
                        ContinentCard.Card = NextContinentCard.Card;
                    }
                }
                else if (ContinentCard != null)
                {
                    ContinentCard.Card = null;
                }

                LerpAnimation = new LerpVector3(this.transform.position, new Vector3(NextContinentCard.transform.position.x,NextContinentCard.transform.position.y+0.01f,NextContinentCard.transform.position.z), false, false, 0.2f);

                NextContinentCard.Card = this;
            }
            else
            {
                if (ContinentCard != null)
                    ContinentCard.Card = null;

                Game.Player.ListCardInHand.Add(this);

                this.LerpAnimation.StartValue = this.transform.position;

                Game.Player.SortPileInHand(false);
            }

            ContinentCard = NextContinentCard;
            NextContinentCard = null;
        }
    }
示例#2
0
 void SubscribeToEvent(LerpVector3 lerpVector3, AnimationTransform animationTransform)
 {
     lerpVector3.OnEndEvent.AddListener(animationTransform.StartAnimation);
 }