Ejemplo n.º 1
0
    //
    public void UpdateDynamicSettings()
    {
        List <int> DynamicIndexes = new List <int>();

        for (int i = 0; i < SettingsContainer.childCount; i++)
        {
            if (SettingsContainer.GetChild(i).GetComponent <DynamicSetting>() != null)
            {
                DynamicIndexes.Add(i);
            }
        }
        //Delete
        for (int i = 0; i < DynamicIndexes.Count; i++)
        {
            Destroy(SettingsContainer.GetChild(i).gameObject);
        }
        //
        for (int i = 0; i < cashBoxes.Count; i++)
        {
            DynamicSetting dynamicSetting = Instantiate(Resources.Load <DynamicSetting>("Prefabs/CashBoxSetting"));
            //Event initialize
            dynamicSetting.inputField.onValueChanged.AddListener(cashBoxes[i].SetPPM); //Internet help me :) (Delegate)
            dynamicSetting.inputField.gameObject.AddComponent <StartValueApplyer>();   //Костыль?
            //Visual initialize
            dynamicSetting.transform.SetParent(SettingsContainer);
            dynamicSetting.transform.localScale = Vector3.one;
        }
    }
Ejemplo n.º 2
0
 public SettingsModel()
 {
     _itemSettings        = new DynamicSetting <ItemSettings>();
     _weightingSettings   = new DynamicSetting <WeightingSettings>();
     _advancedSettings    = new DynamicSetting <AdvancedSettings>();
     _paragonSettings     = new DynamicSetting <ParagonSettings>();
     _kanaisCubeSetting   = new DynamicSetting <KanaisCubeSetting>();
     _combatSettings      = new DynamicSetting <CombatSettings>();
     _itemListSettings    = new DynamicSetting <ItemListSettings>();
     _routineSettings     = new DynamicSetting <RoutineSettings>();
     _explorationSettings = new DynamicSetting <ExplorationSettings>();
 }