// Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        surplus     = GetNode <ReactiveLabel>("CenterContainer/PanelContainer/AdjustContainer/AdjustSurplusContainer/MarginContainer/VBoxContainer/HBoxContainer/Value");
        incomeTotal = GetNode <ReactiveLabel>("CenterContainer/PanelContainer/AdjustContainer/AdjustInputContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/Value");
        outputTotal = GetNode <ReactiveLabel>("CenterContainer/PanelContainer/AdjustContainer/AdjustOutputContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/Value");

        surplus.Assoc(GMRoot.runner.economy.OBSProperty(x => x.monthSurplus));
        incomeTotal.Assoc(GMRoot.runner.economy.OBSProperty(x => x.incomeTotal));
        outputTotal.Assoc(GMRoot.runner.economy.OBSProperty(x => x.outputTotal));

        adjustInputContainer  = GetNode <VBoxContainer>("CenterContainer/PanelContainer/AdjustContainer/AdjustInputContainer/MarginContainer/HBoxContainer/VBoxContainer");
        adjustOutputContainer = GetNode <VBoxContainer>("CenterContainer/PanelContainer/AdjustContainer/AdjustOutputContainer/MarginContainer/HBoxContainer/VBoxContainer");

        var adjustEnumTypes = EnumEx.GetValues <RunnerAdjust.EType>();

        foreach (var elem in adjustEnumTypes.Where(x => x.HasAttribute <RunnerAdjust.EconomyInput>()))
        {
            var adjustPanel = AdjustPanel.Instance(adjustInputContainer, GMRoot.runner.adjusts.Single(x => x.etype == elem));
        }

        foreach (var elem in adjustEnumTypes.Where(x => x.HasAttribute <RunnerAdjust.EconomyOutput>()))
        {
            var adjustPanel = AdjustPanel.Instance(adjustOutputContainer, GMRoot.runner.adjusts.Single(x => x.etype == elem));
        }
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     adjustPanel = this.GetComponentInParent <AdjustPanel> ();
     toggle      = this.GetComponent <Toggle> ();
     image       = this.GetComponentInChildren <Image> ();
     toggle.onValueChanged.AddListener(delegate {
         ToggleChangeListener();
     });
     ToggleChangeListener();
 }