public void Awake() { DataBindingSource dbs = GetComponent <DataBindingSource>(); dbs.AddBinding("y", () => settings.y, (object val) => settings.y = Convert.ToSingle(val)); }
private void BindResourceSetting(DataBindingSource bindingSource, string frequencyName, string abundanceName, ResourceSettings setting) { bindingSource.AddBinding(frequencyName, () => setting.Frequency, val => setting.Frequency = Convert.ToSingle(val)); bindingSource.AddBinding(abundanceName, () => setting.Abundance, val => setting.Abundance = Convert.ToSingle(val)); }