using DataTools; using System; using System.Linq; using UnityEngine; public class DataTransferer : MonoBehaviour { public DataGame dataGame; public LocationsManager locMgr; private void Start() { TransferData(); } public void TransferData() { Func l = (string x) => { var loc = new DataTools.Location { Id = x }; return loc; }; dataGame.GameData.Locations = locMgr.Locations.Select(x => l(x)).ToList(); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(dataGame); UnityEditor.AssetDatabase.SaveAssets(); #endif } }