79 lines
2.5 KiB
C#
79 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BlueWater.Items;
|
|
using BlueWater.Tycoons;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater
|
|
{
|
|
public enum SaveStage
|
|
{
|
|
None = 0,
|
|
TitanSlime = 3,
|
|
Rhinoceros = 4,
|
|
SandMole = 5,
|
|
GhostBarrel = 6
|
|
}
|
|
|
|
public class DataManager : Singleton<DataManager>
|
|
{
|
|
public SaveStage CurrentSaveStage { get; set; }
|
|
|
|
[field: Title("스프라이트 데이터")]
|
|
[field: SerializeField]
|
|
public SpriteDataSo SpriteDataSo { get; private set; }
|
|
|
|
[field: Title("아이템 데이터")]
|
|
[field: SerializeField]
|
|
public Inventory Inventory { get; private set; }
|
|
|
|
[field: Title("타이쿤 데이터")]
|
|
[field: SerializeField]
|
|
public TycoonData TycoonData { get; private set; }
|
|
|
|
[field: Title("실시간 데이터")]
|
|
public int Gold { get; set; }
|
|
|
|
public event Action<int> OnChangeGold;
|
|
|
|
private void Start()
|
|
{
|
|
GetMoney(5000);
|
|
}
|
|
|
|
public void TestData()
|
|
{
|
|
Inventory.AddItem(new ItemSlot("10107", 2));
|
|
Inventory.AddItem(new ItemSlot("10108", 1));
|
|
Inventory.AddItem(new ItemSlot("10109", 2));
|
|
Inventory.AddItem(new ItemSlot("10201", 1));
|
|
Inventory.AddItem(new ItemSlot("10404", 9));
|
|
Inventory.AddItem(new ItemSlot("10503", 4));
|
|
Inventory.AddItem(new ItemSlot("10507", 15));
|
|
Inventory.AddItem(new ItemSlot("10508", 100));
|
|
Inventory.AddItem(new ItemSlot("10603", 3));
|
|
Inventory.AddItem(new ItemSlot("10701", 999));
|
|
Inventory.AddItem(new ItemSlot("10704", 5396));
|
|
Inventory.AddItem(new ItemSlot("10705", 66));
|
|
Inventory.AddItem(new ItemSlot("10706", 35));
|
|
Inventory.AddItem(new ItemSlot("60001", 2));
|
|
|
|
TycoonData.AddFoodRecipe("30001");
|
|
TycoonData.AddFoodRecipe("30002");
|
|
TycoonData.AddFoodRecipe("30004");
|
|
TycoonData.AddFoodRecipe("30005");
|
|
TycoonData.AddFoodRecipe("30006");
|
|
|
|
TycoonData.AddDrinkRecipe("Drink001");
|
|
TycoonData.AddDrinkRecipe("Drink002");
|
|
TycoonData.AddDrinkRecipe("Ice001");
|
|
}
|
|
|
|
public void GetMoney(int money)
|
|
{
|
|
Gold += money;
|
|
OnChangeGold?.Invoke(Gold);
|
|
}
|
|
}
|
|
} |