Selling Functionality, Picking up items, Basic computer
This commit is contained in:
35
Assets/Interactables/BaseCounter.cs
Normal file
35
Assets/Interactables/BaseCounter.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BaseCounter : MonoBehaviour, IObjectParentHolder, IInteractable {
|
||||
|
||||
//This could be private, but since this should be only inherticed I will leave it as protected
|
||||
[SerializeField] protected Transform _counterObjectHandle;
|
||||
|
||||
protected Object _currentObject;
|
||||
|
||||
public virtual void Interact() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user