Exemplo n.º 1
0
    private void Movie(Vector2Int vector)
    {
        foreach (var item in chessboardDic)
        {
            if (item.Value != null)
            {
                item.Value.isMerge = false;
            }
        }

        for (int i = 0; i < chessboardlength; i++)
        {
            List <Vector2Int> chessList = GetChessList(vector, i);
            Debug.Log("获取棋盘一列数据");
            Debug.Log(chessList.GetString());
            Movie(chessList);
            Debug.Log("一列数据移动后");
            Debug.Log(chessboardDic.GetString());
        }
        Movie();
        VPTimer.In(0.4f, () =>
        {
            gameState = Game2048GameState.Build;
            SwitchState();
        });

        //Debug.Log(chessboardDic.GetString());
    }
Exemplo n.º 2
0
    private void SwitchState()
    {
        Debug.Log("当前游戏状态:" + gameState.ToString());
        switch (gameState)
        {
        case Game2048GameState.Begin:
            Init();
            gameState = Game2048GameState.Build;
            SwitchState();
            break;

        case Game2048GameState.Build:
            Spawn();
            VPTimer.In(0.5f, () =>
            {
                SwitchState();
            });
            break;

        case Game2048GameState.Movie:
            break;

        case Game2048GameState.IsGameOver:
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
 public void Movie(Vector3 position)
 {
     iTween.MoveTo(gameObject, position, 0.4f);
     VPTimer.In(0.4f, () =>
     {
         text.text = ((int)value).ToString();
     });
 }