override public float Run() { if (newNavMesh) { SceneSettings sceneSettings = GameObject.FindWithTag(Tags.gameEngine).GetComponent <SceneSettings>(); NavigationMesh oldNavMesh = sceneSettings.navMesh; oldNavMesh.TurnOff(); newNavMesh.TurnOn(); sceneSettings.navMesh = newNavMesh; } return(0f); }
private void UnloadNavMesh(int navMeshInt) { NavigationMesh navMesh = Serializer.returnComponent <NavigationMesh> (navMeshInt); SceneSettings sceneSettings = GameObject.FindWithTag(Tags.gameEngine).GetComponent <SceneSettings>(); if (navMesh && navMesh.collider && sceneSettings) { NavigationMesh oldNavMesh = sceneSettings.navMesh; oldNavMesh.TurnOff(); navMesh.collider.GetComponent <NavigationMesh>().TurnOn(); sceneSettings.navMesh = navMesh; } }