chenxin
2020-12-09 ab9a718b28a142a0a903d5cc3e091d4d2577856e
泡泡炸弹上面加剩余需要击打次数
4 files added
7 files modified
339 ■■■■■ changed files
Assets/00000/package/Materials/EffectShader_AlphaUvflow_003.mat 2 ●●● patch | view | raw | blame | history
Assets/00000/package/Materials/EffectShader_AlphaUvflow_004.mat 2 ●●● patch | view | raw | blame | history
Assets/00000/package/Materials/Object_046.mat 2 ●●● patch | view | raw | blame | history
Assets/Materials/UI/tileTowerVSMat.mat 2 ●●● patch | view | raw | blame | history
Assets/Resources/Prefabs/BubbleBombBlood.prefab 151 ●●●●● patch | view | raw | blame | history
Assets/Resources/Prefabs/BubbleBombBlood.prefab.meta 7 ●●●●● patch | view | raw | blame | history
Assets/Scenes/Levels/Battle/Endless2D.unity 69 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs 12 ●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/BubbleBombBlood.cs 59 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/BubbleBombBlood.cs.meta 11 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs 22 ●●●●● patch | view | raw | blame | history
Assets/00000/package/Materials/EffectShader_AlphaUvflow_003.mat
@@ -7,7 +7,7 @@
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_Name: boss12 1
  m_Name: EffectShader_AlphaUvflow_003
  m_Shader: {fileID: 4800000, guid: c9cf2219df64ce84eacfab809807570c, type: 3}
  m_ShaderKeywords: 
  m_LightmapFlags: 4
Assets/00000/package/Materials/EffectShader_AlphaUvflow_004.mat
@@ -7,7 +7,7 @@
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_Name: boss12
  m_Name: EffectShader_AlphaUvflow_004
  m_Shader: {fileID: 4800000, guid: c9cf2219df64ce84eacfab809807570c, type: 3}
  m_ShaderKeywords: 
  m_LightmapFlags: 4
Assets/00000/package/Materials/Object_046.mat
@@ -7,7 +7,7 @@
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_Name: boss13
  m_Name: Object_046
  m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0}
  m_ShaderKeywords: 
  m_LightmapFlags: 4
Assets/Materials/UI/tileTowerVSMat.mat
@@ -40,7 +40,7 @@
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MainTex:
        m_Texture: {fileID: 2800000, guid: ea2ffef66c52dd14fbd46187be79f107, type: 3}
        m_Texture: {fileID: 2800000, guid: 93f40a01d57fbff418fc0b54b6ab7d9f, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MetallicGlossMap:
Assets/Resources/Prefabs/BubbleBombBlood.prefab
New file
@@ -0,0 +1,151 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4972047724387052522
GameObject:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  serializedVersion: 6
  m_Component:
  - component: {fileID: 4637199833858310642}
  - component: {fileID: 6232736633825427372}
  - component: {fileID: 4057973481653860360}
  - component: {fileID: 5657337199051656696}
  m_Layer: 5
  m_Name: BubbleBombBlood
  m_TagString: Untagged
  m_Icon: {fileID: 0}
  m_NavMeshLayer: 0
  m_StaticEditorFlags: 0
  m_IsActive: 1
--- !u!224 &4637199833858310642
RectTransform:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 4972047724387052522}
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
  m_LocalPosition: {x: 0, y: 0, z: 0}
  m_LocalScale: {x: 1, y: 1, z: 1}
  m_Children: []
  m_Father: {fileID: 0}
  m_RootOrder: 0
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
  m_AnchorMin: {x: 0.5, y: 0.5}
  m_AnchorMax: {x: 0.5, y: 0.5}
  m_AnchoredPosition: {x: -4.5, y: 61.4}
  m_SizeDelta: {x: 200, y: 50}
  m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6232736633825427372
CanvasRenderer:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 4972047724387052522}
  m_CullTransparentMesh: 0
