Example #1
0
 public void Awake()
 {
     blockType          = BlockTypes.instance.BASE_BLOCK;
     blockState         = new BlockState(transform.position, transform.rotation);
     onDeckBlockState   = new BlockState(transform.position, transform.rotation);
     lastBlockState     = new BlockState(transform.position, transform.rotation);
     blockStateMutation = new BlockStateMutation();
 }
Example #2
0
    // IMPLEMENTATION METHODS

    private void EvalMoveNeighbor(Vector3 neighborDirection, Vector3 moveDirection)
    {
        Vector3 neighborCoords = blockState.position + (blockState.rotation * neighborDirection);

        if (BlockManager.instance.BlockExists(neighborCoords))
        {
            Block neighborBlock = BlockManager.instance.GetBlock(neighborCoords);
            moveDirection = blockState.rotation * moveDirection;
            BlockStateMutation bsm = neighborBlock.script.blockStateMutation;
            bsm.AddMoveVector(moveDirection * conveyorSpeed);
        }
    }