Arson Lindgren 2021-11-15 18:16:14 +00:00
commit 554d9a35c1
3 changed files with 133 additions and 2 deletions

View File

@ -3108,6 +3108,133 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
droppedItemAmount: 3
--- !u!1 &1004702649
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1004702650}
- component: {fileID: 1004702651}
m_Layer: 0
m_Name: ShipSinking
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1004702650
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1004702649}
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: 1780207600}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &1004702651
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1004702649}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 50393e1fc45b0974b838b67fc552c2c9, type: 3}
m_PlayOnAwake: 0
m_Volume: 0.5
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
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.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &1011785959
GameObject:
m_ObjectHideFlags: 0
@ -4690,7 +4817,8 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 1004702650}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -180,6 +180,7 @@ MonoBehaviour:
deathEffect: {fileID: 1496494696399852, guid: e61802031429a4e2e8f547dbca07fe84,
type: 3}
shipWithPasties: {fileID: 21300000, guid: 1e6561e946c90b94895946b3cfb12f82, type: 3}
shipSinking: {fileID: 0}
--- !u!114 &114000011533140650
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -15,8 +15,9 @@ public class EnemyReturn : Physics2DObject
public GameObject droppedObject;
[Header("Death Effect When Shot")]
public GameObject deathEffect;
//[Header("Has Droppable Object")]
public Sprite shipWithPasties;
public AudioSource shipSinking;
private bool hasDroppableObject = false;
private bool isReturning = false;
private Vector2 movement = new Vector2(0f, 0f);
@ -85,6 +86,7 @@ public class EnemyReturn : Physics2DObject
GameObject newDroppedObject = Instantiate<GameObject>(droppedObject);
newDroppedObject.transform.position = new Vector2(this.transform.position.x, this.transform.position.y);
}
GameObject.Find("ShipSinking").GetComponent<AudioSource>().Play();
Destroy(gameObject);
}
}