first commit

This commit is contained in:
2026-06-04 18:31:31 +03:00
commit deb988bddf
143 changed files with 13144 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
using UnityEngine;
using UnityEngine.UI;
public class CraftingDemoController : MonoBehaviour
{
public Inventory inventory;
public CraftingSystem craftingSystem;
public GameObject craftingPanel;
public Text hintText;
public bool addStartingResources;
private void Start()
{
if (addStartingResources && inventory != null && inventory.slots.Count == 0)
{
inventory.AddTestResources();
}
if (craftingSystem != null)
{
craftingSystem.lastMessage = "Нажмите кнопку рецепта, чтобы создать предмет.";
craftingSystem.Refresh();
}
UpdateHint();
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.R) && inventory != null)
{
inventory.AddTestResources();
if (craftingSystem != null)
{
craftingSystem.lastMessage = "Инвентарь сброшен к тестовому набору ресурсов.";
craftingSystem.Refresh();
}
}
if (Input.GetKeyDown(KeyCode.C) && craftingPanel != null)
{
craftingPanel.SetActive(!craftingPanel.activeSelf);
UpdateHint();
}
}
private void UpdateHint()
{
if (hintText != null)
{
hintText.text = "WASD - движение | E - подобрать | 1-9/0 - выбрать слот | F - использовать | R - тестовые ресурсы | C - UI";
}
}
}