Interaktionen 2.0

This commit is contained in:
Simon Lübeß
2024-04-07 00:09:53 +02:00
parent 2f5f25d0bd
commit dfe1451d3b
42 changed files with 1691 additions and 222 deletions

View File

@ -0,0 +1,12 @@
using UnityEngine;
namespace Interaction
{
public class Copier : MonoBehaviour
{
public void Copy()
{
Debug.Log("Kopierer erfolgreich benutzt!");
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cc147cbb4aa44e209ac96e08e57cab11
timeCreated: 1712427562

View File

@ -0,0 +1,18 @@
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Serialization;
namespace Interaction
{
public class GiveItemInteractible : Interactible
{
[SerializeField] private Developer _developer;
/// <summary>
/// Der Entwickler an den das Item übergeben wird.
/// </summary>
public Developer Developer => _developer;
public override bool IsBlocked() => !GameManager.Instance.Player.CarriesItem;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8c62dfbaefa34afca6b4a8378b9c9083
timeCreated: 1712427286

View File

@ -0,0 +1,50 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.Events;
using Utility;
namespace Interaction
{
public enum InteractibleType
{
Pickup,
Use,
Give
}
public abstract class Interactible : MonoBehaviour
{
[SerializeField]
private Outline _outline;
[SerializeField]
private Color _selectedColor = Color.white;
[SerializeField]
private Color _highlightColor = Color.yellow;
public void Highlight(bool hightlight)
{
_outline.enabled = hightlight;
_outline.OutlineColor = _highlightColor;
_outline.OutlineWidth = 2;
}
public void SetSelected(bool isSelected)
{
Highlight(true);
if (isSelected)
{
_outline.OutlineColor = _selectedColor;
_outline.OutlineWidth = 4;
}
}
public virtual bool IsBlocked()
{
return false;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36d05f0291670f94c9430f1f5e2604a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using UnityEngine;
namespace Interaction
{
public class PickupInteractible : Interactible
{
[SerializeField]
private GameObject _model;
[SerializeField]
private string _name;
public GameObject Model => _model;
public string Name => _name;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4cae243dedd2499e8326b9ed6de6e32e
timeCreated: 1712426173

View File

@ -0,0 +1,12 @@
using UnityEngine.Events;
using UnityEngine.Serialization;
namespace Interaction
{
public class UseInteractible : Interactible
{
[FormerlySerializedAs("Text")] public string UseText;
public UnityEvent OnUse;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 18452aa2b74a4b10aaed4635c1080c90
timeCreated: 1712426953