--- !u!114 &4057973481653860360
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 4972047724387052522}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
  m_Name:
  m_EditorClassIdentifier:
  m_Material: {fileID: 0}
  m_Color: {r: 1, g: 1, b: 1, a: 1}
  m_RaycastTarget: 1
  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
  m_Maskable: 1
  m_OnCullStateChanged:
    m_PersistentCalls:
      m_Calls: []
  m_text:
  m_isRightToLeft: 0
  m_fontAsset: {fileID: 11400000, guid: 572adb1c73f88e441a1bf998ca9f4ea5, type: 2}
  m_sharedMaterial: {fileID: -3548855653558765056, guid: 572adb1c73f88e441a1bf998ca9f4ea5,
    type: 2}
  m_fontSharedMaterials: []
  m_fontMaterial: {fileID: 0}
  m_fontMaterials: []
  m_fontColor32:
    serializedVersion: 2
    rgba: 4294967295
  m_fontColor: {r: 1, g: 1, b: 1, a: 1}
  m_enableVertexGradient: 0
  m_colorMode: 3
  m_fontColorGradient:
    topLeft: {r: 1, g: 1, b: 1, a: 1}
    topRight: {r: 1, g: 1, b: 1, a: 1}
    bottomLeft: {r: 1, g: 1, b: 1, a: 1}
    bottomRight: {r: 1, g: 1, b: 1, a: 1}
  m_fontColorGradientPreset: {fileID: 0}
  m_spriteAsset: {fileID: 0}
  m_tintAllSprites: 0
  m_StyleSheet: {fileID: 0}
  m_TextStyleHashCode: -1183493901
  m_overrideHtmlColors: 0
  m_faceColor:
    serializedVersion: 2
    rgba: 4294967295
  m_fontSize: 50
  m_fontSizeBase: 50
  m_fontWeight: 400
  m_enableAutoSizing: 0
  m_fontSizeMin: 18
  m_fontSizeMax: 72
  m_fontStyle: 0
  m_HorizontalAlignment: 2
  m_VerticalAlignment: 512
  m_textAlignment: 65535
  m_characterSpacing: 0
  m_wordSpacing: 0
  m_lineSpacing: 0
  m_lineSpacingMax: 0
  m_paragraphSpacing: 0
  m_charWidthMaxAdj: 0
  m_enableWordWrapping: 1
  m_wordWrappingRatios: 0.4
  m_overflowMode: 0
  m_linkedTextComponent: {fileID: 0}
  parentLinkedComponent: {fileID: 0}
  m_enableKerning: 1
  m_enableExtraPadding: 0
  checkPaddingRequired: 0
  m_isRichText: 1
  m_parseCtrlCharacters: 1
  m_isOrthographic: 1
  m_isCullingEnabled: 0
  m_horizontalMapping: 0
  m_verticalMapping: 0
  m_uvLineOffset: 0
  m_geometrySortingOrder: 0
  m_IsTextObjectScaleStatic: 0
  m_VertexBufferAutoSizeReduction: 1
  m_useMaxVisibleDescender: 1
  m_pageToDisplay: 1
  m_margin: {x: 0, y: 0, z: 0, w: 0}
  m_isUsingLegacyAnimationComponent: 0
  m_isVolumetricText: 0
  m_hasFontAssetChanged: 0
  m_baseMaterial: {fileID: 0}
  m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &5657337199051656696
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 4972047724387052522}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: da7155a253fc0f04ca62127ba9b5d3a8, type: 3}
  m_Name:
  m_EditorClassIdentifier:
  bloodText: {fileID: 4057973481653860360}
