示例#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());
    }
示例#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;
        }
    }
示例#3
0
 public void Movie(Vector3 position)
 {
     iTween.MoveTo(gameObject, position, 0.4f);
     VPTimer.In(0.4f, () =>
     {
         text.text = ((int)value).ToString();
     });
 }
示例#4
0
 /// <summary>
 /// cancels the event associated with this handle, if active
 /// </summary>
 public void Cancel()
 {
     VPTimer.Cancel(this);
 }