Exemplo n.º 1
0
    void OnValidate()
    {
        // auto-load all location sprites in each area
        foreach (var area in areas)
        {
            area.locations = new List <Sprite>(AssetHandler.LoadChildAssets <Sprite>(area.areaTexture));
        }
        // sort ascending enemies spawn list by chance of spawn
        enemies = enemies?.OrderBy(x => x.relativeChanceWeight).ToList();

        // required to be able to save script changes to SO to an actual asset file (only inspector changes are saved by default)
        EditorUtility.SetDirty(this);
    }