Exploisions autoplay, essais de gérer leur desctuction après fin de l'animation automatiquement, sans succès.

This commit is contained in:
Jean-Sébastien Gervais 2016-04-09 10:20:24 -04:00
parent a53274aae3
commit 97510a28f1
7 changed files with 190 additions and 9 deletions

View File

@ -28,6 +28,7 @@ GameObject:
- 23: {fileID: 2317388}
- 114: {fileID: 11437858}
- 135: {fileID: 13502558}
- 54: {fileID: 5491084}
m_Layer: 0
m_Name: Asteroid_1
m_TagString: Asteroid
@ -93,6 +94,21 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5491084
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &11437858
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@ -28,6 +28,7 @@ GameObject:
- 23: {fileID: 2317388}
- 114: {fileID: 11437858}
- 135: {fileID: 13502558}
- 54: {fileID: 5406432}
m_Layer: 0
m_Name: Asteroid_2
m_TagString: Asteroid
@ -93,6 +94,21 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5406432
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &11437858
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@ -28,6 +28,7 @@ GameObject:
- 23: {fileID: 2317388}
- 114: {fileID: 11437858}
- 135: {fileID: 13502558}
- 54: {fileID: 5463390}
m_Layer: 0
m_Name: Asteroid_3
m_TagString: Asteroid
@ -93,6 +94,21 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5463390
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &11437858
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@ -28,6 +28,7 @@ GameObject:
- 23: {fileID: 2317388}
- 114: {fileID: 11437858}
- 135: {fileID: 13502558}
- 54: {fileID: 5474450}
m_Layer: 0
m_Name: Asteroid_4
m_TagString: Asteroid
@ -93,6 +94,21 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5474450
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &11437858
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@ -36,7 +36,7 @@ ParticleSystem:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 120238}
serializedVersion: 2
lengthInSec: 0.75
lengthInSec: 0.85
startDelay:
scalar: 0
maxCurve:
@ -76,14 +76,14 @@ ParticleSystem:
randomSeed: 0
looping: 0
prewarm: 0
playOnAwake: 0
playOnAwake: 1
moveWithTransform: 1
scalingMode: 1
InitialModule:
serializedVersion: 2
enabled: 1
startLifetime:
scalar: 0.75
scalar: 0.85
maxCurve:
serializedVersion: 2
m_Curve:

View File

@ -65,7 +65,7 @@ public class Asteroid : MonoBehaviour
//crashPosition.z = 1.15f;
var asteroidTheta = Mathf.Atan2(this.transform.position.y, this.transform.position.x);
var angleImpact = (360.0f + (((asteroidTheta * 180)) / Mathf.PI)) % 360;
var angleImpact = (360.0f + (((asteroidTheta * 180)) / Mathf.PI)) % 360;
var emitter = (GameObject)Instantiate(CrashFlamesEmitter, crashPosition, Quaternion.identity);
@ -73,11 +73,18 @@ public class Asteroid : MonoBehaviour
//et donner l'angle d'impact inverse en z (vers l'extérieur de la planete)
//emitter.transform.Rotate(0,90.0f,angleImpact);
emitter.transform.localRotation = Quaternion.Euler(0, 180.0f, angleImpact);
emitter.GetComponent<ParticleSystem>().Play(true);
//var wtf = new WaitForSeconds(emitter.GetComponent<ParticleSystem>().duration);
//Destroy(emitter);
}
Destroy(this.gameObject);
}
}
}

View File

@ -85,7 +85,7 @@ NavMeshSettings:
cellSize: 0.16666667
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &49842865
--- !u!1001 &72971843
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
@ -124,17 +124,123 @@ Prefab:
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
propertyPath: planet
value:
objectReference: {fileID: 1027139440}
- target: {fileID: 154602, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
propertyPath: m_Name
value: Astronaut_2
value: Astronaut_0
objectReference: {fileID: 0}
- target: {fileID: 11434752, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
propertyPath: PlayerNumber
value: 2
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2}
m_IsPrefabParent: 0
--- !u!1 &76822469
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 76822471}
- 82: {fileID: 76822470}
m_Layer: 0
m_Name: SoundManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!82 &76822470
AudioSource:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 76822469}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 9d5b4e40a18f443489c6c6a9d4916848, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!4 &76822471
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 76822469}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.71010804, y: -0.021637373, z: 0.11328125}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
--- !u!114 &1027139440 stripped
MonoBehaviour:
m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1,
@ -227,6 +333,10 @@ Prefab:
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11485214, guid: e86e27c7b6d9c824cb76115e90a15cac, type: 2}
propertyPath: NextSpawnTime
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: e86e27c7b6d9c824cb76115e90a15cac, type: 2}
m_IsPrefabParent: 0