1234567891011121314151617181920212223242526 |
- 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<string, DataTools.Location> 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
- }
- }
|