Ejemplo n.º 1
0
        private void SetDynamicNavigationSystem(DynamicNavigationMeshSystem newDynamicNavigationMeshSystem)
        {
            if (dynamicNavigationMeshSystem != null)
            {
                return;
            }

            if (newDynamicNavigationMeshSystem != null)
            {
                dynamicNavigationMeshSystem = newDynamicNavigationMeshSystem;

                newDynamicNavigationMeshSystem.NavigationMeshUpdated += DynamicNavigationMeshSystemOnNavigationMeshUpdated;

                // Initialize dynamic navigation mesh system with game settings
                if (gameSettingsProviderService.CurrentGameSettings != null)
                {
                    var navigationSettings = gameSettingsProviderService.CurrentGameSettings.GetOrDefault <NavigationSettings>();
                    sceneEditorController.InvokeAsync(() => newDynamicNavigationMeshSystem.InitializeSettingsFromNavigationSettings(navigationSettings));
                }

                newDynamicNavigationMeshSystem.EnabledChanged += NewDynamicNavigationMeshSystemOnEnabledChanged;
            }
        }