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

@@ -0,0 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SellCounter : BaseCounter {
private bool _isSelling = false;
private float _sellingPrice;
protected void Awake() {
}
public override void Interact() {
InteractionBehaviour interactionBehaviour = PlayerController.Instance.InteractionBehaviour;
if (!_isSelling) {
//This counter is not selling an item yet
if (interactionBehaviour.HasObject()) {
//the player has something to sell
Object obj = interactionBehaviour.GetObject();
//Check if the object is sellable
if (obj.TryGetComponent(out Object objectComponent)) {
Debug.Log("Player has something and it is sellable");
HUDManager.Instance.SellItem(this, objectComponent);
}
else {
Debug.Log("Player has something but it is not sellable");
}
}
}
}
//Gets called if an item is being sold on this counter
//This should prevent the counter thinking it's selling something if the user cancels the UI sell
public void ConfirmSell(Object obj) {
_isSelling = true;
obj.setObjectParent(this);
_currentObject = obj;
_sellingPrice = obj.ObjectSo.basePrice;
}
}