public virtual void ShowPlayer(Vector3 pos) { ResumeControl(); gameObject.SetActive(true); transform.position = pos; Health.invincible = false; Health.dead = false; Health.health = (int)QMhelper.GetMaxHpVal(); QMhelper.SetCurrentHp(Health.health); if (CurrWeapon == null) { return; } if (CurrWeapon.weaponData is GunInfo info) { // TODO: 重生子弹 info.clipCapacity = 100; info.remainingBullet = 500; EventCenter.Broadcast(EventManager.EventType.UpdateAmmo, info.clipCapacity, info.remainingBullet); } SetupWeaponIco(); // 更新 Exp Ui ExpManager.Instance.AddExp(0); GameManager.Instance.PlayerInfo.OperateCoin(0); GetComponent <BoxCollider2D>().enabled = true; }
/// <summary> /// 设置收到打击动画 /// </summary> public override void SetTakeHit(int amount) { if (Fsm.State != States.Normal) { return; } base.SetTakeHit(amount); //TODO: 被打动画 // if (!animator.GetCurrentAnimatorStateInfo(0).IsName("TakeHit")) animator.Play("TakeHit"); QMhelper.SetCurrentHp(Health.health); if (CameraShaker.Instance != null) { CameraShaker.InitShake(0.075f, 2f); } }
// 加血 public override void SetTakeHealth() { // HealthBar.SetHearts(Health.health); QMhelper.SetCurrentHp(Health.health); }
/// <summary> /// 加血 /// </summary> public override void SetTakeHealth() { QMhelper.SetCurrentHp(Health.health); }