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,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;
}
}
}