Grenade Visual

Polish
Sascha 2023-06-15 12:21:29 +07:00
parent 0189441463
commit fd67130275
11 changed files with 5430 additions and 36 deletions

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GrenadeExplosion
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 2.4936988, g: 1.0108582, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &4134177375110653354
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 9

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4b5428ae8b14c95a8a84c19315c72e2e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GrenadeTrail
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 2.4936988, g: 2.4936988, b: 2.4936988, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &4134177375110653354
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 9

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f0530eb9acb0dc7288551de3f5b0d1c5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4c1aced3c177d0c51937c8f6848c0bfc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -110,13 +110,14 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5897361562010039407}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 2}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 295572308967614532}
- {fileID: 4418127688133066886}
m_Father: {fileID: 0}
m_RootOrder: 24
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7338187621805549924
MonoBehaviour:
@ -130,3 +131,177 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cb63a0ff77a2101b2a0c80d68b9cf591, type: 3}
m_Name:
m_EditorClassIdentifier:
grenadeExplodeVfxPrefab: {fileID: 5288553555833788668, guid: 4c1aced3c177d0c51937c8f6848c0bfc,
type: 3}
trailRenderer: {fileID: 1658837125945039400}
arcYAnimationCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.6
inSlope: 1.8058257
outSlope: 1.8058257
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0.06135349
- serializedVersion: 3
time: 1
value: 0
inSlope: -3.6893544
outSlope: -3.6893544
tangentMode: 0
weightedMode: 0
inWeight: 0.051092446
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &9121712147421377249
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4418127688133066886}
- component: {fileID: 1658837125945039400}
m_Layer: 0
m_Name: Trail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4418127688133066886
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9121712147421377249}
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_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 5461842780706456345}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!96 &1658837125945039400
TrailRenderer:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9121712147421377249}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f0530eb9acb0dc7288551de3f5b0d1c5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Time: 0.2
m_PreviewTimeScale: 1
m_Parameters:
serializedVersion: 3
widthMultiplier: 0.1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
textureScale: {x: 1, y: 1}
shadowBias: 0.5
generateLightingData: 0
m_MinVertexDistance: 0.01
m_MaskInteraction: 0
m_Autodestruct: 1
m_Emitting: 1
m_ApplyActiveColorSpace: 1

@ -5074,7 +5074,7 @@ PrefabInstance:
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
propertyPath: m_LocalPosition.x
value: 8
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
@ -5084,7 +5084,7 @@ PrefabInstance:
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
propertyPath: m_LocalPosition.z
value: 27
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
@ -5147,7 +5147,7 @@ PrefabInstance:
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
propertyPath: m_LocalPosition.x
value: 6
value: -12
objectReference: {fileID: 0}
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
@ -5157,7 +5157,7 @@ PrefabInstance:
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}
propertyPath: m_LocalPosition.z
value: 12
value: 8
objectReference: {fileID: 0}
- target: {fileID: 4785646500396285758, guid: 1c577f9fe0c6219a992900cb942290f8,
type: 3}

@ -1,30 +1,57 @@
using System;
using Grid;
using UnityEngine;
using UnityEngine.Serialization;
public class GrenadeProjectile : MonoBehaviour {
private Vector3 targetPosition;
private const float moveSpeed = 15f;
private const float reachedTargetDistance = .2f;
private const float reachedTargetDistance = 2f;
private const float damageRadius = 4f;
[SerializeField] private Transform grenadeExplodeVfxPrefab;
[SerializeField] private TrailRenderer trailRenderer;
[FormerlySerializedAs("ArcYAnimationCurve")] [SerializeField]
private AnimationCurve arcYAnimationCurve;
private Action onGrenadeBehaviourComplete;
private Vector3 positionXZ;
private Vector3 targetPosition;
private float totalDistance;
private void Update() {
Vector3 moveDir = (targetPosition - transform.position).normalized;
transform.position += moveSpeed * Time.deltaTime * moveDir;
if (!(Vector3.Distance(transform.position, targetPosition) < reachedTargetDistance)) return;
Collider[] colliderArray = Physics.OverlapSphere(targetPosition, damageRadius);
foreach (Collider collider in colliderArray) {
if (collider.TryGetComponent(out Unit targetUnit)) targetUnit.Damage(30);
positionXZ += moveSpeed * Time.deltaTime * moveDir;
float distance = Vector3.Distance(positionXZ, targetPosition);
float distanceNormalized = 1 - distance / totalDistance;
float maxHeight = totalDistance / 4f;
float positionY = arcYAnimationCurve.Evaluate(distanceNormalized) * maxHeight;
transform.position = new(positionXZ.x, positionY, positionXZ.z);
if (!(Vector3.Distance(positionXZ, targetPosition) < reachedTargetDistance * maxHeight)) return;
Collider[] hitColliderArray = Physics.OverlapSphere(targetPosition, damageRadius);
foreach (Collider hitCollider in hitColliderArray) {
if (hitCollider.TryGetComponent(out Unit targetUnit)) targetUnit.Damage(30);
}
OnAnyGrenadeExploded?.Invoke(this, EventArgs.Empty);
trailRenderer.transform.parent = null;
Instantiate(grenadeExplodeVfxPrefab, targetPosition + Vector3.up * 1f, Quaternion.identity);
Destroy(gameObject);
onGrenadeBehaviourComplete();
}
public static event EventHandler OnAnyGrenadeExploded;
public void Setup(GridPosition targetGridPosition, Action newGrenadeBehaviourComplete) {
onGrenadeBehaviourComplete = newGrenadeBehaviourComplete;
targetPosition = LevelGrid.Instance.GetWorldPosition(targetGridPosition);
positionXZ = transform.position;
positionXZ.y = 0;
totalDistance = Vector3.Distance(positionXZ, targetPosition);
}
}
}

