Пример #1
0
    void SetNewFace()
    {
        Vector3    direction       = SnapToCardinal(transform.forward);
        GameObject blockGameObject = GetGameObjInDir(direction);
        BlockFace  blockFaceOfNeighbouringBlock = BlockFaceMethods.BlockFaceFromNormal(-direction);

        if (blockGameObject == null)
        {
            return;
        }

        BlockBehaviour blockBehaviour = blockGameObject.GetComponent <BlockBehaviour>();

        blockBehaviour.OnFaceSelect(blockFaceOfNeighbouringBlock);
        _highlighted = blockBehaviour;
    }
Пример #2
0
    void SetNewFaces()
    {
        foreach (Vector3 direction in _directions)
        {
            GameObject blockGameObject = GetGameObjInDir(direction);
            BlockFace  blockFaceOfNeighbouringBlock = BlockFaceMethods.BlockFaceFromNormal(-direction);

            if (blockGameObject == null)
            {
                continue;
            }

            BlockBehaviour blockBehaviour = blockGameObject.GetComponent <BlockBehaviour>();

            blockBehaviour.OnFaceSelect(blockFaceOfNeighbouringBlock);
            _faceMap.Add(blockBehaviour);
        }
    }