-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavigationBakerNew.cs
40 lines (39 loc) · 1.01 KB
/
NavigationBakerNew.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
//testing git
public class NavigationBakerNew : MonoBehaviour
{
public NavMeshSurface surface;
public string AgentType;
// Start is called before the first frame update
void Start()
{
//bakeMesh(AgentType);
}
public void bakeMesh(string agent)
{
//short distance ID is -1372625422
//flatLand ID is 0
//no clue why
if (agent == "ret")
{
surface.agentTypeID = -334000983;
Debug.Log("Returning");
}
else if (agent == "dist")
{
surface.agentTypeID = -1372625422;
Debug.Log("Going shortest distance");
}
else if (agent == "flat")
{
surface.agentTypeID = 0;
Debug.Log("Going flat land");
}
else
Debug.Log("Invalid agent type");
surface.BuildNavMesh();
}
}