Первый коммит с LFS.

This commit is contained in:
vladislove committed 2026-01-11 17:04:23 +03:00
1 parent 4fcb1e2f24
commit 179816dc4b
5084 files changed
+3714098 -1

No files matched your search

@@ -0,0 +1,30 @@
using UnityEngine;
public class PickupBagAction : MonoBehaviour, IInteractable
{
[Header("Settings")]
public ItemData bagItemData; // Reference to the bag's ScriptableObject
public void Interact()
{
// 1. Try to add the item to the inventory
bool added = InventorySystem.Instance.AddItem(bagItemData);
if (added)
{
// 2. Notify the quest system that we interacted with this object
// The quest itself will decide what to do next (e.g., show the bag in hand)
if (InteractionHandler.Instance != null)
{
InteractionHandler.Instance.NotifyInteraction(gameObject);
}
}
// If the item was not added (already exists or no space), do nothing.
// A message about this is logged from the InventorySystem.
}
public string GetDescription()
{
return "Pick up trash bags";
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eae795e938db451ebcd0e939e9f3366b
timeCreated: 1764526904
@@ -0,0 +1,16 @@
using UnityEngine;
namespace Quest_Environment.Q1
{
public class TrashBin :MonoBehaviour,IInteractable
{
public void Interact()
{
}
public string GetDescription()
{
return "Положить в мусорку";
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 12f55188f40241dd84d50be74a4eb8ac
timeCreated: 1764607809
@@ -0,0 +1,61 @@
using Quests;
using UnityEngine;
public class TrashPile : MonoBehaviour, IInteractable
{
[Header("Settings")]
public ItemData requiredBagItem; // Ссылка на ItemData мешка (для проверки в инвентаре)
public void Interact()
{
// 1. Проверяем, что сейчас активен именно квест по сбору мусора
if (QuestManager.Instance?.currentQuest is Q1CollectGarbageQuest garbageQuest)
{
// 2. Проверяем, есть ли у игрока мешок
if (InventorySystem.Instance.HasItem(requiredBagItem))
{
// 3. Проверяем, не полон ли мешок
if (garbageQuest.IsBagFull())
{
Debug.Log("Мешок полон! Сначала выбросьте его в контейнер.");
}
else
{
// Если все проверки пройдены, уведомляем систему квестов
InteractionHandler.Instance.NotifyInteraction(gameObject);
// Уничтожаем объект мусора
Destroy(gameObject);
}
}
else
{
Debug.Log("Нужен мешок для мусора!");
}
}
// Если активен другой квест, ничего не делаем.
}
public string GetDescription()
{
// Даем описание, только если активен квест по сбору мусора
if (QuestManager.Instance?.currentQuest is Q1CollectGarbageQuest garbageQuest)
{
// Проверяем, есть ли у игрока мешок
if (!InventorySystem.Instance.HasItem(requiredBagItem))
{
return "Нужен мешок для мусора"; // Подсказка, если нет мешка
}
// Проверяем, не полон ли мешок
if (garbageQuest.IsBagFull())
{
return "Мешок полон!";
}
return "Собрать мусор"; // Стандартное описание
}
// Если квест неактивен, возвращаем пустую строку
return "";
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3d20c394d52e426d964b8cf9d1de6b83
timeCreated: 1764526435