private void Intialize() { _svgMainFiles = new WorkArea(); _svgMainFiles.PageChanged += OnPageSelectionChanged; _svgMainFiles.ToolDone += OnToolDone; _svgMainFiles.ItemsSelected += SvgMainFilesItemsSelected; _toolBox = new ToolBox { Size = new Size(113, 165) }; _toolBox.ToolSelectionChanged += ToolSelectionChanged; _svgProperties = new WorkSpaceControlBox(); _svgProperties.ZoomChange += OnZoomChanged; _svgProperties.GridOptionChange += GridOptionChaged; _svgProperties.WorkAreaOptionChange += SvgPropertiesWorkAreaOptionChange; _infoFilesMain = _docker.Add(_svgMainFiles, DockAllowed.Fill, new Guid("a6402b80-2ebd-4fd3-8930-024a6201d001")); _infoFilesMain.ShowCloseButton = false; _infoToolbar = _docker.Add(_toolBox, DockAllowed.All, new Guid("a6402b80-2ebd-4fd3-8930-024a6201d002")); _infoToolbar.ShowCloseButton = false; _infoDocumentProperties = _docker.Add(_svgProperties, DockAllowed.All, new Guid("a6402b80-2ebd-4fd3-8930-024a6201d003")); _infoDocumentProperties.ShowCloseButton = false; _shapeProperties = new ShapeProperties(); _shapeProperties.PropertyChanged += ShapePropertiesPropertyChanged; _infoShapeProperties = _docker.Add(_shapeProperties, DockAllowed.All, new Guid("a6402b80-2ebd-4fd3-8930-024a6201d004")); _infoShapeProperties.ShowCloseButton = false; //2019.7.30添加时间timer 用于tick timer.Interval = 35; timer.Tick += new EventHandler(Tick); timer.Enabled = true; _modelBox = new ModelBox(); _infoModelbar = _docker.Add(_modelBox, DockAllowed.All, new Guid("a6402b80-2ebd-4fd3-8930-024a6201d005")); _infoModelbar.ShowCloseButton = false; _modelBox.ToolSelectionChanged += ToolSelectionChanged; TestInit(); }
internal void UpdateVisibility() { if (ModelBox != null) { ModelBox.Visible = visible; ModelBox.Locked = locked; } GraphicBox.Visible = visible && state.ShowGraphics; GraphicBox.Locked = locked; if (HiddenBox != null) { HiddenBox.Visible = visible && state.ShowGraphics; HiddenBox.Locked = locked; } TextBox.Visible = visible && graphicNode.TagVisible && state.ShowTags; TextBox.Locked = locked; if (locked) { if (ModelBox != null) { ModelBox.ZBottom(); } GraphicBox.ZBottom(); if (HiddenBox != null) { HiddenBox.ZBottom(); } TextBox.ZBottom(); } else { if (ModelBox != null) { ModelBox.ZIndex = GraphicBox.ZIndex + 100; //linkHovered = false; foreach (Arrow arrow in ModelBox.IncomingArrows) { (arrow.Tag as EditorLink).UpdateVisibility(); //arrow.ZIndex = Math.Max(arrow.Origin.ZIndex, arrow.Destination.ZIndex) + 10000; //if ((arrow.Tag as EditorLink).Hovered) // linkHovered = true; } foreach (Arrow arrow in ModelBox.OutgoingArrows) { (arrow.Tag as EditorLink).UpdateVisibility(); // arrow.ZIndex = Math.Max(arrow.Origin.ZIndex, arrow.Destination.ZIndex) + 10000; //if ((arrow.Tag as EditorLink).Hovered) // linkHovered = true; } ModelBox.CustomDraw = CustomDraw.Additional; } TextBox.ZIndex = GraphicBox.ZIndex + 200; if (HiddenBox != null) { HiddenBox.ZBottom(); } } opacityTimer.Start(); }
/// <summary> /// 加载模型 /// </summary> /// <param name="i">索引</param> private void LoadModel(int i) { if (m_ModelInfoArray != null && i < m_ModelInfoArray.Length) { uint reloadID = m_ReloadID; int index = i; string path = m_ModelInfoArray[i].perfab; if (!string.IsNullOrEmpty(path)) { AssetUtil.LoadAssetAsync(path, (pathOrAddress, returnObject, userData) => { if (reloadID != m_ReloadID) { return; } if (m_LightEnvirontment == null) { return; } if (m_ModelInfoArray == null) { return; } if (index >= m_ModelInfoArray.Length) { return; } if (!path.Equals(m_ModelInfoArray[index].perfab)) { return; } WarShipRotate autoMoveAndRotate = ModelBox.GetOrAddComponent <WarShipRotate>(); if (autoMoveAndRotate != null) { autoMoveAndRotate.IsRotate = ModelRotate; } GameObject prefab = returnObject as GameObject; prefab.CreatePool(pathOrAddress); if (ModelArray == null) { ModelArray = new GameObject[m_ModelInfoArray.Length]; } ModelArray[index] = prefab.Spawn(ModelBox); ModelArray[index].SetActive(true); ModelArray[index].transform.localEulerAngles = m_ModelInfoArray[index].rotation; ModelArray[index].transform.localPosition = m_ModelInfoArray[index].position; ModelArray[index].transform.localScale = m_ModelInfoArray[index].scale; if (index < ModelArray.Length - 1) { LoadModel(index + 1); } else { RebuildModelBounds(); if (!string.IsNullOrEmpty(EffectPerfab)) { LoadEffect(); } else { InstallModelAndEffect(); } } }); } } }
public void LoadEntityLists(CP enemyCP, QuestEntities questDetails) { ShiftVisibilities(true); string currentRegion = enemyCP.CPname.Substring(0,4); string[] subtypes = new string[0]; comboBox_subtype.Items.Clear(); comboBox_subtype2.Items.Clear(); if (currentRegion.Equals("afgh")) subtypes = BodyInfo.afghSubTypes; else subtypes = BodyInfo.mafrSubTypes; comboBox_subtype.Items.AddRange(subtypes); comboBox_subtype2.Items.AddRange(subtypes); if (comboBox_subtype.Items.Contains(questDetails.soldierSubType)) comboBox_subtype.Text = questDetails.soldierSubType; else comboBox_subtype.SelectedIndex = 0; h_checkBox_intrgt.Checked = questDetails.canInter; comboBox_Body.Items.Clear(); if (currentRegion.Equals("mtbs")) foreach (BodyInfoEntry infoEntry in BodyInfo.BodyInfoArray) { if (infoEntry.hasface) this.comboBox_Body.Items.Add(infoEntry.bodyName); } else foreach (BodyInfoEntry infoEntry in BodyInfo.BodyInfoArray) { this.comboBox_Body.Items.Add(infoEntry.bodyName); } if (comboBox_Body.Items.Count <= questDetails.hostageBodyIndex) comboBox_Body.SelectedIndex = 0; else comboBox_Body.SelectedIndex = questDetails.hostageBodyIndex; // // Quest-Specific Soldiers // Panel currentPanel = panelQuestEnemyDet; currentPanel.AutoScroll = false; foreach (Enemy questEnemy in questDetails.questEnemies) { EnemyBox questEnemyBox = new EnemyBox(questEnemy, enemyCP); questEnemyBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(questEnemyBox.getGroupBoxMain()); questEnemyBoxes.Add(questEnemyBox); } currentPanel.AutoScroll = true; // // CP-Specific soldiers // currentPanel = panelCPEnemyDet; currentPanel.AutoScroll = false; foreach (Enemy cpEnemy in questDetails.cpEnemies) { EnemyBox cpEnemyBox = new EnemyBox(cpEnemy, enemyCP); cpEnemyBox.BuildObject(currentPanel.Width); cpEnemyBox.e_label_spawn.Text = "Customize:"; cpEnemyBox.e_label_spawn.Left = 26; currentPanel.Controls.Add(cpEnemyBox.getGroupBoxMain()); CPEnemyBoxes.Add(cpEnemyBox); } currentPanel.AutoScroll = true; // // Hostages // currentPanel = panelHosDet; currentPanel.AutoScroll = false; foreach (Hostage hostage in questDetails.hostages) { HostageBox hostageBox = new HostageBox(hostage, questDetails.hostageBodyIndex); hostageBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(hostageBox.getGroupBoxMain()); hostageBoxes.Add(hostageBox); } currentPanel.AutoScroll = true; // // Heavy Vehicles // currentPanel = panelVehDet; currentPanel.AutoScroll = false; foreach (Vehicle vehicle in questDetails.vehicles) { VehicleBox vehiclebox = new VehicleBox(vehicle); vehiclebox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(vehiclebox.getGroupBoxMain()); vehicleBoxes.Add(vehiclebox); } currentPanel.AutoScroll = true; // // Animal Clusters // currentPanel = panelAnimalDet; currentPanel.AutoScroll = false; foreach (Animal animal in questDetails.animals) { AnimalBox anibox = new AnimalBox(animal); anibox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(anibox.getGroupBoxMain()); animalBoxes.Add(anibox); } currentPanel.AutoScroll = true; // // Dormant Items // currentPanel = panelItemDet; currentPanel.AutoScroll = false; foreach (Item item in questDetails.items) { ItemBox itemBox = new ItemBox(item); itemBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(itemBox.getGroupBoxMain()); itemBoxes.Add(itemBox); } currentPanel.AutoScroll = true; // // Active Items // currentPanel = panelAcItDet; currentPanel.AutoScroll = false; foreach (ActiveItem acitem in questDetails.activeItems) { ActiveItemBox activeItemBox = new ActiveItemBox(acitem); activeItemBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(activeItemBox.getGroupBoxMain()); activeItemBoxes.Add(activeItemBox); } currentPanel.AutoScroll = true; // // Models // currentPanel = panelStMdDet; currentPanel.AutoScroll = false; foreach (Model model in questDetails.models) { ModelBox modelBox = new ModelBox(model); modelBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(modelBox.getGroupBoxMain()); modelBoxes.Add(modelBox); } currentPanel.AutoScroll = true; panelDetails.AutoScroll = false; ShiftVisibilities(false); ShiftGroups(Height, Width); panelDetails.AutoScroll = true; }