Inheritance: MonoBehaviour
Beispiel #1
0
        public static ChunkSide OppositeSite(this ChunkSide side)
        {
            var si = (int)side;

            si = si % 2 == 0 ? si + 1 : si - 1;
            return((ChunkSide)si);
        }
Beispiel #2
0
        private Vector3Int GetNeighbourPos(int cx, int cy, int cz, ChunkSide side)
        {
            switch (side)
            {
            case ChunkSide.Px:
                return(new Vector3Int(cx + 1, cy, cz));

            case ChunkSide.Nx:
                return(new Vector3Int(cx - 1, cy, cz));

            case ChunkSide.Py:
                return(new Vector3Int(cx, cy + 1, cz));

            case ChunkSide.Ny:
                return(new Vector3Int(cx, cy - 1, cz));

            case ChunkSide.Pz:
                return(new Vector3Int(cx, cy, cz + 1));

            case ChunkSide.Nz:
                return(new Vector3Int(cx, cy, cz - 1));

            default:
                throw new ArgumentOutOfRangeException(nameof(side), side, null);
            }
        }
Beispiel #3
0
 public static ushort GetSizeBySide(ChunkSide side)
 {
     return((int)side < 2 ? XSize : ((int)side < 4 ? YSize : ZSize));
 }