// Start is called before the first frame update void Start() { //gameObjectの名前を切り抜いて取得している //例)Number(1)→1 numeric = int.Parse(name.Substring(name.Length - 2, 1)); numericPanel = transform.parent.gameObject.GetComponent <NumericPanel>(); }
/// <summary> /// Initializes the panel containing all numeric panels. /// </summary> private void initializeNumericPanels() { numericDefaultPanel.Controls.Clear(); int i = 0; foreach (NumericOption option in currentModel.NumericOptions) { float val = 0; numericSettings.TryGetValue(option, out val); NumericPanel panel = new NumericPanel(option, val); panel.upDown.ValueChanged += (s, e) => { numericSettings.Remove(panel.option); numericSettings.Add(panel.option, (float)panel.upDown.Value); }; numericDefaultPanel.Controls.Add(panel); panel.Location = new System.Drawing.Point(0, i * panel.Size.Height); i++; } }