add spawn point, death
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Assets.Scripts;
|
||||
using UnityEngine;
|
||||
|
||||
public class DoorInteract : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject _doorGameObject;
|
||||
private IDoor _door;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_door =_doorGameObject.GetComponent<IDoor>();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D collider)
|
||||
{
|
||||
var player = collider.GetComponent<Player>();
|
||||
if (player!=null)
|
||||
{
|
||||
if (player.IsHasKey())
|
||||
{
|
||||
_door.OpenDoor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c43502b5415adc044b631292348c83e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 541209b3a8828a3429d3a6c93b0350f3, type: 3}
|
||||
m_Name: Water
|
||||
m_EditorClassIdentifier:
|
||||
ElementType: 5
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59cbe601225090b41a19270c63bc6390
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user