Ejemplo n.º 1
0
        private void SelectMaterial()
        {
            LevelMaterial newMaterial = ListSelect.GetSelection(editTarget.ParentLevel.Materials, editTarget.Material);

            editTarget.Material = newMaterial;
            materialButton.Text = newMaterial.Name;
        }
Ejemplo n.º 2
0
    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;
        }
    }