I will not mention since when I am on that problem
Ok here is the code
I have tried so many things that effectively what is in it now may not register as “standard” but the lack of api description led me to explore everything I could think of and more..
I am coming from C++ but that should not be an excuse for mudding in that situation
Thank you for taking the time to explain if possible
You must know that the menu works but when I want to click on an item button I cannot select it in the view meaning activate it and deactivate the others.
I have no problem with the logic of on off but the syntax is so weird that it is out of logic for me
using System;
using UnityEngine;
using UnityForms;
using System.Collections;
sealed public partial class MainMenuFormBague : Form
{
private GameObject[ ] composants;
private SingleFormPanel PanelBague;
private Button ButtonDiamondW;
private Button ButtonDiamondT;
private Button ButtonDiamondR;
private Button ButtonPearl;
// private String GameTag;
private Button ButtonNewForm;
public override void Initialize()
{
Text = “Form Modal”;
Draggable = false;
WindowMode = FormBorderStyle.Window;
Size = new Size(280, 300);
// Location = FormsUtility.CenterScreen(this);
Location = new Point(-18,32);
//creates the panels that generates the controls
PanelBague = new SingleFormPanel(this);
AddPanel(PanelBague);
ButtonDiamondW = (Button)PanelBague.AddControl(new Button());
ButtonDiamondW.Text = “Diamant Blanc”;
ButtonDiamondW.Size = new Size(200, 45);
ButtonDiamondW.Location =
FormsUtility.AlignControl
(
Point.Zero, ButtonDiamondW,
HorizontalAlignment.Center, VerticalAlignment.Manual
);
ButtonDiamondW.ButtonClick += ButtonDiamondW_OnClick;
ButtonDiamondT = (Button)PanelBague.AddControl(new Button());
ButtonDiamondT.Text = “Emeraude”;
ButtonDiamondT.Size = new Size(200, 45);
ButtonDiamondT.Location =
FormsUtility.AlignControl
(
new Point(0, 50), ButtonDiamondT,
HorizontalAlignment.Center, VerticalAlignment.Manual
);
ButtonDiamondT.ButtonClick += ButtonDiamondT_OnClick;
ButtonPearl = (Button)PanelBague.AddControl(new Button());
ButtonPearl.Text = “Perle”;
ButtonPearl.Size = new Size(200,45);
ButtonPearl.Location =
FormsUtility.AlignControl
(
new Point(0, 100), ButtonPearl,
HorizontalAlignment.Center, VerticalAlignment.Manual
);
ButtonPearl.ButtonClick += ButtonPearl_OnClick;
ButtonDiamondR = (Button)PanelBague.AddControl(new Button());
ButtonDiamondR.Text = "Rubis ";
ButtonDiamondR.Size = new Size(200, 45);
ButtonDiamondR.Location =
FormsUtility.AlignControl
(
new Point(0, 150), ButtonDiamondR,
HorizontalAlignment.Center, VerticalAlignment.Manual
);
ButtonDiamondR.ButtonClick += ButtonDiamondR_OnClick;
//ButtonClose = (Button)PanelBague.AddControl(new Button());
//ButtonClose.Text = “Fermer”;
//ButtonClose.Size = new Size(200, 45);
//ButtonClose.Location =
// FormsUtility.AlignControl
// (
// new Point(0, 195), ButtonClose,
// HorizontalAlignment.Center, VerticalAlignment.Manual
// );
//ButtonClose.ButtonClick += ButtonClose_OnClick;
//ButtonNewForm = (Button)PanelBague.AddControl(new Button());
//ButtonNewForm.Text = “New Window”;
//ButtonNewForm.Size = new Size(200, 30);
//ButtonNewForm.Location =
// FormsUtility.AlignControl
// (
// new Point(0, 150), ButtonNewForm,
// HorizontalAlignment.Center, VerticalAlignment.Manual
// );
//ButtonNewForm.ButtonClick += ButtonNewForm_OnClick;
}
static var component : GameObject[ ];
private void ButtonDiamondW_OnClick(object source, ClickEventArgs e)
{
component = GameObject.FindGameObjectsWithTag(“bague”);
print("This is component " component[2]); // does not work too much red in the debugger
for(var j=0 ; j<component .length ; j++) {
component [j].active = false;
// deos not work either so many entries in the debugger
}
private void ButtonDiamondT_OnClick(object source, ClickEventArgs e)
{
}
private void ButtonPearl_OnClick(object source, ClickEventArgs e)
{
}
private void ButtonDiamondR_OnClick(object source, ClickEventArgs e)
{
}
}