33 lines
862 B
C#
33 lines
862 B
C#
using UnityEngine;
|
|
|
|
public class BaseCounter : MonoBehaviour, IObjectParentHolder, IInteractable {
|
|
|
|
//This could be private, but since this should be only inherited I will leave it as protected
|
|
[SerializeField] protected Transform _counterObjectHandle;
|
|
|
|
protected Object _currentObject;
|
|
|
|
public virtual void Interact(InteractionBehaviour interactionBehaviour) {
|
|
Debug.LogError("Interact not implemented");
|
|
}
|
|
|
|
public virtual Transform GetHolderTransform() {
|
|
return _counterObjectHandle;
|
|
}
|
|
|
|
public virtual void SetObject(Object obj) {
|
|
_currentObject = obj;
|
|
}
|
|
|
|
public virtual Object GetObject() {
|
|
return _currentObject;
|
|
}
|
|
|
|
public virtual void ClearObject() {
|
|
_currentObject = null;
|
|
}
|
|
|
|
public virtual bool HasObject() {
|
|
return _currentObject != null;
|
|
}
|
|
} |