//初始化函数 void Init() { minSize = new Vector2(600, 0); RenderSettings.fog = false; _delegate = new SceneView.OnSceneFunc(OnSceneFunc); SceneView.onSceneGUIDelegate += _delegate; m_sBornListPath = ""; m_sObstaclePath = ""; m_sNavigationPath = ""; //加载选择图片 ChangeTexture(ref _windowInstance.m_ObstcalePng); //加载prefab string sPrefabPath = "Assets/Z_Temp/Obstacle/SceneEditorPerfab/"; //ObsPrefabs = AssetDatabase.LoadAssetAtPath( sPrefabPath + "Obstacle.prefab", typeof(GameObject)) as GameObject; ; RegionBorn = AssetDatabase.LoadAssetAtPath(sPrefabPath + "RegionBorn.prefab", typeof(GameObject)) as GameObject;; PointBorn = AssetDatabase.LoadAssetAtPath(sPrefabPath + "PointBorn.prefab", typeof(GameObject)) as GameObject;; ScenePointBorn = AssetDatabase.LoadAssetAtPath(sPrefabPath + "ScenePointBorn.prefab", typeof(GameObject)) as GameObject;; PathPointBorn = AssetDatabase.LoadAssetAtPath(sPrefabPath + "PathPointBorn.prefab", typeof(GameObject)) as GameObject; PatrolBorn = AssetDatabase.LoadAssetAtPath(sPrefabPath + "PatrolBorn.prefab", typeof(GameObject)) as GameObject; //生成各个父节点 AllParent = GameObject.Find("Parent"); if (AllParent == null) { GameObject parent = AssetDatabase.LoadAssetAtPath(sPrefabPath + "Parent.prefab", typeof(GameObject)) as GameObject; AllParent = Instantiate(parent) as GameObject; AllParent.transform.position = new Vector3(0, 0, 0); AllParent.name = AllParent.name.Replace("(Clone)", ""); } m_csPathGrid = AllParent.GetComponent <PathGridComponent>(); m_csPathGrid.m_debugShow = true; CheekParent(); m_csPathGrid.InitArray(false); GetFloorHeight(); _windowInstance.position = new Rect(400, 90, 150, 940); BornInfoWindow.OpenWindow(); EditerDataClass._Instance.Init(); //InteractionTool.AddObserver(EditerDataClass._Instance); //InteractionTool.AddObserver(BornInfoWindow._Instance); // InteractionTool.InitObserver(); //自动导入阻挡文件 InteractionTool.Importobstacle(true); }
//public void OnCreateGameObj(GameObject obj, int id, CreateMode mode) //{ // SetBornInfo(ref obj, id); // BornInfo info = obj.GetComponent<BornInfo>(); // info.mi_Id = id; // info.me_Type = mode; // switch (mode) // { // case CreateMode.enMonstBorn: // // info.mfc_destory = MonsterBornDestorydelegate; // break; // case CreateMode.enfixMonsterBorn: // // AddBornToTotalDic(obj, id, ref m_dcBornTotalNumber); // break; // case CreateMode.enObj: // // AddBornToTotalDic(obj, id, ref m_dcOBjTotalNumber); // // info.mfc_destory = SetObjIdFree; // break; // default: // break; // } //} public void Init() { InitLuaInfo(); m_csPathGrid = InteractionTool.GetPathGridComponent(); }
// Use this for initialization void Start() { m_pathGridComponent = gameObject.GetComponent <PathGridComponent>(); m_pathGrid = m_pathGridComponent.PathGrid; }