tower dmg

This commit is contained in:
Sveske Juice 2024-04-21 02:47:54 +02:00
parent 430da56a0f
commit a1140a60b7
7 changed files with 104 additions and 10 deletions

View File

@ -0,0 +1,24 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3bbffcd63584e8040b9a8db3b8d51737, type: 3}
m_Name: AudioLib
m_EditorClassIdentifier:
Clips:
- {fileID: 8300000, guid: ea208a46b2ab9bc45b936d5d7e0455cf, type: 3}
- {fileID: 8300000, guid: 58d0fae7e12873e4293f7e9bce59fcdc, type: 3}
- {fileID: 8300000, guid: 1d08abd4771cf954a92649be9eaa32da, type: 3}
- {fileID: 8300000, guid: fe1f2d7ea272e2d47aa2140b739f93fa, type: 3}
- {fileID: 8300000, guid: 5334bf6f5b0d55e48b4ee74b3210a3f4, type: 3}
- {fileID: 8300000, guid: 32b4f8d9c44560c4d942029ff998e387, type: 3}
- {fileID: 8300000, guid: fbb9883b31821d5478ace5f439fe9f81, type: 3}
- {fileID: 8300000, guid: e850f3f8ab5051943a09bc30110ad96a, type: 3}
- {fileID: 8300000, guid: b60baeeadcb135747ac37bf4c4684ac4, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 33d9499f0cd319b2eab27cf0f8e39a40
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,6 +10,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 2430881567806754708} - component: {fileID: 2430881567806754708}
- component: {fileID: 420908950823711560} - component: {fileID: 420908950823711560}
- component: {fileID: 6434302952035194364}
m_Layer: 0 m_Layer: 0
m_Name: Managers m_Name: Managers
m_TagString: Untagged m_TagString: Untagged
@ -46,7 +47,16 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Balance: 0 Balance: 0
IsBuildMode: 0 IsBuildMode: 0
ShopSelectedTower: --- !u!114 &6434302952035194364
name: MonoBehaviour:
price: 0 m_ObjectHideFlags: 0
prefab: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 167310329963132665}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36c44df45a33eca4285d258763a7b018, type: 3}
m_Name:
m_EditorClassIdentifier:
audioLibrary: {fileID: 11400000, guid: 33d9499f0cd319b2eab27cf0f8e39a40, type: 2}

View File

@ -14,6 +14,7 @@ GameObject:
- component: {fileID: -4368249141776341009} - component: {fileID: -4368249141776341009}
- component: {fileID: 8326258332086092779} - component: {fileID: 8326258332086092779}
- component: {fileID: 1772828647246745231} - component: {fileID: 1772828647246745231}
- component: {fileID: 3214375543219620994}
m_Layer: 8 m_Layer: 8
m_Name: BaseTower m_Name: BaseTower
m_TagString: Untagged m_TagString: Untagged
@ -87,6 +88,21 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
OnHealthChange3:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 3214375543219620994}
m_TargetAssemblyTypeName: PlaySound, Assembly-CSharp
m_MethodName: PlayASound
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Tower Damage
m_BoolArgument: 0
m_CallState: 2
--- !u!65 &5565472806559733162 --- !u!65 &5565472806559733162
BoxCollider: BoxCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -245,6 +261,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
toEnable: {fileID: 3424060888733970503} toEnable: {fileID: 3424060888733970503}
threshold: 30 threshold: 30
--- !u!114 &3214375543219620994
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 872127579833310669}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d720360aef3510faf93af9ce3a78b2fc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &881819783351085137 --- !u!1 &881819783351085137
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -651,8 +679,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3558272651156871278} m_GameObject: {fileID: 3558272651156871278}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.34042525, y: 0.0000000228801, z: -0.000000008283737, w: 0.9402716} m_LocalRotation: {x: 0.34042525, y: -0.00000002288009, z: 0.000000008283735, w: 0.9402716}
m_LocalPosition: {x: 0, y: 1.661, z: -3} m_LocalPosition: {x: -1.745, y: 2.334, z: -3}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@ -730,8 +758,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4474798581911876227} m_GameObject: {fileID: 4474798581911876227}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.32326588, y: 0.000000016282542, z: -0.0000000055622356, w: 0.9463082} m_LocalRotation: {x: 0.32326588, y: -0.000000016282542, z: 0.0000000055622356, w: 0.9463082}
m_LocalPosition: {x: 0, y: 1.661, z: -3} m_LocalPosition: {x: -1.745, y: 2.334, z: -3}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@ -1145,8 +1173,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6616012430861705016} m_GameObject: {fileID: 6616012430861705016}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3060453, y: -0.000000023165901, z: 0.0000000074471513, w: 0.952017} m_LocalRotation: {x: 0.3060453, y: 0.000000023165901, z: -0.0000000074471513, w: 0.952017}
m_LocalPosition: {x: 0, y: -32.5, z: 39} m_LocalPosition: {x: -1.745, y: 2.334, z: -3}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:

View File

@ -14,6 +14,7 @@ public class HealthComponent : MonoBehaviour
public UnityEvent OnHealthZero; public UnityEvent OnHealthZero;
public UnityEvent<float, float> OnHealthChange; public UnityEvent<float, float> OnHealthChange;
public UnityEvent<float> OnHealthChange2; public UnityEvent<float> OnHealthChange2;
public UnityEvent OnHealthChange3;
void Awake() void Awake()
{ {
@ -24,6 +25,7 @@ public class HealthComponent : MonoBehaviour
{ {
OnHealthChange?.Invoke(currentHealth, currentHealth - damage); OnHealthChange?.Invoke(currentHealth, currentHealth - damage);
OnHealthChange2?.Invoke(currentHealth - damage); OnHealthChange2?.Invoke(currentHealth - damage);
OnHealthChange3.Invoke();
OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage); OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage);
currentHealth -= damage; currentHealth -= damage;

View File

@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlaySound : MonoBehaviour
{
public void PlayASound(string filename)
{
AudioManager.PlaySound(filename, transform.position);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d720360aef3510faf93af9ce3a78b2fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: