예제 #1
0
 private void CompleteHander()
 {
     itemBall = null;
     OnEnd();
 }
예제 #2
0
 public PlayBallMoveEndActor(BallBaseItem ballItem)
     : base()
 {
     itemBall = ballItem;
 }
예제 #3
0
    private void Filling(List <CellMoveInfo> moveAnims, FightStadus fightState = FightStadus.move, int waitmillisecond = 0)
    {
        rootAction = new OrderAction();
        ParallelAction paralle = new ParallelAction();

        for (int i = 0; i < moveAnims.Count; i++)
        {
            CellMoveInfo cellMoveInfo = moveAnims[i];

            OrderAction orderAction = new OrderAction();
            paralle.AddNode(orderAction);

            GameObject item = ballLayer.CreateBaseItem((int)cellMoveInfo.paths[0].x, -1);

            for (int j = 0; j < cellMoveInfo.paths.Count; j++)
            {
                ParallelAction paralleMove = new ParallelAction();
                orderAction.AddNode(paralleMove);

                Vector2 pathPoint = cellMoveInfo.paths[j];
                Vector2 toPos     = PosMgr.GetFightCellPos((int)pathPoint.x, (int)pathPoint.y);
                paralleMove.AddNode(new MoveActor((RectTransform)item.transform, new Vector3(toPos.x, toPos.y, 0), 0, 0.2f));

                if (j > 0)
                {
                    Vector2     fromPoint   = cellMoveInfo.paths[j - 1];
                    Vector2     fromPos     = PosMgr.GetFightCellPos((int)fromPoint.x, (int)fromPoint.y);
                    OrderAction orderRot    = new OrderAction();
                    GameObject  itembarrier = barrierLayer.GetItemByPos((int)fromPoint.x, (int)fromPoint.y);

                    if (itembarrier != null)
                    {
                        if (fromPos.x > toPos.x)
                        {
                            orderRot.AddNode(new RoatateActor((RectTransform)itembarrier.transform, new Vector3(0, 0, -60), 0.15f));
                            orderRot.AddNode(new RoatateActor((RectTransform)itembarrier.transform, new Vector3(0, 0, 0), 0.05f));
                            paralleMove.AddNode(orderRot);
                            paralleMove.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, -30), 0.2f));
                        }
                        if (fromPos.x < toPos.x)
                        {
                            orderRot.AddNode(new RoatateActor((RectTransform)itembarrier.transform, new Vector3(0, 0, 60), 0.15f));
                            orderRot.AddNode(new RoatateActor((RectTransform)itembarrier.transform, new Vector3(0, 0, 0), 0.05f));
                            paralleMove.AddNode(orderRot);
                            paralleMove.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, 30), 0.2f));
                        }
                    }
                    List <TIVInfo> p  = new List <TIVInfo>();
                    TIVInfo        px = new TIVInfo();
                    px.value = pathPoint.x;
                    TIVInfo py = new TIVInfo();
                    py.value = pathPoint.y;
                    p.Add(px);
                    p.Add(py);
                    if (fromPos.x > toPos.x)
                    {
                        paralleMove.AddNode(new FuncTIVActor(Harvest, p));
                    }
                    if (fromPos.x < toPos.x)
                    {
                        paralleMove.AddNode(new FuncTIVActor(Harvest, p));
                    }
                }
            }
            BallBaseItem itemCtr = item.GetComponent <BallBaseItem>();
            orderAction.AddNode(new PlayBallMoveEndActor(itemCtr));
        }
        if (waitmillisecond > 0)
        {
            rootAction.AddNode(new WaitActor(waitmillisecond));
        }
        rootAction.AddNode(paralle);
        ExecuteAction(fightState);
    }