mirror of
https://github.com/ConjureETS/Labo_2_equ_2_a15.git
synced 2026-03-24 01:21:07 +00:00
Ennemi meurt, missile explose
This commit is contained in:
parent
91f044026e
commit
44069a74b1
72
Assets/Animations/RocketExplode.anim
Normal file
72
Assets/Animations/RocketExplode.anim
Normal file
@ -0,0 +1,72 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: RocketExplode
|
||||
serializedVersion: 6
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves: []
|
||||
m_PPtrCurves:
|
||||
- curve:
|
||||
- time: 0
|
||||
value: {fileID: 21300000, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- time: .0833333358
|
||||
value: {fileID: 21300002, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- time: .166666672
|
||||
value: {fileID: 21300004, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- time: .25
|
||||
value: {fileID: 21300006, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
attribute: m_Sprite
|
||||
path:
|
||||
classID: 212
|
||||
script: {fileID: 0}
|
||||
m_SampleRate: 12
|
||||
m_WrapMode: 0
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings:
|
||||
- path: 0
|
||||
attribute: 0
|
||||
script: {fileID: 0}
|
||||
classID: 212
|
||||
customType: 23
|
||||
isPPtrCurve: 1
|
||||
pptrCurveMapping:
|
||||
- {fileID: 21300000, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- {fileID: 21300002, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- {fileID: 21300004, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
- {fileID: 21300006, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_StartTime: 0
|
||||
m_StopTime: .333333343
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_LoopTime: 1
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves: []
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_GenerateMotionCurves: 0
|
||||
m_Events: []
|
||||
8
Assets/Animations/RocketExplode.anim.meta
Normal file
8
Assets/Animations/RocketExplode.anim.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ae521a6c73d4624ca8fc62521d38b81
|
||||
timeCreated: 1447814344
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
67
Assets/Animations/RocketExplosion.controller
Normal file
67
Assets/Animations/RocketExplosion.controller
Normal file
@ -0,0 +1,67 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: RocketExplosion
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: 110700000}
|
||||
m_Mask: {fileID: 0}
|
||||
m_Motions: []
|
||||
m_Behaviours: []
|
||||
m_BlendingMode: 0
|
||||
m_SyncedLayerIndex: -1
|
||||
m_DefaultWeight: 0
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1102 &110200000
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: RocketExplode
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 1ae521a6c73d4624ca8fc62521d38b81, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1107 &110700000
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 110200000}
|
||||
m_Position: {x: 228, y: 48, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 276, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 110200000}
|
||||
8
Assets/Animations/RocketExplosion.controller.meta
Normal file
8
Assets/Animations/RocketExplosion.controller.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37897c8d04944ba4081557adb316c358
|
||||
timeCreated: 1447814344
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Graphics/part_explosion.png
Normal file
BIN
Assets/Graphics/part_explosion.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 174 KiB |
100
Assets/Graphics/part_explosion.png.meta
Normal file
100
Assets/Graphics/part_explosion.png.meta
Normal file
@ -0,0 +1,100 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f417a81754b9c847a59fbcbd3443b28
|
||||
timeCreated: 1447814998
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
21300000: part_explosion_0
|
||||
21300002: part_explosion_1
|
||||
21300004: part_explosion_2
|
||||
21300006: part_explosion_3
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 16
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 8
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites:
|
||||
- name: part_explosion_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 158
|
||||
y: 1160
|
||||
width: 734
|
||||
height: 718
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
- name: part_explosion_1
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1080
|
||||
y: 1062
|
||||
width: 904
|
||||
height: 933
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
- name: part_explosion_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 119
|
||||
y: 112
|
||||
width: 801
|
||||
height: 803
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
- name: part_explosion_3
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1314
|
||||
y: 245
|
||||
width: 510
|
||||
height: 499
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Materials.meta
Normal file
9
Assets/Materials.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59380ca674bc8f647b27b9a371d04289
|
||||
folderAsset: yes
|
||||
timeCreated: 1447816262
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/Materials/HalfAlpha.mat
Normal file
32
Assets/Materials/HalfAlpha.mat
Normal file
@ -0,0 +1,32 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: HalfAlpha
|
||||
m_Shader: {fileID: 10753, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
data:
|
||||
first:
|
||||
name: PixelSnap
|
||||
second: 0
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: .525490224}
|
||||
8
Assets/Materials/HalfAlpha.mat.meta
Normal file
8
Assets/Materials/HalfAlpha.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2de77d301c423ea41a1b0948e2efd81c
|
||||
timeCreated: 1447816273
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -15,7 +15,7 @@ GameObject:
|
||||
- 95: {fileID: 9512508}
|
||||
m_Layer: 0
|
||||
m_Name: Enemy
|
||||
m_TagString: Untagged
|
||||
m_TagString: Enemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -89,6 +89,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2995a96f18c88c3499b43774e78a5e9b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
HP: 2
|
||||
ground: {fileID: 0}
|
||||
--- !u!212 &21249000
|
||||
SpriteRenderer:
|
||||
@ -127,6 +128,10 @@ Prefab:
|
||||
propertyPath: m_Controller
|
||||
value:
|
||||
objectReference: {fileID: 9100000, guid: 532dc94ed04ade946a636626daddb305, type: 2}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_TagString
|
||||
value: Enemy
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 183722}
|
||||
|
||||
@ -71,6 +71,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0523305ab193c9b4dbcf3a14bd1fd1ae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
explosion: {fileID: 100000, guid: 340a9e7d5164c9c4fba1dc34dc50b866, type: 2}
|
||||
--- !u!212 &21212352
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -116,6 +117,10 @@ Prefab:
|
||||
propertyPath: m_GravityScale
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: explosion
|
||||
value:
|
||||
objectReference: {fileID: 100000, guid: 340a9e7d5164c9c4fba1dc34dc50b866, type: 2}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 141294}
|
||||
|
||||
138
Assets/Prefabs/rocketExplosion.prefab
Normal file
138
Assets/Prefabs/rocketExplosion.prefab
Normal file
@ -0,0 +1,138 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &100000
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 400000}
|
||||
- 212: {fileID: 21200000}
|
||||
- 95: {fileID: 9500000}
|
||||
- 114: {fileID: 11400002}
|
||||
m_Layer: 0
|
||||
m_Name: rocketExplosion
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &400000
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 15.8479748, y: 4.80068254, z: -6.18383789}
|
||||
m_LocalScale: {x: .0500000007, y: .0500000007, z: .0500000007}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!95 &9500000
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 37897c8d04944ba4081557adb316c358, type: 2}
|
||||
m_CullingMode: 1
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 1
|
||||
m_LinearVelocityBlending: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
--- !u!114 &11400002
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 43318d3a1c1725a4480b79f958fa8fd3, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
destroyOnAwake: 0
|
||||
awakeDestroyDelay: 0
|
||||
findChild: 0
|
||||
namedChild:
|
||||
--- !u!212 &21200000
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 2de77d301c423ea41a1b0948e2efd81c, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_ReflectionProbeUsage: 0
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 1024582385
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300004, guid: 5f417a81754b9c847a59fbcbd3443b28, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: 21300004, guid: 5f417a81754b9c847a59fbcbd3443b28,
|
||||
type: 3}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_Controller
|
||||
value:
|
||||
objectReference: {fileID: 9100000, guid: 37897c8d04944ba4081557adb316c358, type: 2}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: .0500000007
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: .0500000007
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: .0500000007
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 2de77d301c423ea41a1b0948e2efd81c, type: 2}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: destroyOnAwake
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 0}
|
||||
propertyPath: findChild
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 100000}
|
||||
m_IsPrefabParent: 1
|
||||
8
Assets/Prefabs/rocketExplosion.prefab.meta
Normal file
8
Assets/Prefabs/rocketExplosion.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 340a9e7d5164c9c4fba1dc34dc50b866
|
||||
timeCreated: 1447814851
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -5,6 +5,13 @@ public class RocketBehaviour : MonoBehaviour {
|
||||
|
||||
private bool isAPlayerRocket;
|
||||
|
||||
public GameObject explosion;
|
||||
|
||||
void FixedUpdate ()
|
||||
{
|
||||
Destroy(gameObject, 2);
|
||||
}
|
||||
|
||||
//Destroys the rocket when no longer visible
|
||||
void OnBecameInvisible()
|
||||
{
|
||||
@ -13,8 +20,31 @@ public class RocketBehaviour : MonoBehaviour {
|
||||
//Destroys the rocket when it hits something (except Player when its his rocket)
|
||||
void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
if(!isAPlayerRocket || collision.gameObject.tag != "Player")
|
||||
Destroy(gameObject);
|
||||
//if collision.gameObject,tag == "enemy"
|
||||
// If it hits an enemy...
|
||||
if (collision.gameObject.tag == "Enemy") {
|
||||
// ... find the Enemy script and call the Hurt function.
|
||||
collision.gameObject.GetComponent<EnemyBehavior> ().Hurt ();
|
||||
|
||||
// call the explosion animation
|
||||
Explode ();
|
||||
|
||||
// Destroy the rocket.
|
||||
Destroy (gameObject);
|
||||
} else if (!isAPlayerRocket || collision.gameObject.tag != "Player") {
|
||||
// call the explosion animation
|
||||
Explode ();
|
||||
Destroy (gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode()
|
||||
{
|
||||
// Create a quaternion with a random rotation in the z-axis.
|
||||
Quaternion randomRotation = Quaternion.Euler (0f, 0f, Random.Range (0f, 360f));
|
||||
|
||||
// Instantiate the explosion where the rocket is with the random rotation.
|
||||
Instantiate (explosion, transform.position, randomRotation);
|
||||
}
|
||||
|
||||
public void SetProperty(bool playerRocket)
|
||||
|
||||
22
Assets/Scripts/Destroyer.cs
Normal file
22
Assets/Scripts/Destroyer.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class Destroyer : MonoBehaviour
|
||||
{
|
||||
public bool destroyOnAwake; // Whether or not this gameobject should destroyed after a delay, on Awake.
|
||||
public float awakeDestroyDelay; // The delay for destroying it on Awake.
|
||||
|
||||
|
||||
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
// If the gameobject should be destroyed on awake,
|
||||
if(destroyOnAwake)
|
||||
{ // ... destroy the gameobject after the delay.
|
||||
Destroy(gameObject, awakeDestroyDelay);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
12
Assets/Scripts/Destroyer.cs.meta
Normal file
12
Assets/Scripts/Destroyer.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43318d3a1c1725a4480b79f958fa8fd3
|
||||
timeCreated: 1447816513
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -6,6 +6,9 @@ public class EnemyBehavior : MonoBehaviour {
|
||||
private float direction = 1.0f;
|
||||
private Rigidbody2D rb;
|
||||
private bool facingRight = true;
|
||||
private bool dead = false;
|
||||
|
||||
public int HP = 2;
|
||||
|
||||
|
||||
// Ground
|
||||
@ -30,6 +33,11 @@ public class EnemyBehavior : MonoBehaviour {
|
||||
if ((direction < 0 && facingRight) || (direction > 0 && !facingRight))
|
||||
flip();
|
||||
|
||||
// If the enemy has zero or fewer hit points and isn't dead yet...
|
||||
if(HP <= 0 && !dead)
|
||||
// ... call the death function.
|
||||
Death ();
|
||||
|
||||
}
|
||||
|
||||
private void flip()
|
||||
@ -39,4 +47,20 @@ public class EnemyBehavior : MonoBehaviour {
|
||||
scale.x *= -1;
|
||||
transform.localScale = scale;
|
||||
}
|
||||
|
||||
public void Hurt()
|
||||
{
|
||||
// Reduce the number of hit points by one.
|
||||
HP--;
|
||||
}
|
||||
|
||||
void Death()
|
||||
{
|
||||
// Set dead to true.
|
||||
dead = true;
|
||||
// delete the enemy
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ PlayerSettings:
|
||||
defaultScreenOrientation: 4
|
||||
targetDevice: 2
|
||||
targetResolution: 0
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
productName: Laboratoire_2_Equipe_2
|
||||
@ -28,6 +29,7 @@ PlayerSettings:
|
||||
androidShowActivityIndicatorOnLoading: -1
|
||||
iosAppInBackgroundBehavior: 0
|
||||
displayResolutionDialog: 1
|
||||
iosAllowHTTPDownload: 1
|
||||
allowedAutorotateToPortrait: 1
|
||||
allowedAutorotateToPortraitUpsideDown: 1
|
||||
allowedAutorotateToLandscapeRight: 1
|
||||
@ -135,6 +137,15 @@ PlayerSettings:
|
||||
iOSLaunchScreenFillPct: 100
|
||||
iOSLaunchScreenSize: 100
|
||||
iOSLaunchScreenCustomXibPath:
|
||||
iOSLaunchScreeniPadType: 0
|
||||
iOSLaunchScreeniPadImage: {fileID: 0}
|
||||
iOSLaunchScreeniPadBackgroundColor:
|
||||
serializedVersion: 2
|
||||
rgba: 0
|
||||
iOSLaunchScreeniPadFillPct: 100
|
||||
iOSLaunchScreeniPadSize: 100
|
||||
iOSLaunchScreeniPadCustomXibPath:
|
||||
iOSDeviceRequirements: []
|
||||
AndroidTargetDevice: 0
|
||||
AndroidSplashScreenScale: 0
|
||||
androidSplashScreen: {fileID: 0}
|
||||
@ -224,6 +235,8 @@ PlayerSettings:
|
||||
ps4SdkOverride:
|
||||
ps4BGMPath:
|
||||
ps4ShareFilePath:
|
||||
ps4ShareOverlayImagePath:
|
||||
ps4PrivacyGuardImagePath:
|
||||
ps4NPtitleDatPath:
|
||||
ps4RemotePlayKeyAssignment: -1
|
||||
ps4RemotePlayKeyMappingDir:
|
||||
@ -245,6 +258,7 @@ PlayerSettings:
|
||||
ps4attribMoveSupport: 0
|
||||
ps4attrib3DSupport: 0
|
||||
ps4attribShareSupport: 0
|
||||
ps4IncludedModules: []
|
||||
monoEnv:
|
||||
psp2Splashimage: {fileID: 0}
|
||||
psp2NPTrophyPackPath:
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 5.2.0f3
|
||||
m_EditorVersion: 5.2.1f1
|
||||
m_StandardAssetsVersion: 0
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
tags: []
|
||||
tags:
|
||||
- Enemy
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user