private void OnTriggerStay2D(Collider2D other) { FisherController fishHook = other.GetComponent <FisherController>(); if (fishHook != null) { if (isEating == true && fishHook.isATK == false) { Debug.Log("吃到乐"); changeHP(0.2f); } } }
private void OnTriggerEnter2D(Collider2D other) { FisherController fishHook = other.GetComponent <FisherController>(); if (fishHook != null) { if (fishHook.isATK == true) //鱼钩攻击有效判定 { Debug.Log("逮到!"); changeHP(-10); //TODO:1.被击中后无敌时间,防止被一次攻击多次击中缪撒 2.击中判定的打磨,靠flag存在问题 } } }