private void SelectMaterial() { LevelMaterial newMaterial = ListSelect.GetSelection(editTarget.ParentLevel.Materials, editTarget.Material); editTarget.Material = newMaterial; materialButton.Text = newMaterial.Name; }
public void OnWorldChange(int world) { if (LoadedLevelForKey == null) { LoadedLevelForKey = new Dictionary <CopyKey, LevelMaterial>(); } bool success = LoadedLevelForKey.TryGetValue(Key, out LevelMaterial lm); if (!success) { lm = new LevelMaterial(0, null); LoadedLevelForKey.Add(Key, lm); } if (world > 0) { if (lm.World != world) { lm.World = world; Addressables.LoadAssetAsync <ScriptableObject>($"World{world}/{Key.ToString()}").Completed += (obj) => { SetPropertiesFromObject(obj.Result, world); lm.CopyObject = obj.Result; Loaded = true; }; } else { SetPropertiesFromObject(lm.CopyObject, world); } } else { Loaded = true; } }