3
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Door : MonoBehaviour
|
||||
{
|
||||
public Animator _ani;
|
||||
public BoxCollider2D bx;
|
||||
public bool isOpen=false;
|
||||
public GameObject boss;
|
||||
private void Awake()
|
||||
{
|
||||
_ani = GetComponentInChildren<Animator>();
|
||||
bx = GetComponent<BoxCollider2D>();
|
||||
boss = GameObject.FindWithTag("Boss");
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if(isOpen)
|
||||
{
|
||||
Debug.Log("¿ªÃÅ");
|
||||
_ani.Play("activate");
|
||||
|
||||
StartCoroutine(nameof(Open));
|
||||
|
||||
}
|
||||
}
|
||||
private void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
if (collision.gameObject.CompareTag("Player")&&!isOpen)
|
||||
{
|
||||
UIManager.Instance.Show<UIOpen>();
|
||||
}
|
||||
}
|
||||
private IEnumerator Open()
|
||||
{
|
||||
yield return new WaitForSeconds(7f);
|
||||
|
||||
bx.isTrigger = true;
|
||||
boss.GetComponentInChildren<BossAI>().SetBegin(true);
|
||||
isOpen=false;
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af5df1265cd523f41a62497ebb5a4616
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,30 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FacingCamera : MonoBehaviour
|
||||
{
|
||||
Transform[] childs;
|
||||
private Transform cameraMain;
|
||||
private void Awake()
|
||||
{
|
||||
cameraMain = GameObject.FindGameObjectWithTag("Camera").transform;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
childs = new Transform[transform.childCount];
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
childs[i] = transform.GetChild(i);
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
for (int i = 0; i < childs.Length; i++)
|
||||
{
|
||||
childs[i].rotation = cameraMain.rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 198a8841e3728a9498e9d94c5c795c9f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user