Assets/Resources/Prefabs/BubbleBombBlood.prefab.meta
New file
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1e7d23823993dd64d8fba4c8a5abf7cb
PrefabImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Scenes/Levels/Battle/Endless2D.unity
@@ -9917,6 +9917,75 @@
  m_Father: {fileID: 98103728}
  m_RootOrder: 2
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1953022751
PrefabInstance:
  m_ObjectHideFlags: 0
  serializedVersion: 2
  m_Modification:
    m_TransformParent: {fileID: 0}
    m_Modifications:
    - target: {fileID: 8434816861478773448, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_Name
      value: BubbleBomb
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalPosition.x
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalPosition.y
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalPosition.z
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalRotation.x
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalRotation.y
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalRotation.z
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalRotation.w
      value: 1
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_RootOrder
      value: 10
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalEulerAnglesHint.x
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalEulerAnglesHint.y
      value: 0
      objectReference: {fileID: 0}
    - target: {fileID: 8434816861478773449, guid: 164953adef233e743be6963f59bb2817,
        type: 3}
      propertyPath: m_LocalEulerAnglesHint.z
      value: 0
      objectReference: {fileID: 0}
    m_RemovedComponents: []
  m_SourcePrefab: {fileID: 100100000, guid: 164953adef233e743be6963f59bb2817, type: 3}
--- !u!1 &1967550294
GameObject:
  m_ObjectHideFlags: 0
Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs
@@ -1,5 +1,6 @@
using DG.Tweening;
using UnityEngine;
using KTGMGemClient;
/**
 * 泡泡炸弹
@@ -19,6 +20,11 @@
        /// 爆炸的特效
        /// </summary>
        public ParticleSystem ExplodeEffect;
        /// <summary>
        /// 血条引用
        /// </summary>
        public BubbleBombBlood Blood;
        /// <summary>
        /// Peforms the relevant path update
@@ -93,12 +99,12 @@
        protected override void Update()
        {
            // 这个方法不要删掉
        }
        protected override void LateUpdate()
        {
            // 这个方法不要删掉
        }
        public override void Initialize()
@@ -115,7 +121,7 @@
        public override void PlayDeath()
        {
            Debug.LogError("---- BubbleBombAgent PlayDeath 正常逻辑不应该打印出这句话 ----");
            // 这个方法不要删掉
        }
    }
}
Assets/Scripts/TowerDefense/UI/BubbleBombBlood.cs
New file
@@ -0,0 +1,59 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TowerDefense.Agents;
using TMPro;
/**
 * 泡泡炸弹血条脚本
 * @Author: chenxin
 * @Date: 2020-12-09 16:06:26
 */
namespace KTGMGemClient
{
    public class BubbleBombBlood : MonoBehaviour
    {
        [SerializeField]
        private TextMeshProUGUI bloodText;
        public BubbleBombAgent Target { get; set; }
        // Update is called once per frame
        private void Update()
        {
            if (Target != null)
                SetPos();
        }
        /// <summary>
        /// 设置剩余需要Hit次数
        /// </summary>
        /// <param name="count"></param>
        public void SetRemainHitCount(int count)
        {
            if (count < 0) count = 0;
            bloodText.text = $"{count}";
        }
        public void ShowBlood()
        {
            gameObject.SetActive(true);
        }
        public void HideBlood()
        {
            gameObject.SetActive(false);
        }
        /// <summary>
        /// 设置初始位置
        /// </summary>
        public void SetPos()
        {
            Camera camera = GameObject.Find("SceneCamera3D").GetComponent<Camera>();
            Vector3 screenPos = camera.WorldToScreenPoint(Target.position);
            transform.position = screenPos;
        }
    }
}
Assets/Scripts/TowerDefense/UI/BubbleBombBlood.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: da7155a253fc0f04ca62127ba9b5d3a8
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs
@@ -2,6 +2,7 @@
using UnityEngine;
using TowerDefense.Agents;
using TowerDefense.Level;
using TMPro;
/**
 * 泡泡炸弹
@@ -169,6 +170,10 @@
                config.DestroyTime = bubbleBomb.GetExplodeTime();
                config.MoveSpeed = SkillData.effect[1];
                bubbleBombList.Add(config);
                bubbleBomb.Blood.SetPos();
                bubbleBomb.Blood.SetRemainHitCount(config.NeedAttackCount);
                bubbleBomb.Blood.ShowBlood();
            }
        }
@@ -228,6 +233,15 @@
            {
                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);
@@ -243,6 +257,8 @@
        {
            if (obj != null)
            {
                BubbleBombAgent agent = obj.GetComponent<BubbleBombAgent>();
                agent.Blood.HideBlood();
                obj.SetActive(false);
                bubbleBombPool.Add(obj);
            }
@@ -257,6 +273,8 @@
            {
                GameObject obj = bubbleBombPool[0];
                bubbleBombPool.Remove(obj);
                BubbleBombAgent agent = obj.GetComponent<BubbleBombAgent>();
                GameObject.Destroy(agent.Blood.gameObject);
                GameObject.Destroy(obj);
            }
        }
@@ -290,6 +308,7 @@
                    if (config.IsAttackDeath || config.IsArrived) return;
                    ++config.AttackCount;
                    config.Agent.Blood.SetRemainHitCount(config.NeedAttackCount - config.AttackCount);
                    if (config.AttackCount >= config.NeedAttackCount)
                        AgentDead(config);
@@ -313,6 +332,7 @@
                    if (config.IsAttackDeath || config.IsArrived) return;
                    config.Agent.Blood.HideBlood();
                    AgentDead(config);
                    break;
                }
@@ -349,6 +369,7 @@
        /// <param name="config"></param>
        private void AgentDead(BubbleBombConfig config)
        {
            config.Agent.Blood.HideBlood();
            config.IsAttackDeath = true;
            AgentInsManager.instance.removeAgent(config.Agent);
            config.Agent.StopNormalEffect();
@@ -361,6 +382,7 @@
        /// <param name="config"></param>
        private void AgentArrived(BubbleBombConfig config)
        {
            config.Agent.Blood.HideBlood();
            config.IsArrived = true;
            AgentInsManager.instance.removeAgent(config.Agent);
            config.Agent.StopNormalEffect();