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

@@ -5,14 +5,43 @@ using UnityEngine;
public class Object : MonoBehaviour {
[SerializeField] private ObjectSO _objectSo;
[SerializeField] private Renderer _renderer;
private IObjectParentHolder _objectParent;
private float _paidPrice;
private bool _isBroken;
public ObjectSO ObjectSo {
get => _objectSo;
set => _objectSo = value;
}
public float PaidPrice {
get => _paidPrice;
set => _paidPrice = value;
}
//When its broken it should be a diff color
public bool IsBroken {
get => _isBroken;
set {
_isBroken = value;
GetComponent<Object>().SetBroken(value);
}
}
private void SetBroken(bool value) {
//Set to red if broken
if (value) {
_renderer.material.color = Color.red;
}
else {
_renderer.material.color = Color.white;
}
}
public IObjectParentHolder getObjectParent() {
return _objectParent;
}
@@ -25,6 +54,7 @@ public class Object : MonoBehaviour {
this._objectParent = objectParent;
if (objectParent.HasObject()) {
Debug.LogError("Parent has already something on it?");
Debug.Break();
}
objectParent.SetObject(this);