Initial Commit

This commit is contained in:
2026-05-28 10:16:15 +01:00
commit 405ae3b309
13091 changed files with 2149948 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
using UnityEngine;
public class StockObject : MonoBehaviour
{
public StockInfo info;
[SerializeField] float moveSpeed;
public bool isPlaced;
public Rigidbody theRB;
private Collider theCol;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
TryGetComponent(out theRB);
TryGetComponent(out theCol);
}
// Update is called once per frame
void Update()
{
if(isPlaced)
{
transform.localPosition = Vector3.MoveTowards(transform.localPosition, Vector3.zero, moveSpeed * Time.deltaTime);
transform.localRotation = Quaternion.Slerp(transform.localRotation, Quaternion.identity, moveSpeed * Time.deltaTime);
}
}
public void Pickup()
{
theRB.isKinematic = true;
transform.localPosition = Vector3.zero;
transform.localRotation = Quaternion.identity;
isPlaced = false;
theCol.enabled = false;
}
public void MakePlaced()
{
theRB.isKinematic = true;
isPlaced = true;
theCol.enabled = false;
}
public void Release()
{
transform.SetParent(null);
theRB.isKinematic = false;
theCol.enabled = true;
}
}