コード例 #1
0
ファイル: WorldGrid.cs プロジェクト: Levitate909/omm_fj2020
    private void Awake()
    {
        var startPiece = GridPiece.GeneratePiece(this, new Square());

        startPiece.Place(Vector2.zero);

        m_FinalPiece = GridPiece.GeneratePiece(this, new Square());
        m_FinalPiece.Place(new Vector2(0, m_Distance));
    }
コード例 #2
0
    private void TryPlacePiece()
    {
        // check if can place piece in front of player...
        Coordinate nextCoordinate = null;

        if (!m_CurrentCoordinte.TryMove(m_Facing, ref nextCoordinate))
        {
            ClearPreview();

            Vector2 placePostition = WorldGrid.OffsetDirection(m_CurrentCoordinte.GridPosition(), m_Facing);
            // TODO: overlapping piece handling...
            m_PlayerPiece.Place(placePostition);
            Respawn();
        }
    }