예제 #1
0
        public GameMapEditor(GameMap map)
        {
            this.map = map;
            aimesh   = map.AIMesh;
            scm      = map.SceneManager;
            objPivot = map.CreateEntityWithMaterial("MARKER_PIVOT", "marker_pivot.mesh", "marker_pivot");
            SceneNode objPivotSceneNode = scm.RootSceneNode.CreateChildSceneNode();

            objPivotSceneNode.AttachObject(objPivot);
            objPivot.Visible = false;
        }
예제 #2
0
        private void Loader_LoadMapFinished()
        {
            aimesh      = new AIMesh();
            gameObjects = new Dictionary <string, List <GameObject> >();

            var file = scriptLoader.Parse(Path.GetFileNameWithoutExtension(loader.LoadedMapName) + ".script", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);

            scriptLoader.ExecuteFunction(file, "map_loaded", world);

            TriggerManager.Instance.Init(world, scriptLoader.currentContext);

            editor.Initization();

            LoadMapFinished?.Invoke();
        }
예제 #3
0
        private void mapLoader_LoadMapFinished()
        {
            if (LoadMapFinished != null)
            {
                agents      = new List <Character>();
                gameObjects = new Dictionary <string, List <GameObject> >();

                var file = scriptLoader.Parse(mapLoader.ScriptName, ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);
                scriptLoader.ExecuteFunction(file, "map_loaded", world);

                TriggerManager.Instance.Init(world, scriptLoader.currentContext);

                aimesh = mapLoader.AIMesh;
                editor.Initization(aimesh);

                LoadMapFinished();
            }
        }
예제 #4
0
파일: GameMap.cs 프로젝트: lennyhans/OpenMB
        private void Loader_LoadMapFinished()
        {
            aimesh      = new AIMesh();
            gameObjects = new Dictionary <string, List <GameObject> >();

            var file = scriptLoader.Parse(logicScriptFile, ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);

            scriptLoader.ExecuteFunction(file, "map_loaded", world);

            //Currently terrain use a mesh which id is MAP_TERRAIN
            var terrainEntName = loader.Entities.Where(o => o == "MAP_TERRAIN").FirstOrDefault();

            if (!string.IsNullOrEmpty(terrainEntName))
            {
                var terrainEnt = sceneManager.GetEntity(terrainEntName);
                navmesh = MeshToNavmesh.LoadNavmesh(terrainEnt);
            }

            TriggerManager.Instance.Init(world, scriptLoader.currentContext);

            editor.Initization();

            LoadMapFinished?.Invoke();
        }
예제 #5
0
 public void Initization(AIMesh aimesh)
 {
     this.aimesh = aimesh;
     GenerateVisualAIMesh();
 }