GameVsJam/3d Prototyp/Assets/Scripts/Interaction/Interactible.cs

51 lines
1.1 KiB
C#

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