Add Alot of stuff, Computer, repairStation, Whole game, Many things!

This commit is contained in:
2024-11-18 06:31:28 +01:00
parent 19b7964f83
commit a2091c3cf2
430 changed files with 55285 additions and 715 deletions

View File

@@ -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);
}
}
}
}