Pickup Pizza und so

This commit is contained in:
Simon Lübeß
2024-04-06 18:08:54 +02:00
parent 12b856e6e1
commit ba09d4fff1
59 changed files with 4956 additions and 93 deletions

View File

@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pickupable : MonoBehaviour
{
[SerializeField]
private Outline _outline;
[SerializeField]
private Color _selectedColor = Color.white;
[SerializeField]
private Color _highlightColor = Color.yellow;
[SerializeField]
private GameObject _model;
[SerializeField]
private string _name;
public GameObject Model => _model;
public string Name => _name;
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;
}
}
}