private void Manager_Load(object sender, EventArgs e) { var i = 0; foreach (var helphint in HelpHints) { var hint = new HelpObject() { Location = new Point(3, 3 + i * 99), Name = $"hint{i}", Size = new Size(750, 93), TabIndex = 2, Question = helphint.Key, Answer = string.Join("\n", helphint.Value) }; HelpTab.Controls.Add(hint); i++; } ; if (!Directory.Exists(MainDir)) { Directory.CreateDirectory(MainDir); } if (!Directory.Exists(XmlDir)) { Directory.CreateDirectory(XmlDir); } if (!Directory.Exists(SpritesheetDir)) { Directory.CreateDirectory(SpritesheetDir); } AddButton.Image = Properties.Resources.hud_plus_inactive; AddButton.Enabled = false; SaveButton.Image = Properties.Resources.hud_save_inactive; SaveButton.Enabled = false; }
void HelpObject() { Cursor.SetCursor(MouseIcons[4], new Vector2(MouseIcons[4].width / 2, MouseIcons[4].height / 2), CursorMode.Auto); if (Input.GetMouseButtonDown(0)) { foreach (Collider2D col in Physics2D.OverlapPointAll(Camera.main.ScreenToWorldPoint(Input.mousePosition))) { bool gethelp = false; if (col.gameObject.layer == 8) { if (ControlScript.CurrentMode == ControlScript.Mode.Build) { gethelp = true; } } else if (col.gameObject.layer == 10) { if (ControlScript.CurrentMode == ControlScript.Mode.Connect) { gethelp = true; } } else { gethelp = true; } if (gethelp) { if (col.gameObject.GetComponent <HelpObject>() != null) { HelpObject h = col.gameObject.GetComponent <HelpObject>(); HelpUIObject.GetComponent <HelpUI>().ShowHelpUI(); HelpUIObject.GetComponent <HelpUI>().SetUpHelpUI(h.ObjectName, h.ObjectDesc, h.sprites); control.DrawObject = SelectGameObject; break; } } } } }