+ 상호작용 오브젝트 외곽선 기능 추가 + 손님 계산 기능 추가 + 손님 계산 시 Ui 출력 및 파티클, 효과 추가 + 대화 시스템 로직 수정 + 테이블 수정 + 캐릭터 스파인 교체
91 lines
2.8 KiB
C#
91 lines
2.8 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 List<int> FoodRecipes { get; private set; } = new();
|
|
|
|
[field: Title("타이쿤 데이터")]
|
|
[field: SerializeField]
|
|
public TycoonData TycoonData { get; private set; }
|
|
|
|
[field: Title("실시간 데이터")]
|
|
public int Gold { get; set; }
|
|
|
|
public event Action<FoodData> OnChangeFoodRecipe;
|
|
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));
|
|
|
|
AddFoodRecipe(30001);
|
|
AddFoodRecipe(30002);
|
|
AddFoodRecipe(30004);
|
|
AddFoodRecipe(30005);
|
|
AddFoodRecipe(30006);
|
|
}
|
|
|
|
public void AddFoodRecipe(int idx)
|
|
{
|
|
if (FoodRecipes.Contains(idx)) return;
|
|
|
|
var foodData = ItemManager.Instance.GetFoodDataByIdx(idx);
|
|
if (foodData == null) return;
|
|
|
|
FoodRecipes.Add(idx);
|
|
OnChangeFoodRecipe?.Invoke(foodData);
|
|
}
|
|
|
|
public void GetMoney(int money)
|
|
{
|
|
Gold += money;
|
|
OnChangeGold?.Invoke(Gold);
|
|
}
|
|
}
|
|
} |