Skip to content

Instantly share code, notes, and snippets.

View mihakrajnc's full-sized avatar

Miha Krajnc mihakrajnc

View GitHub Profile
@mihakrajnc
mihakrajnc / SnapTerrainRaycastModifier.cs
Last active February 13, 2018 09:34
A snap to terrain modifier for Mapbox Unity that uses Raycasting.
using Mapbox.Unity.Map;
using Mapbox.Unity.MeshGeneration.Data;
using Mapbox.Unity.MeshGeneration.Modifiers;
using UnityEngine;
[CreateAssetMenu(menuName = "Mapbox/Modifiers/Custom/Snap Terrain Raycast Modifier")]
public class SnapTerrainRaycastModifier : MeshModifier
{
private const int RAY_LENGTH = 50;
@mihakrajnc
mihakrajnc / NavMeshFactory.cs
Last active February 22, 2019 06:40
A NavMesh factory for Mapbox.
using System.Collections.Generic;
using Mapbox.Unity.MeshGeneration.Data;
using Mapbox.Unity.MeshGeneration.Enums;
using Mapbox.Unity.MeshGeneration.Factories;
using UnityEngine;
using UnityEngine.AI;
[CreateAssetMenu(menuName = "Mapbox/Factories/Custom/NavMesh Factory")]
public class NavMeshFactory : AbstractTileFactory
{
@mihakrajnc
mihakrajnc / UiMapTileFactory.cs
Last active September 19, 2017 00:21
A Mapbox factory that loads map images into Unity UI.
using System;
using Mapbox.Map;
using Mapbox.Unity.MeshGeneration.Data;
using Mapbox.Unity.MeshGeneration.Enums;
using Mapbox.Unity.MeshGeneration.Factories;
using UnityEngine;
using UnityEngine.UI;
[CreateAssetMenu(menuName = "Mapbox/Factories/Custom/UI Map Tile Factory")]
public class UiMapTileFactory : AbstractTileFactory
using System;
using System.Collections.Generic;
using System.Linq;
using Assets.Mapbox.Unity.MeshGeneration.Modifiers.MeshModifiers;
using Mapbox.Unity;
using Mapbox.Unity.Map;
using Mapbox.Unity.MeshGeneration.Components;
using Mapbox.Unity.MeshGeneration.Data;
using Mapbox.Unity.MeshGeneration.Enums;
using Mapbox.Unity.MeshGeneration.Interfaces;