using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*Attached to prefabs in Scene*/
public class KitchenObject : MonoBehaviour
{
[SerializeField] private KitchenObjectSO kSO;
//private IKitchenObjectParent kitchenObjectParent;
private ClearCounterScript clearCounter;
public KitchenObjectSO GetKitchenObjectSO()
{
return kSO;
}
public void SetClearCounter(ClearCounterScript clearCounter)
{
/*
* Clear the previous selected counter of its kitchen object
*/
if(this.clearCounter != null)
{
this.clearCounter.ClearKitchenObject();
}
/*
* The 'designatedCounter' is the sent argument representing
* selected counter in Scene
*
* Set to the 'counter' property
*/
this.clearCounter = clearCounter;
if(clearCounter.HasKitchenObject())
{
Debug.LogError("Counter already has a Kitchen Object!");
}
/*
* Inform Kitchen Object which counter it's on
*/
clearCounter.SetKitchenObject(this);
/*
* Move th Kitchen Object to the new counter
*/
transform.parent = clearCounter.GetKitchenObjectFollowTransform();
transform.localPosition = Vector3.zero;
}
public ClearCounterScript GetClearCounter()
{
return clearCounter;
}
/*public IKitchenObjectParent GetKitchenObjectParent()
{
return kitchenObjectParent;
}*/
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}