@ -1,8 +1,14 @@
using System;
using Actions;
using UnityEngine;
public class ScreenShakeActions : MonoBehaviour {
private void Start() => ShootAction.OnAnyShoot += ShootAction_OnAnyShoot;
private void Start() {
ShootAction.OnAnyShoot += ShootAction_OnAnyShoot;
GrenadeProjectile.OnAnyGrenadeExploded += GrenadeProjectile_OnAnyGrenadeExploded;
}
private void GrenadeProjectile_OnAnyGrenadeExploded(object sender, EventArgs e) => ScreenShake.Instance.Shake(5f);
private void ShootAction_OnAnyShoot(object sender, ShootAction.ShootEventArgs e) => ScreenShake.Instance.Shake();
}

@ -4,13 +4,10 @@ using Grid;
using UnityEngine;
public class Unit : MonoBehaviour {
private const int ACTION_POINTS_MAX = 2;
private int actionPoints = ACTION_POINTS_MAX;
public static event EventHandler OnAnyUnitSpawned;
public static event EventHandler OnAnyUnitDead;
private const int ACTION_POINTS_MAX = 10;
[SerializeField] private bool isEnemy;
private int actionPoints = ACTION_POINTS_MAX;
public GridPosition GridPosition { get; private set; }
public BaseAction[] BaseActionArray { get; private set; }
@ -26,14 +23,6 @@ public class Unit : MonoBehaviour {
public bool IsEnemy => isEnemy;
public T GetAction<T>() where T : BaseAction {
foreach (BaseAction baseAction in BaseActionArray) {
if (baseAction is T action) return action;
}
return null;
}
private void Awake() {
BaseActionArray = GetComponents<BaseAction>();
HealthSystem = GetComponent<HealthSystem>();
@ -47,12 +36,6 @@ public class Unit : MonoBehaviour {
OnAnyUnitSpawned?.Invoke(this, EventArgs.Empty);
}
private void HealthSystem_OnDead(object sender, EventArgs e) {
LevelGrid.Instance.RemoveUnitAtGridPosition(GridPosition, this);
Destroy(gameObject);
OnAnyUnitDead?.Invoke(this, EventArgs.Empty);
}
private void Update() {
GridPosition newGridPosition = LevelGrid.Instance.GetGridPosition(transform.position);
if (newGridPosition == GridPosition) return;
@ -61,6 +44,23 @@ public class Unit : MonoBehaviour {
LevelGrid.Instance.UnitMovedGridPosition(this, oldGridPosition, GridPosition);
}
public static event EventHandler OnAnyUnitSpawned;
public static event EventHandler OnAnyUnitDead;
public T GetAction<T>() where T : BaseAction {
foreach (BaseAction baseAction in BaseActionArray) {
if (baseAction is T action) return action;
}
return null;
}
private void HealthSystem_OnDead(object sender, EventArgs e) {
LevelGrid.Instance.RemoveUnitAtGridPosition(GridPosition, this);
Destroy(gameObject);
OnAnyUnitDead?.Invoke(this, EventArgs.Empty);
}
public static event EventHandler OnAnyActionPointsChanged;
private void TurnSystem_OnTurnChanged(object sender, EventArgs e) {