ChestAnimaton (beta)
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
8
3D blobici/Assets/Scripts/Objects.meta
Normal file
8
3D blobici/Assets/Scripts/Objects.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49fc9ba93cade2146950d07e3041cbc7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
35
3D blobici/Assets/Scripts/Objects/ChestLogic.cs
Normal file
35
3D blobici/Assets/Scripts/Objects/ChestLogic.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
3D blobici/Assets/Scripts/Objects/ChestLogic.cs.meta
Normal file
2
3D blobici/Assets/Scripts/Objects/ChestLogic.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9270408fc9f30214a9251fc41f379f0e
|
||||
Reference in New Issue
Block a user