using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.UI; using XFramework; public class StudentSub1EditorPanel : BasePanel { const string panelName = "Panel_studentSub1Editor"; Text subName; Text terrainName; RectTransform image_PermissibleArea;//允许摆放区域 EditorContentCtrl contentCtrl_cars; EditorContentCtrl contentCtrl_person; // public EditorContentCtrl contentCtrl_childEquip; MyDragMap map; GameObject carInstacnePrefab; GameObject onboardInstancePrefab; Button button_quitLearn; Button button_lookTerrain; Button button_editorOver; PromptTextCtrl editorButtonPrompt; Slider slider_Speed; Text text_Speed; Dropdown dropdown_carsGroup;//下拉菜单规划当前编辑的组别 连续训练时可设置 InputField inputField_taskDetail;//任务简介 //bool isOn;//观察模式是否开启 开启时启用相机控制脚本 CarDetailCtrl carDetail; public List onMapCars = new List();//完成摆放的车辆 public Dictionary> onMapCarsGroups = new Dictionary>();//按照分组记录当前的编队 public Dictionary onBoardEquip = new Dictionary(); //教员端数据库中设置的默认车载装备关系 即该类型车辆必定带有一个该装备 List allCarNames = new List();//记录所有已生成车辆的名称 避免车辆名称重复 CarIconInstanceCtrl firstCar;//设置的首车 CarIconInstanceCtrl lastCar;//设置的尾车 Image firstCarMarkIcon; Image lastCarMarkIcon; private IconBase tempIcon;//当前待编辑的 装备/人员图标 不为空时代表存在待编辑的GO 此时无法结束编辑 //string equipPath = Application.streamingAssetsPath + "/Config/装备库.txt"; //string personPath = Application.streamingAssetsPath + "/Config/人员库.txt"; //string childEquipPath = Application.streamingAssetsPath + "/Config/附属装备库.txt"; NetSub1Msg subMsg; PlanningPlaneCtrl planningCtrl;//线路规划 Toggle drawFirstLine;//绘制首选路线 Toggle drawSecondLine;//绘制备选路线 Toggle toggle_setFirstCar;//首车设置按钮 Toggle toggle_setLastCar;//尾车设置按钮 bool markCarState;//车辆标记模式 bool markFirstCar;//true 标记首车 false 标记尾车 PermissibleArea permissible;//记录场景提供的车辆出发点位置信息 等待地图更新完成后 显示位置 public StudentSub1EditorPanel() : base(new UIType(panelName)) { } protected override void InitEvent() { EventCenter.Instance.AddEventListener("SelectCarEditor", SelectCar); EventCenter.Instance.AddEventListener("CreatCar", CreatCarInstance); EventCenter.Instance.AddEventListener("CreatOnboard", CreatOnboardInstance); //subRecordClass = SubjectMsgManager.recordBase as SubRecordClass; subName = ActivePanel.Find("Text_subName").GetComponent(); terrainName = ActivePanel.Find("Text_terrainName").GetComponent(); contentCtrl_cars = ActivePanel.FindChildTrans("Content_car").GetComponent(); contentCtrl_person = ActivePanel.FindChildTrans("Content_person").GetComponent(); map = ActivePanel.FindChildTrans("Image_map").GetComponent(); carDetail = ActivePanel.FindChildTrans("Image_装备详情").GetComponent(); button_lookTerrain = ActivePanel.FindChildTrans("Button_查看地形").GetComponent