void CreateDatabase() { dbMerchants = ScriptableObject.CreateInstance <dbMerchantNPCDataObject>(); AssetDatabase.CreateAsset(dbMerchants, DATABASE_PATH + "dbMerchantDataItems.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
void CreateDatabase() { dbMerchants = ScriptableObject.CreateInstance<dbMerchantNPCDataObject>(); AssetDatabase.CreateAsset(dbMerchants, DATABASE_PATH + "dbMerchantDataItems.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
void LoadResources() { //dbMerchant won't be available to start dbMerchants = (dbMerchantNPCDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbMerchantDataItems.asset", typeof(dbMerchantNPCDataObject)); if (dbMerchants == null) { CreateDatabase(); } dbHulls = (dbHullDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbHullDataItems.asset", typeof(dbHullDataObject)); dbEngines = (dbEngineDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbEngineDataItems.asset", typeof(dbEngineDataObject)); dbCargo = (dbCargoModuleDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbCargoModuleDataItems.asset", typeof(dbCargoModuleDataObject)); dbShields = (dbShieldDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbShieldDataItems.asset", typeof(dbShieldDataObject)); dbPlating = (dbPlatingDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbPlatingDataItems.asset", typeof(dbPlatingDataObject)); dbSectors = (dbSectorDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbSectorDataItems.asset", typeof(dbSectorDataObject)); dbStations = (dbStationDataObject)AssetDatabase.LoadAssetAtPath(DATABASE_PATH + "dbStationDataItems.asset", typeof(dbStationDataObject)); }
/// <summary> /// Loads data from the Resource store into the public lists. Only need to do this once (on new or load game) /// </summary> private void LoadMasterData() { dbCannonDataObject dbCannons = (dbCannonDataObject)Resources.Load(@"AssetDatabases/dbCannonDataItems"); cannonMasterList = dbCannons.database; dbCargoModuleDataObject dbCargo = (dbCargoModuleDataObject)Resources.Load(@"AssetDatabases/dbCargoModuleDataItems"); cargoHoldMasterList = dbCargo.database; dbCommodityDataObject dbCommodities = (dbCommodityDataObject)Resources.Load(@"AssetDatabases/dbCommodityDataItems"); commodityMasterList = dbCommodities.database; dbCommodityShopDataObject dbCommodityShops = (dbCommodityShopDataObject)Resources.Load(@"AssetDatabases/dbCommodityShopDataItems"); commodityShopMasterList = dbCommodityShops.database; dbCrewDataObject dbCrew = (dbCrewDataObject)Resources.Load(@"AssetDatabases/dbCrewDataItems"); crewMasterList = dbCrew.database; dbEngineDataObject dbEngines = (dbEngineDataObject)Resources.Load(@"AssetDatabases/dbEngineDataItems"); engineMasterList = dbEngines.database; dbFighterBayDataObject dbFighterBays = (dbFighterBayDataObject)Resources.Load(@"AssetDatabases/dbFighterBayDataItems"); figherBayMasterList = dbFighterBays.database; dbHullDataObject dbHulls = (dbHullDataObject)Resources.Load(@"AssetDatabases/dbHullDataItems"); hullMasterList = dbHulls.database; dbJumpgateDataObject dbJumpgates = (dbJumpgateDataObject)Resources.Load(@"AssetDatabases/dbJumpgateDataItems"); jumpgateMasterList = dbJumpgates.database; dbMissileLauncherDataObject dbMissileLaunchers = (dbMissileLauncherDataObject)Resources.Load(@"AssetDatabases/dbMissileLauncherDataItems"); missileLauncherMasterList = dbMissileLaunchers.database; dbMerchantNPCDataObject dbMerchants = (dbMerchantNPCDataObject)Resources.Load(@"AssetDatabases/dbMerchantDataItems"); merchantMasterList = dbMerchants.database; dbPlatingDataObject dbPlating = (dbPlatingDataObject)Resources.Load(@"AssetDatabases/dbPlatingDataItems"); platingMasterList = dbPlating.database; dbScannerDataObject dbScanners = (dbScannerDataObject)Resources.Load(@"AssetDatabases/dbScannerDataItems"); scannerMasterList = dbScanners.database; dbSectorDataObject dbSectors = (dbSectorDataObject)Resources.Load(@"AssetDatabases/dbSectorDataItems"); sectorMasterList = dbSectors.database; dbShieldDataObject dbShields = (dbShieldDataObject)Resources.Load(@"AssetDatabases/dbShieldDataItems"); shieldMasterList = dbShields.database; dbStationDataObject dbStations = (dbStationDataObject)Resources.Load(@"AssetDatabases/dbStationDataItems"); stationMasterList = dbStations.database; }