Ajout des explosions aux autres astéroides

This commit is contained in:
Jean-Sébastien Gervais 2016-04-08 23:48:56 -04:00
parent b3dfa5d641
commit c0c7600e33
5 changed files with 24 additions and 7 deletions

View File

@ -106,6 +106,11 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 1
step: 0
rotationSpeed: 1
rotationDirection: 1
RandomRotationSpeed: 1
CrashFlamesEmitter: {fileID: 120238, guid: 1a5b0b5645fa6104087fd9f96b6104b9, type: 2}
TrailFlamesEmitter: {fileID: 0}
--- !u!135 &13502558
SphereCollider:
m_ObjectHideFlags: 1

View File

@ -54,7 +54,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 8.22, y: 1.36, z: 0}
m_LocalPosition: {x: 8.22, y: 2.74, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 404170}
@ -106,6 +106,11 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 1
step: 0
rotationSpeed: 1
rotationDirection: 1
RandomRotationSpeed: 1
CrashFlamesEmitter: {fileID: 120238, guid: 1a5b0b5645fa6104087fd9f96b6104b9, type: 2}
TrailFlamesEmitter: {fileID: 0}
--- !u!135 &13502558
SphereCollider:
m_ObjectHideFlags: 1

View File

@ -54,7 +54,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 160026}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 8.22, y: 1.36, z: 0}
m_LocalPosition: {x: 8.22, y: -0.12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 404170}
@ -106,6 +106,11 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 1
step: 0
rotationSpeed: 1
rotationDirection: 1
RandomRotationSpeed: 1
CrashFlamesEmitter: {fileID: 120238, guid: 1a5b0b5645fa6104087fd9f96b6104b9, type: 2}
TrailFlamesEmitter: {fileID: 0}
--- !u!135 &13502558
SphereCollider:
m_ObjectHideFlags: 1

View File

@ -76,14 +76,14 @@ ParticleSystem:
randomSeed: 0
looping: 0
prewarm: 0
playOnAwake: 1
playOnAwake: 0
moveWithTransform: 1
scalingMode: 1
InitialModule:
serializedVersion: 2
enabled: 1
startLifetime:
scalar: 2
scalar: 3
maxCurve:
serializedVersion: 2
m_Curve:
@ -359,7 +359,7 @@ ParticleSystem:
length: 5
boxX: 1
boxY: 1
boxZ: 1
boxZ: 35.55
arc: 360
placementMode: 0
m_Mesh: {fileID: 0}

View File

@ -65,13 +65,15 @@ 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; ///TODO : a changer pour p.theta
var angleImpact = (360.0f + (((asteroidTheta * 180)) / Mathf.PI)) % 360;
var emitter = (GameObject)Instantiate(CrashFlamesEmitter, crashPosition, Quaternion.identity);
//fix du prefab, il point à l'inverse de la caméra, ramenner avec rotation 90 deg en y
//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.Rotate(0,90.0f,angleImpact);
emitter.transform.localRotation = Quaternion.Euler(0, 180.0f, angleImpact);
emitter.GetComponent<ParticleSystem>().Play(true);
}
Destroy(this.gameObject);