コード例 #1
0
        public void Awake()
        {
            DataBindingSource dbs = GetComponent <DataBindingSource>();

            dbs.AddBinding("y",
                           () => settings.y,
                           (object val) => settings.y = Convert.ToSingle(val));
        }
コード例 #2
0
 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));
 }