3
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d0bb11ea6c458148bdb5b29921de6e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,64 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections;
|
||||
//using System.Collections.Generic;
|
||||
//using UnityEngine;
|
||||
//using UnityEngine.Events;
|
||||
|
||||
|
||||
//普通怪物
|
||||
//public class Enemy : CharacterManager
|
||||
//{
|
||||
// [Header("距离")]
|
||||
// public float cheseDistance = 3f;
|
||||
// public float attackDistance = 0.8f;
|
||||
|
||||
// public UnityEvent<Vector2> OnMoveInput;
|
||||
// public Action OnAttack;
|
||||
|
||||
// private Transform player;
|
||||
|
||||
// //玩家与敌人的距离方向
|
||||
// private float dis;
|
||||
// private Vector2 dir;
|
||||
|
||||
|
||||
// private void Awake()
|
||||
// {
|
||||
// player = GameObject.FindWithTag("Player").transform;
|
||||
// }
|
||||
|
||||
// private void Update()
|
||||
// {
|
||||
// if (player == null)
|
||||
// return;
|
||||
// dis = Vector2.Distance(player.position,transform.position);
|
||||
// if(dis<cheseDistance)
|
||||
// {
|
||||
// //追击
|
||||
// if(dis<=attackDistance)
|
||||
// {
|
||||
// OnMoveInput?.Invoke(Vector2.zero);
|
||||
// //攻击
|
||||
// OnAttack?.Invoke();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// dir = player.position - transform.position;
|
||||
// OnMoveInput?.Invoke(dir.normalized);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// OnMoveInput?.Invoke(Vector2.zero);//放弃追击
|
||||
// }
|
||||
// }
|
||||
// private void OnDrawGizmosSelected()
|
||||
// {
|
||||
|
||||
// Gizmos.color = Color.yellow;
|
||||
// Gizmos.DrawWireSphere(transform.position,cheseDistance);
|
||||
|
||||
// Gizmos.color = Color.red;
|
||||
// Gizmos.DrawWireSphere(transform.position, attackDistance);
|
||||
// }
|
||||
//}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77c1c191d793d434ca113069f4ef2880
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,142 +0,0 @@
|
||||
//using System.Collections;
|
||||
//using System.Collections.Generic;
|
||||
//using UnityEngine;
|
||||
//using System;
|
||||
//using Manager;
|
||||
|
||||
|
||||
//普通怪物
|
||||
//public class EnemyController : MonoBehaviour
|
||||
//{
|
||||
// public GameObject attackVFX;
|
||||
|
||||
// [Header("移动速度")] public float currentSpeed;
|
||||
// [Header("攻击")]
|
||||
// [SerializeField] private bool isAttack = true;
|
||||
// [SerializeField] private float attackCollDuration = 1;
|
||||
|
||||
// private bool isDead=false;
|
||||
// public Vector2 MoveInput
|
||||
// {
|
||||
// get;set;
|
||||
// }
|
||||
|
||||
// private Enemy enemy;
|
||||
|
||||
// private Rigidbody2D rb;
|
||||
// private SpriteRenderer sr;
|
||||
// private Animator animator;
|
||||
// private Collider2D colliderEnemy;
|
||||
|
||||
// [Header("攻击,间隔")]
|
||||
// public float attackDamage = 20;
|
||||
// public float attackDuration = 1.5f;
|
||||
// public LayerMask playerLayer;
|
||||
|
||||
// private void Awake()
|
||||
// {
|
||||
// rb = transform.parent.GetComponent<Rigidbody2D>();
|
||||
// colliderEnemy = transform.parent.GetComponent<Collider2D>();
|
||||
// sr = GetComponent<SpriteRenderer>();
|
||||
// animator = GetComponent<Animator>();
|
||||
// enemy = transform.parent.GetComponent<Enemy>();
|
||||
// }
|
||||
// private void Start()
|
||||
// {
|
||||
// enemy.OnAttack += OnAttack;
|
||||
// }
|
||||
|
||||
// private void FixedUpdate()
|
||||
// {
|
||||
// if(!isDead)
|
||||
// {
|
||||
// OnMove();
|
||||
// }
|
||||
// SetAnimation();
|
||||
// }
|
||||
// private void OnMove()
|
||||
// {
|
||||
// if (MoveInput.magnitude > 0.1f && currentSpeed > 0)
|
||||
// {
|
||||
// rb.velocity = MoveInput * currentSpeed;
|
||||
// if(MoveInput.x<0)
|
||||
// {
|
||||
// sr.flipX = false;
|
||||
// }
|
||||
// if (MoveInput.x > 0)
|
||||
// {
|
||||
// sr.flipX = true;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rb.velocity = Vector2.zero;
|
||||
// }
|
||||
// }
|
||||
// void OnAttack()
|
||||
// {
|
||||
// if(isAttack)
|
||||
// {
|
||||
// isAttack = false;
|
||||
// StartCoroutine(nameof(AttackCoroutine));
|
||||
// }
|
||||
// }
|
||||
// IEnumerator AttackCoroutine()
|
||||
// {
|
||||
// animator.SetTrigger("Attack");
|
||||
|
||||
// yield return new WaitForSeconds(attackCollDuration);
|
||||
// isAttack = true;
|
||||
// }
|
||||
|
||||
// public void EnemyHurt()
|
||||
// {
|
||||
// animator.SetTrigger("Hurt");
|
||||
// }
|
||||
// public void EnemyDead()
|
||||
// {
|
||||
// rb.velocity = Vector2.zero;
|
||||
// isDead = true;
|
||||
// colliderEnemy.enabled = false;
|
||||
// }
|
||||
// void SetAnimation()
|
||||
// {
|
||||
// animator.SetBool("isWalk",MoveInput.magnitude>0);
|
||||
// animator.SetBool("isDead", isDead);
|
||||
// }
|
||||
// public void DestoryEnemy()
|
||||
// {
|
||||
// Destroy(transform.parent.gameObject);
|
||||
// }
|
||||
|
||||
// public void MelleeAttackAnimEvent()
|
||||
// {
|
||||
// Collider2D[] hitColliders = Physics2D.OverlapCircleAll(transform.position, enemy.attackDistance, playerLayer);
|
||||
|
||||
|
||||
// foreach (Collider2D hitInfo in hitColliders)
|
||||
// {
|
||||
// hitInfo.transform.root.GetComponentInChildren<CharacterCombat>().TakeDamage();
|
||||
// }
|
||||
// }
|
||||
// public void YuanChengAttackAnimEvent(string name)
|
||||
// {
|
||||
// Collider2D[] hitColliders = Physics2D.OverlapCircleAll(transform.position, enemy.attackDistance, playerLayer);
|
||||
|
||||
// foreach (Collider2D hitInfo in hitColliders)
|
||||
// {
|
||||
// GameObject go=Instantiate(attackVFX,transform.position,Quaternion.identity);
|
||||
// go.AddComponent<VFXMove>();
|
||||
// }
|
||||
// }
|
||||
|
||||
// public void Protected(string name)
|
||||
// {
|
||||
// string monster = "Perfab/Monsters/" + name;
|
||||
// UnityEngine.Object go =Resloader.Load<GameObject>(monster);
|
||||
// if(go!=null)
|
||||
// {
|
||||
// GameObject m= (GameObject)Instantiate(go,transform.root);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0032ed98b43e5f44f9531330d1776782
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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