Пример #1
0
        // Called when the node enters the scene tree for the first time.
        public override void _Ready()
        {
            name = GetNode <Label>("CenterContainer/PanelContainer/VBoxContainer/Name");

            num        = GetNode("CenterContainer/PanelContainer/VBoxContainer/StatisticContainer/GridContainer/PopNum");
            tax        = GetNode("CenterContainer/PanelContainer/VBoxContainer/StatisticContainer/GridContainer/Tax");
            farm       = GetNode("CenterContainer/PanelContainer/VBoxContainer/StatisticContainer/GridContainer/Farm");
            consume    = GetNode("CenterContainer/PanelContainer/VBoxContainer/StatisticContainer/GridContainer/Consume");
            adminSpend = GetNode("CenterContainer/PanelContainer/VBoxContainer/StatisticContainer/GridContainer/Admin");

            name.Text = gmObj.name;

            num.GetNode <ReactiveLabel>("Value").Assoc(gmObj.OBSProperty(x => x.num));

            if (gmObj.tax != null)
            {
                tax.GetNode <ReactiveLabel>("Value").Assoc(gmObj.tax.OBSProperty(z => z.value));
            }
            if (gmObj.consume != null)
            {
                consume.GetNode <ReactiveLabel>("Value").Assoc(gmObj.consume.OBSProperty(z => z.value));
            }
            if (gmObj.adminExpend != null)
            {
                adminSpend.GetNode <ReactiveLabel>("Value").Assoc(gmObj.adminExpend.OBSProperty(z => z.value));
            }
            //farm.GetNode<ReactiveLabel>("Value").Assoc(gmObj.farm);
        }
Пример #2
0
 public override void _Ready()
 {
     GetNode <Label>("Type").Text = gmObj.name;
     GetNode <Button>("Button").Connect("pressed", this, nameof(_on_Button_Pressed));
     GetNode <ReactiveLabel>("Num").Assoc(gmObj.OBSProperty(x => x.num));
 }