ChestAnimaton (beta)

This commit is contained in:
2025-06-27 08:23:17 +02:00
parent 60a715b7d4
commit dd590618ee
20 changed files with 807 additions and 2059 deletions

View File

@@ -231,8 +231,8 @@ public class MapGenManager : MonoBehaviour
int count = Mathf.Max(1, Mathf.FloorToInt(dist / step));
Vector3 segPos = start + axis * (step * 0.5f);
var door = Instantiate(DoorCorridor, segPos, rot, transform);
door.GetComponent<DoorController>()?.OpenDoor();
var door = Instantiate(CorridorStraight, segPos, rot, transform);
//door.GetComponent<DoorController>()?.OpenDoor();
for (int i = 1; i < count; i++)
{

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 49fc9ba93cade2146950d07e3041cbc7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
using UnityEngine;
public class ChestLogic : MonoBehaviour
{
private Animator animator;
private bool isOpen = false;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
}
private void OnMouseDown()
{
Debug.Log("Chest clicked");
if (!isOpen)
{
animator.SetTrigger("Open");
isOpen = true;
}
else
{
animator.SetTrigger("Close");
isOpen = false;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9270408fc9f30214a9251fc41f379f0e