| | |
| | | using UnityEngine; |
| | | using TowerDefense.Agents; |
| | | using TowerDefense.Level; |
| | | using TMPro; |
| | | |
| | | /** |
| | | * 泡泡炸弹 |
| | |
| | | config.DestroyTime = bubbleBomb.GetExplodeTime(); |
| | | config.MoveSpeed = SkillData.effect[1]; |
| | | bubbleBombList.Add(config); |
| | | |
| | | bubbleBomb.Blood.SetPos(); |
| | | bubbleBomb.Blood.SetRemainHitCount(config.NeedAttackCount); |
| | | bubbleBomb.Blood.ShowBlood(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | GameObject prefab = Resources.Load<GameObject>(prefabPath); |
| | | ret = GameObject.Instantiate(prefab); |
| | | BubbleBombAgent agent = ret.GetComponent<BubbleBombAgent>(); |
| | | |
| | | prefab = Resources.Load<GameObject>($"Prefabs/BubbleBombBlood"); |
| | | GameObject bubbleBombBlood = GameObject.Instantiate(prefab); |
| | | GameObject bloodUI = GameObject.Find("MainUI/BloodUI"); |
| | | bubbleBombBlood.transform.SetParent(bloodUI.transform, false); |
| | | |
| | | agent.Blood = bubbleBombBlood.GetComponent<BubbleBombBlood>(); |
| | | agent.Blood.Target = agent; |
| | | } |
| | | |
| | | ret.SetActive(true); |
| | |
| | | { |
| | | if (obj != null) |
| | | { |
| | | BubbleBombAgent agent = obj.GetComponent<BubbleBombAgent>(); |
| | | agent.Blood.HideBlood(); |
| | | obj.SetActive(false); |
| | | bubbleBombPool.Add(obj); |
| | | } |
| | |
| | | { |
| | | GameObject obj = bubbleBombPool[0]; |
| | | bubbleBombPool.Remove(obj); |
| | | BubbleBombAgent agent = obj.GetComponent<BubbleBombAgent>(); |
| | | GameObject.Destroy(agent.Blood.gameObject); |
| | | GameObject.Destroy(obj); |
| | | } |
| | | } |
| | |
| | | if (config.IsAttackDeath || config.IsArrived) return; |
| | | |
| | | ++config.AttackCount; |
| | | config.Agent.Blood.SetRemainHitCount(config.NeedAttackCount - config.AttackCount); |
| | | |
| | | if (config.AttackCount >= config.NeedAttackCount) |
| | | AgentDead(config); |
| | |
| | | |
| | | if (config.IsAttackDeath || config.IsArrived) return; |
| | | |
| | | config.Agent.Blood.HideBlood(); |
| | | AgentDead(config); |
| | | break; |
| | | } |
| | |
| | | /// <param name="config"></param> |
| | | private void AgentDead(BubbleBombConfig config) |
| | | { |
| | | config.Agent.Blood.HideBlood(); |
| | | config.IsAttackDeath = true; |
| | | AgentInsManager.instance.removeAgent(config.Agent); |
| | | config.Agent.StopNormalEffect(); |
| | |
| | | /// <param name="config"></param> |
| | | private void AgentArrived(BubbleBombConfig config) |
| | | { |
| | | config.Agent.Blood.HideBlood(); |
| | | config.IsArrived = true; |
| | | AgentInsManager.instance.removeAgent(config.Agent); |
| | | config.Agent.StopNormalEffect(); |