void Start() { _gridSystem = this; DontDestroyOnLoad(this); TerainSpawner(); ForestSpawner(); _surface.Bake(); }
void Update() { if (Input.GetButtonDown("Fire1")) { surface.Bake(); } }
public static void Bake() { if (surface != null) { surface.Bake(); } }
// Update is called once per frame void Update() { if (mapGen.generated) { mapGen.generated = false; nav.Bake(); } }
void BakeSurface(NavMeshSurface navSurface) { var destroy = navSurface.bakedNavMeshData; navSurface.Bake(s_DebugVisualization); DestroyImmediate(destroy, true); // Explicitly set the scene as dirty - otherwise the reference will be lost EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene); }
void Update() { if (Input.GetButtonDown("Fire1")) { surface.Bake(); } else if (Input.GetButtonDown("Fire2")) { surface.RemoveData(); } }
void BakeSurface(NavMeshSurface navSurface) { var destroy = navSurface.bakedNavMeshData; navSurface.Bake(s_DebugVisualization); AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(destroy)); SaveNavMeshAsset(navSurface); ApplyIfPrefab(navSurface); // Explicitly set the scene as dirty - otherwise the reference will be lost EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene); }
void BakeSurface(NavMeshSurface navSurface) { var assetToDelete = GetNavMeshAssetToDelete(navSurface); navSurface.Bake(); EditorUtility.SetDirty(navSurface); if (assetToDelete) { AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(assetToDelete)); } CreateNavMeshAsset(navSurface); EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene); }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { if (!baked) { plateau.Bake(); baked = true; } } else if (Input.GetButtonDown("Fire2")) { if (baked) { plateau.RemoveData(); baked = false; } } }
// Use this for initialization void Start() { plateau = GetComponent <NavMeshSurface>(); plateau.Bake(); baked = true; }
//// Use this for initialization //void Start() //{ //} //public bool editorBake; //// Update is called once per frame //void Update() //{ // if (editorBake) // { // //do a thing // mySurface.Bake(); // editorBake = false; // } //} public void Bake() { mySurface.Bake(); }
void UpdateNavMesh() { surface.RemoveData(); surface.transform.position = transform.position; surface.Bake(); }
void GenNevMesh() { navMesh.Bake(); }
void Start() { surface = GetComponent <NavMeshSurface> (); surface.Bake(); baked = true; }