-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Update] Update DestroyEffect spawn position, Bind event
- Loading branch information
1 parent
5fa42dd
commit 805b9c2
Showing
5 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
MissileCommander/.idea/.idea.MissileCommander/.idea/contentModel.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1 &6752188890843315280 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 7176714262414095371} | ||
- component: {fileID: 8081201054838013091} | ||
m_Layer: 0 | ||
m_Name: DestroyEffect_0 | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &7176714262414095371 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 6752188890843315280} | ||
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: 8440115618531013871} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!212 &8081201054838013091 | ||
SpriteRenderer: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 6752188890843315280} | ||
m_Enabled: 1 | ||
m_CastShadows: 0 | ||
m_ReceiveShadows: 0 | ||
m_DynamicOccludee: 1 | ||
m_MotionVectors: 1 | ||
m_LightProbeUsage: 1 | ||
m_ReflectionProbeUsage: 1 | ||
m_RenderingLayerMask: 1 | ||
m_RendererPriority: 0 | ||
m_Materials: | ||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} | ||
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: 0 | ||
m_MinimumChartSize: 4 | ||
m_AutoUVMaxDistance: 0.5 | ||
m_AutoUVMaxAngle: 89 | ||
m_LightmapParameters: {fileID: 0} | ||
m_SortingLayerID: 0 | ||
m_SortingLayer: 0 | ||
m_SortingOrder: 0 | ||
m_Sprite: {fileID: -1864373156434754777, guid: a288b627034cd4497ab612861d948f9a, | ||
type: 3} | ||
m_Color: {r: 1, g: 1, b: 1, a: 1} | ||
m_FlipX: 0 | ||
m_FlipY: 0 | ||
m_DrawMode: 0 | ||
m_Size: {x: 1.2, y: 1.2} | ||
m_AdaptiveModeThreshold: 0.5 | ||
m_SpriteTileMode: 0 | ||
m_WasSpriteAssigned: 1 | ||
m_MaskInteraction: 0 | ||
m_SpriteSortPoint: 0 | ||
--- !u!1 &6951797282581088142 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 8440115618531013871} | ||
- component: {fileID: 6117580419327657503} | ||
m_Layer: 0 | ||
m_Name: DestroyEffect | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &8440115618531013871 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 6951797282581088142} | ||
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: | ||
- {fileID: 7176714262414095371} | ||
m_Father: {fileID: 0} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!114 &6117580419327657503 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 6951797282581088142} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: cdbcc414a06341c5a9585ad907a01c32, type: 3} | ||
m_Name: | ||
m_EditorClassIdentifier: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
using UnityEngine; | ||
using System; | ||
using UnityEngine; | ||
|
||
namespace MissileCommander | ||
{ | ||
public class DestroyEffect : RecyclableObject | ||
{ | ||
|
||
[SerializeField] private float effectTime = 0.5f; | ||
private float _elapsedTime = 0f; | ||
|
||
private void Update() | ||
{ | ||
if (!isActivated) { return; } | ||
|
||
_elapsedTime += Time.deltaTime; | ||
if (_elapsedTime >= effectTime) | ||
{ | ||
_elapsedTime = 0f; | ||
isActivated = false; | ||
|
||
onDestroyed?.Invoke(this); | ||
} | ||
} | ||
} | ||
} |