Add Alot of stuff, Computer, repairStation, Whole game, Many things!
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EmptyCounter : BaseCounter {
|
||||
@@ -8,16 +5,26 @@ public class EmptyCounter : BaseCounter {
|
||||
[SerializeField] private ObjectSO _objectSo;
|
||||
|
||||
[SerializeField] private bool _shouldSpawnOnInteract;
|
||||
|
||||
public void SetItem(ObjectSO objectSo, float price = 0, bool isBroken = false) {
|
||||
//Set the item on the counter
|
||||
if(_currentObject != null) {
|
||||
Destroy(_currentObject.gameObject);
|
||||
}
|
||||
Transform objectTransform = Instantiate(objectSo.prefab, _counterObjectHandle);
|
||||
|
||||
Object obj = objectTransform.GetComponent<Object>();
|
||||
obj.ObjectSo = objectSo;
|
||||
obj.PaidPrice = price;
|
||||
obj.IsBroken = isBroken;
|
||||
obj.setObjectParent(this);
|
||||
}
|
||||
|
||||
public override void Interact() {
|
||||
InteractionBehaviour interactionBehaviour = PlayerController.Instance.InteractionBehaviour;
|
||||
if (_shouldSpawnOnInteract) {
|
||||
public override void Interact(InteractionBehaviour interactionBehaviour) {
|
||||
if (_shouldSpawnOnInteract) { //Debug
|
||||
if (_currentObject == null) {
|
||||
Transform objectTransform = Instantiate(_objectSo.prefab, _counterObjectHandle);
|
||||
objectTransform.GetComponent<Object>().setObjectParent(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!HasObject()) {
|
||||
@@ -44,6 +51,5 @@ public class EmptyCounter : BaseCounter {
|
||||
GetObject().setObjectParent(interactionBehaviour);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user