Add items, Pickup logic works

This commit is contained in:
2024-10-17 01:22:54 +02:00
parent ec487096bf
commit f594bdf112
72 changed files with 7258 additions and 918 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
public class Object : MonoBehaviour {
[SerializeField] private ObjectSO _objectSo;
private IObjectParentHolder _objectParent;
public ObjectSO ObjectSo {
get => _objectSo;
set => _objectSo = value;
}
public IObjectParentHolder getObjectParent() {
return _objectParent;
}
public void setObjectParent(IObjectParentHolder objectParent) {
if (this._objectParent != null) {
this._objectParent.ClearObject();
}
this._objectParent = objectParent;
if (objectParent.HasObject()) {
Debug.LogError("Parent has already something on it?");
}
objectParent.SetObject(this);
transform.parent = _objectParent.GetHolderTransform();
transform.localPosition = Vector3.zero;
}
}