public void Awake() { _instance = this; //添加事件监听 LeanTween.addListener((int)Events.EMENYDIE, OnEmenyDie); }
void OnCollisionEnter2D(Collision2D other) { EmenyController ec = other.gameObject.GetComponent <EmenyController>(); if (ec != null) { ec.Fixed(); } AudioManager.instance.AudioPlay(hitclip); Destroy(this.gameObject); }
/// <summary> /// 初始化 敌人控制器 /// </summary> void InitEmenyController() { emenyController = FindObjectOfType <EmenyController>(); if (emenyController == null) { Debug.Log("Init EmenyController error!!"); } emenyController.gameData = gameData; //emenyController.SetWave(gameData.waves[0]); SetWave(); }
public void OnDestroy() { _instance = null; }
/// <summary> /// 初始化 敌人控制器 /// </summary> void InitEmenyController() { emenyController = FindObjectOfType<EmenyController>(); if (emenyController == null) { Debug.Log("Init EmenyController error!!"); } emenyController.gameData = gameData; //emenyController.SetWave(gameData.waves[0]); SetWave(); }