1
This commit is contained in:
@@ -1,337 +0,0 @@
|
||||
using Manager;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class BossAI : CombaSystem
|
||||
{
|
||||
//基本信息类
|
||||
public BossInfo _info;
|
||||
Rigidbody2D rb;
|
||||
|
||||
//玩家信息,待优化
|
||||
PlayerControler player;
|
||||
CharacterCombat characterCombat;
|
||||
|
||||
private Transform currentTarget;
|
||||
|
||||
|
||||
//玩家与敌人的距离方向
|
||||
private float dis;
|
||||
private Vector2 dir;
|
||||
|
||||
[Header("追击与攻击距离")]
|
||||
public float cheseDistance = 3f;
|
||||
public float attackDistance = 0.8f;
|
||||
|
||||
[SerializeField, Header("技能搭配")] private List<CombatAblilityBase> abilitys = new List<CombatAblilityBase>();
|
||||
private CombatAblilityBase currentAblity;
|
||||
//判断偏移
|
||||
private List<Vector2> ablityOff;
|
||||
//攻击段数
|
||||
private int attackCount;
|
||||
|
||||
//计时器
|
||||
public GameObject timer;
|
||||
|
||||
public bool isBegin = false;
|
||||
|
||||
List<CombatAblilityBase> tempAb = new List<CombatAblilityBase>();//可用技能组
|
||||
int ran;//技能组索引
|
||||
|
||||
CameraVR cameraVR;
|
||||
|
||||
public bool isYuancheng=false;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
_animator = GetComponentInChildren<Animator>();
|
||||
rb = GetComponentInParent<Rigidbody2D>();
|
||||
currentTarget = GameObject.FindWithTag("Player").transform;
|
||||
|
||||
_info = GetComponentInParent<BossInfo>();
|
||||
|
||||
foreach (var ab in abilitys)
|
||||
{
|
||||
ab.Init(this,_animator);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (!_animator.CheckAnimationTag("summon")&&isBegin)
|
||||
{
|
||||
if (!isDie) //死亡或咆哮状态的时候不会进行攻击
|
||||
{
|
||||
MoveBoss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (currentAblity != null)
|
||||
{
|
||||
currentAblity.UpdateAblity(currentTarget);
|
||||
}
|
||||
}
|
||||
private void MoveBoss()
|
||||
{
|
||||
if (_animator.CheckAnimationTag("Wake"))
|
||||
return;
|
||||
|
||||
if (_animator.CheckAnimationTag("hit") || _animator.CheckAnimationTag("Attack")||_animator.CheckAnimationTag("Attack_out"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (currentTarget == null)
|
||||
return;
|
||||
|
||||
LockTarget(currentTarget);
|
||||
|
||||
dis = Vector2.Distance(currentTarget.position, transform.position);
|
||||
if (dis < cheseDistance)
|
||||
{
|
||||
rb.velocity = Vector2.zero;
|
||||
//近战
|
||||
if (dis < attackDistance)
|
||||
{
|
||||
//_animator.Play("attack-charge");
|
||||
currentAblity = GetAblity(AblityClass.MelleeAttack);
|
||||
if (currentAblity != null)
|
||||
{
|
||||
//SoundManager.Instance.PlayEffect(_audio, currentAblity.GetAbliltyVFX());
|
||||
|
||||
_animator.Play(currentAblity.GetAbliltyName());
|
||||
|
||||
currentAblity.UseAblity(currentAblity);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
//远程
|
||||
else
|
||||
{
|
||||
currentAblity = GetAblity(AblityClass.YuanChenAttack);
|
||||
if (currentAblity != null)
|
||||
{
|
||||
//SoundManager.Instance.PlayEffect(_audio, currentAblity.GetAbliltyVFX());
|
||||
|
||||
_animator.Play(currentAblity.GetAbliltyName());
|
||||
|
||||
currentAblity.UseAblity(currentAblity);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_info.isCanMove)
|
||||
return;
|
||||
_animator.Play("run");
|
||||
rb.velocity = dir * _info._moveSpeed;
|
||||
}
|
||||
|
||||
}
|
||||
private void LockTarget(Transform target)
|
||||
{
|
||||
if (!_info.isLockTarget)
|
||||
return;
|
||||
dir = (target.position - transform.position).normalized;
|
||||
if(_info.isFix)
|
||||
{
|
||||
Fix(dir);
|
||||
}
|
||||
}
|
||||
private void Fix(Vector2 dir)
|
||||
{
|
||||
if (dir.x < 0)
|
||||
{
|
||||
transform.root.localScale = new Vector3(1, 1, 1);
|
||||
}
|
||||
if (dir.x > 0)
|
||||
{
|
||||
transform.root.localScale = new Vector3(-1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Yuancheng()
|
||||
{
|
||||
isYuancheng = true;
|
||||
}
|
||||
public void OnCloseYuancheng()
|
||||
{
|
||||
isYuancheng = false;
|
||||
}
|
||||
public void TeleportEvent()
|
||||
{
|
||||
if (currentTarget == null) return;
|
||||
transform.root.transform.position = currentTarget.transform.position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 近战攻击
|
||||
/// </summary>
|
||||
public override void MelleeAttackAnimEvent()
|
||||
{
|
||||
if (currentAblity != null)
|
||||
{
|
||||
AttackAreaPos = transform.position;
|
||||
|
||||
ablityOff = currentAblity.GetAbliltyOffest();
|
||||
|
||||
AttackAreaPos.x += ablityOff[attackCount].x;
|
||||
AttackAreaPos.y += ablityOff[attackCount].y;
|
||||
attackCount++;
|
||||
if (attackCount >= ablityOff.Count)
|
||||
{
|
||||
attackCount = 0;
|
||||
}
|
||||
|
||||
if (_info.isCanMove)
|
||||
{
|
||||
AttackAreaPos.x = this.transform.parent.localScale.x < 0 ? Mathf.Abs(offsetX) : -Mathf.Abs(offsetX);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.MelleeAttackAnimEvent();
|
||||
}
|
||||
|
||||
Collider2D[] hitColliders = Physics2D.OverlapBoxAll(AttackAreaPos, attackSize, 0, layerMasks[0]);
|
||||
if(currentAblity!=null&¤tAblity.GetAbliltyVFX()!=null)
|
||||
{
|
||||
SoundManager.Instance.PlayEffect(_audio, currentAblity.GetAbliltyVFX());
|
||||
}
|
||||
|
||||
foreach (Collider2D hitInfo in hitColliders)
|
||||
{
|
||||
|
||||
player = hitInfo.GetComponent<PlayerControler>();
|
||||
if (player != null && player.GetIsDodge())
|
||||
{
|
||||
Debug.Log("玩家无敌");
|
||||
_animator.speed = 0;
|
||||
StartCoroutine(ScalTime(1f));
|
||||
|
||||
return;
|
||||
}
|
||||
characterCombat = hitInfo.GetComponentInChildren<CharacterCombat>();
|
||||
//if(characterCombat._animator.CheckAnimationTag("Roll"))
|
||||
//{
|
||||
// //无敌闪避
|
||||
// _animator.speed = 0;
|
||||
// StartCoroutine(ScalTime(1f));
|
||||
// return;
|
||||
//}
|
||||
|
||||
characterCombat.TakeDamage(attack);
|
||||
Debug.Log("玩家受伤");
|
||||
}
|
||||
}
|
||||
IEnumerator ScalTime(float timer)
|
||||
{
|
||||
yield return new WaitForSeconds(timer);
|
||||
_animator.speed = 1;
|
||||
}
|
||||
public override void TakeDamage(string aniName, float attack)
|
||||
{
|
||||
|
||||
if (isDie || _animator.CheckAnimationTag("summon")||_animator.CheckAnimationTag("Wake"))//咆哮不会被攻击
|
||||
return;
|
||||
Debug.Log("被玩家攻击" + _info.attackedCount);
|
||||
|
||||
_info.attackedCount++;//耐力次数增加
|
||||
|
||||
if (_info.attackedCount > _info.maxAttackedCount)
|
||||
{
|
||||
_info.attackedCount = 0;//重新计数
|
||||
|
||||
_animator.Play("summon");
|
||||
if(_summerClip!=null)
|
||||
{
|
||||
SoundManager.Instance.PlayEffect(_audio,_summerClip);
|
||||
}
|
||||
|
||||
//吼叫
|
||||
|
||||
|
||||
//摄像机震动
|
||||
|
||||
cameraVR=UnityExpandFunction.GetCamera();
|
||||
if (cameraVR != null)
|
||||
{
|
||||
cameraVR.ShakeCamera(1f, 5);
|
||||
}
|
||||
|
||||
//回血
|
||||
currentHp += 200;
|
||||
if (currentHp >= maxHp)
|
||||
currentHp = maxHp;
|
||||
OnHit?.Invoke(currentHp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//受伤
|
||||
currentHp -= attack;//血量减少
|
||||
OnHit?.Invoke(currentHp);//执行受伤事件,血量UI减少
|
||||
if (currentHp <= 0)
|
||||
{
|
||||
isDie = true;
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
if(_animator.CheckAnimationTag("Attack"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_animator.Play(aniName);
|
||||
}
|
||||
private CombatAblilityBase GetAblity(AblityClass ablity)
|
||||
{
|
||||
tempAb.Clear();
|
||||
foreach (var ab in abilitys)
|
||||
{
|
||||
if (ab.GetAbliltyIsDone() && ab.GetAbliltyClass() == ablity)
|
||||
{
|
||||
tempAb.Add(ab);
|
||||
}
|
||||
}
|
||||
if(tempAb.Count==0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ran = UnityEngine.Random.Range(0,tempAb.Count);
|
||||
if (tempAb[ran] != null)
|
||||
return tempAb[ran];
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void SetBegin(bool b)
|
||||
{
|
||||
isBegin = b;
|
||||
//开始
|
||||
_animator.Play("sleeping");
|
||||
UIManager.Instance.Show<UIEnterScene>().InitInfo(_info.bossHead, _info.bossName);
|
||||
}
|
||||
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: d151185264385eb48b7823df0a3c2d04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BossInfo : MonoBehaviour
|
||||
{
|
||||
|
||||
[Header("名字与头像")]
|
||||
public string bossName;
|
||||
public Sprite bossHead;
|
||||
|
||||
[Header("失衡最大次数")]
|
||||
public int maxAttackedCount;
|
||||
[Header("被攻击次数")]
|
||||
public int attackedCount=0;
|
||||
|
||||
//是否允许锁定目标
|
||||
[Header("索敌")]
|
||||
public bool isLockTarget;
|
||||
[Header("移动")]
|
||||
public bool isCanMove;
|
||||
[Header("翻转")]
|
||||
public bool isFix;
|
||||
|
||||
[Header("移动速度")]
|
||||
public float _moveSpeed;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c35bd5b6f66429b47a669052403acc96
|
||||
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 CameraMove : MonoBehaviour
|
||||
{
|
||||
private Transform player;
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player").transform;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
//RaycastHit[] hits;
|
||||
|
||||
//hits = Physics.RaycastAll(ray, Mathf.Infinity, badMask);
|
||||
//for (int i = 0; i < hits.Length; i++)
|
||||
//{
|
||||
// Debug.Log(hits[i].collider.gameObject.name);
|
||||
//}
|
||||
//Debug.Log(hits.Length);
|
||||
|
||||
if (player!=null)
|
||||
{
|
||||
transform.position = new Vector3(player.position.x, player.position.y - 11, player.position.z);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 066236bbf8c0b6f4ab7929aa5dfec2bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,63 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cinemachine;
|
||||
|
||||
public class CameraVR : MonoBehaviour
|
||||
{
|
||||
private CinemachineVirtualCamera _cinemachineVirtualCamera;
|
||||
private CinemachineBasicMultiChannelPerlin _multiChannelPerlin;
|
||||
|
||||
//当前持续时间
|
||||
private float _shakeTime;
|
||||
//总时间
|
||||
private float _shakeTimeTotal;
|
||||
//强度
|
||||
private float _shakeIntensity;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
_cinemachineVirtualCamera = GetComponent<CinemachineVirtualCamera>();
|
||||
|
||||
_multiChannelPerlin = _cinemachineVirtualCamera.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (_shakeTime > 0)
|
||||
{
|
||||
_shakeTime -= Time.deltaTime;
|
||||
_multiChannelPerlin.m_AmplitudeGain = Mathf.Lerp(0, _shakeIntensity, _shakeTime / _shakeTimeTotal);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 抖动
|
||||
/// </summary>
|
||||
/// <param name="Time">抖动时间</param>
|
||||
/// <param name="Intensity">强度</param>
|
||||
public void ShakeCamera(float time, float intensity)
|
||||
{
|
||||
if (_cinemachineVirtualCamera != null)
|
||||
{
|
||||
_shakeTimeTotal = time;
|
||||
_shakeIntensity = intensity;
|
||||
|
||||
_shakeTime = _shakeTimeTotal;
|
||||
_multiChannelPerlin.m_AmplitudeGain = _shakeIntensity;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
Ray ray = new Ray(transform.position, transform.forward);
|
||||
Gizmos.color = Color.blue;
|
||||
|
||||
Gizmos.DrawRay(ray);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab12f70a05a6b764ca991a34facaca96
|
||||
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 Destructeable : MonoBehaviour
|
||||
{
|
||||
public GameObject destoryVFX;
|
||||
public GameObject big;
|
||||
public GameObject small;
|
||||
|
||||
private bool isDestory=false;
|
||||
public float reTiem = 5;
|
||||
|
||||
public void OnDestoryObject()
|
||||
{
|
||||
if (isDestory)
|
||||
return;
|
||||
if (destoryVFX != null)
|
||||
{
|
||||
Instantiate(destoryVFX,transform.position,transform.rotation);
|
||||
}
|
||||
|
||||
big.SetActive(false);
|
||||
SmallActive(true);
|
||||
isDestory = true;
|
||||
StartCoroutine(nameof(DestoryTime));
|
||||
}
|
||||
|
||||
IEnumerator DestoryTime()
|
||||
{
|
||||
yield return new WaitForSeconds(reTiem);
|
||||
big.SetActive(true);
|
||||
SmallActive(false);
|
||||
}
|
||||
|
||||
private void SmallActive(bool active)
|
||||
{
|
||||
if (small != null)
|
||||
{
|
||||
small.SetActive(active);
|
||||
isDestory = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17918bd11b9ebbe4aa8f98fc6b565daa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,155 +0,0 @@
|
||||
using Manager;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CharacterCombat : CombaSystem
|
||||
{
|
||||
|
||||
[Header("音效")]
|
||||
public AudioSource audioSource;
|
||||
public PlayerControler controler;
|
||||
|
||||
[Header("特效")]
|
||||
public GameObject effect;
|
||||
|
||||
CameraVR cameraVR;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
maxHp = PlayerInfo.Instance.info.maxHp;
|
||||
currentHp = PlayerInfo.Instance.info.currentHp;
|
||||
attack = PlayerInfo.Instance.info.testAttack;
|
||||
|
||||
audioSource = transform.root.GetComponentInChildren<AudioSource>();
|
||||
|
||||
_animator = GetComponent<Animator>();
|
||||
|
||||
PlayerInfo.Instance.OnUpdateAttrbute += OnChangeAttrbute;
|
||||
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
PlayerInfo.Instance.OnUpdateAttrbute -= OnChangeAttrbute;
|
||||
}
|
||||
|
||||
public override void MelleeAttackAnimEvent()
|
||||
{
|
||||
base.MelleeAttackAnimEvent();
|
||||
|
||||
Collider2D[] hitColliders = Physics2D.OverlapBoxAll(AttackAreaPos,attackSize,0,layerMasks[0]);
|
||||
Collider2D[] destructiveColliders = Physics2D.OverlapBoxAll(AttackAreaPos, attackSize, 0,layerMasks[1]);
|
||||
Collider2D[] treeColliders = Physics2D.OverlapBoxAll(AttackAreaPos, attackSize, 0, layerMasks[2]);
|
||||
|
||||
|
||||
foreach (Collider2D hitInfo in hitColliders)
|
||||
{
|
||||
|
||||
if(hitInfo.tag=="Enemy")
|
||||
{//小怪
|
||||
}
|
||||
if (hitInfo.tag == "Boss")
|
||||
{
|
||||
|
||||
hitInfo.GetComponentInChildren<BossAI>().TakeDamage("hurt-front",GetAttack());
|
||||
if (_summerClip != null)
|
||||
SoundManager.Instance.PlayEffect(_audio, _summerClip);
|
||||
//加入卡肉,特效
|
||||
if(effect!=null)
|
||||
{
|
||||
GameObject go = Instantiate(effect);
|
||||
|
||||
go.transform.position = hitInfo.transform.position + new Vector3(0,4,0);
|
||||
|
||||
//开始计时
|
||||
string timerPath = "Perfab/Timer";
|
||||
GameObject timer = Resloader.Load<GameObject>(timerPath);//寻找预制体
|
||||
|
||||
GameObject time = Instantiate(timer);
|
||||
time.GetComponent<Timer>().CreateTime(0.2f, () =>
|
||||
{
|
||||
ManagersMode.Poll.UnSpwan("EffectPoll", effect.name, go);
|
||||
}, false);
|
||||
|
||||
}
|
||||
|
||||
cameraVR = UnityExpandFunction.GetCamera();
|
||||
if (cameraVR != null)
|
||||
{
|
||||
cameraVR.ShakeCamera(0.5f, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (Collider2D hitInfo in destructiveColliders)
|
||||
{
|
||||
|
||||
}
|
||||
foreach (Collider2D hitInfo in treeColliders)//数目
|
||||
{
|
||||
Debug.Log("攻击树木");
|
||||
hitInfo.GetComponentInChildren<Tree>().TakeDamage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//受伤
|
||||
public override void TakeDamage(float atk)
|
||||
{
|
||||
currentHp -= atk;
|
||||
|
||||
OnHit?.Invoke(currentHp);//UI显示
|
||||
|
||||
if(currentHp<=0)
|
||||
{
|
||||
//死亡
|
||||
return;
|
||||
}
|
||||
_animator.Play("hurt");
|
||||
}
|
||||
private void OnChangeAttrbute(LotteryType type, float value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LotteryType.Hp:
|
||||
currentHp += value;
|
||||
if(currentHp>=maxHp)
|
||||
{
|
||||
currentHp = maxHp;
|
||||
}
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
case LotteryType.Mp:
|
||||
maxHp += value;
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
case LotteryType.Attack:
|
||||
attack += value;
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
case LotteryType.UpMaxHp:
|
||||
PlayerInfo.Instance.info.maxHp += value;
|
||||
maxHp += value;
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
case LotteryType.UpHp:
|
||||
Date.Instance.ItemDate[1].value += (int)value;
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
case LotteryType.UpAttack:
|
||||
PlayerInfo.Instance.info.attack += value;
|
||||
attack += value;
|
||||
OnHit?.Invoke(currentHp);
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 攻击力量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float GetAttack()
|
||||
{
|
||||
return attack + (PlayerInfo.Instance.info.Level * 10);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c801442456af8848aeddf812bf4ca75
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user