From 6f39d6f841557ef070d8803aad890064a710911e Mon Sep 17 00:00:00 2001 From: Sophie Date: Fri, 8 Apr 2016 20:37:16 -0400 Subject: [PATCH 01/12] character animation - idle, walk, dash, spin --- Assets/Scripts/Astronaut.cs | 67 +++++--- Assets/Scripts/AstronautAnimator.cs | 75 +++++++++ Assets/Scripts/AstronautAnimator.cs.meta | 12 ++ Assets/Scripts/AstronautController2.cs | 70 ++++++++ Assets/Scripts/AstronautController2.cs.meta | 12 ++ Assets/Scripts/PlanetManager.cs | 2 +- Assets/_Scenes/sophieScene.unity | 177 ++++++++++++++++---- 7 files changed, 363 insertions(+), 52 deletions(-) create mode 100644 Assets/Scripts/AstronautAnimator.cs create mode 100644 Assets/Scripts/AstronautAnimator.cs.meta create mode 100644 Assets/Scripts/AstronautController2.cs create mode 100644 Assets/Scripts/AstronautController2.cs.meta diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 44e3a47..ce07482 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -1,22 +1,24 @@ using UnityEngine; -using System.Collections; +using System.Collections; +[RequireComponent(typeof(AstronautAnimator))] public class Astronaut : MonoBehaviour { - private enum AstronautState + private AstronautAnimator _astronautAnimator; + public enum AstronautState { Idle, Walking, Jumping, Dashing, Ejecting, Dead } public GameObject Rotator; - public GameObject SpriteWalk; + public SpriteRenderer SpriteWalk; public GameObject SpriteDash; public float StepTime; public float JumpSpeed; private AstronautState _state; - private AstronautState State + public AstronautState State { get { @@ -30,19 +32,20 @@ public class Astronaut : MonoBehaviour { if (oldState == _state) return; if (oldState == AstronautState.Dashing) - { - SpriteWalk.SetActive(false); - SpriteDash.SetActive(true); + { + SpriteWalk.gameObject.SetActive(true); + SpriteDash.gameObject.SetActive(false); } else - { - SpriteWalk.SetActive(true); - SpriteDash.SetActive(false); + { + SpriteWalk.gameObject.SetActive(true); + SpriteDash.gameObject.SetActive(false); } - + if (_state == AstronautState.Walking) { - StartCoroutine(WalkingStance()); + //StartCoroutine(WalkingStance()); + _astronautAnimator.Walk(); } } } @@ -53,8 +56,11 @@ public class Astronaut : MonoBehaviour { private float walkTime = 0; private int nextStep = 1; - // Use this for initialization - void Start () { + // Use this for initialization + void Start() + { + _astronautAnimator = GetComponent(); + _astronautAnimator.aspi = this; State = AstronautState.Idle; } @@ -115,6 +121,7 @@ public class Astronaut : MonoBehaviour { { if (_state >= AstronautState.Ejecting) return; + _astronautAnimator.Jump(); } public void Dash() @@ -125,10 +132,32 @@ public class Astronaut : MonoBehaviour { public void OnGUI() { - if (GUI.Button(new Rect(10, 10, 150, 50), State.ToString())) - Debug.Log("Clicked the button with an image"); - } + if (GUI.Button(new Rect(10, 10, 150, 50), "Jump")) + { + Debug.Log("Clicked the button with an image"); + _astronautAnimator.Jump(); + } + if (GUI.Button(new Rect(10, 70, 150, 50), "Land")) + { + Debug.Log("Clicked the 2nd button"); + _astronautAnimator.Land(); + } + + if (GUI.Button(new Rect(10, 130, 150, 50), "Walk")) + { + Debug.Log("Clicked the 3rd button"); + State = AstronautState.Walking; + _astronautAnimator.Walk(); + } + + if (GUI.Button(new Rect(10, 190, 150, 50), "Eject")) + { + Debug.Log("Clicked the 4th button"); + _astronautAnimator.Eject(); + } + } + /* IEnumerator WalkingStance() { Debug.Log("walking stance"); @@ -137,7 +166,7 @@ public class Astronaut : MonoBehaviour { { Vector3 rotation = transform.rotation.eulerAngles; rotation.z = Mathf.Sin(walkTime*Mathf.PI)*50; - print("rotation " + rotation); + //print("rotation " + rotation); transform.rotation = Quaternion.Euler(rotation); yield return null; } @@ -147,5 +176,5 @@ public class Astronaut : MonoBehaviour { { StartCoroutine("WalkingStance"); } - } + }*/ } diff --git a/Assets/Scripts/AstronautAnimator.cs b/Assets/Scripts/AstronautAnimator.cs new file mode 100644 index 0000000..4699bd6 --- /dev/null +++ b/Assets/Scripts/AstronautAnimator.cs @@ -0,0 +1,75 @@ +using UnityEngine; +using System.Collections; + +public class AstronautAnimator : MonoBehaviour { + + //init + public Astronaut aspi; + public float WalkAnimSpeed; + public float WalkAnimAngle; + public float EjectSpinSpeed; + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } + + public void Jump() + { + aspi.SpriteWalk.gameObject.SetActive(false); + aspi.SpriteDash.gameObject.SetActive(true); + } + + public void Land() + { + aspi.SpriteWalk.gameObject.SetActive(true); + aspi.SpriteDash.gameObject.SetActive(false); + } + + public void Walk() + { + StartCoroutine(Rotate()); + } + + public void Eject() + { + StartCoroutine(Spin()); + } + + IEnumerator Spin() + { + for (float i = 0f; i < 3000f; i += Time.deltaTime * EjectSpinSpeed) + { + transform.rotation = Quaternion.Euler(0, 0, i); + yield return null; + } + } + + IEnumerator Rotate() + { + for (float i = 0.5f; i < 2.5f; i+= Time.deltaTime*WalkAnimSpeed) + { + /*int roundDown = 10; + //0.5, 1.5 et 2.5 + if (Mathf.Floor(i * roundDown) == roundDown || Mathf.Floor(i * roundDown) == 2 * roundDown) + { + print(i * roundDown + " " + Mathf.Floor(i * roundDown)); + aspi.SpriteWalk.flipX = !aspi.SpriteWalk.flipX; + }*/ + float position = Mathf.PingPong(i, 1f); + transform.rotation = Quaternion.Euler(0, 0, (position - 0.5f) * WalkAnimAngle * 2); + yield return null; + } + + if (aspi.State == Astronaut.AstronautState.Walking) + { + StartCoroutine(Rotate()); + } + yield return null; + } +} diff --git a/Assets/Scripts/AstronautAnimator.cs.meta b/Assets/Scripts/AstronautAnimator.cs.meta new file mode 100644 index 0000000..dc6173f --- /dev/null +++ b/Assets/Scripts/AstronautAnimator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 77462b2431858f84b9bc2d055c2f4d45 +timeCreated: 1460135550 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AstronautController2.cs b/Assets/Scripts/AstronautController2.cs new file mode 100644 index 0000000..5de5d5f --- /dev/null +++ b/Assets/Scripts/AstronautController2.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using System.Collections; +using InputHandler; + +[RequireComponent(typeof(Astronaut))] +public class AstronautController2 : MonoBehaviour +{ + + private Astronaut _astronaut; + + public int PlayerNumber; + + // Use this for initialization + void Start() + { + InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerButtons); + + _astronaut = GetComponent(); + } + + private void HandlePlayerAxis(MappedInput input) + { + if (this == null) return; + + // movement + + float xValue = 0f; + + if (input.Ranges.ContainsKey("MoveLeft")) + { + xValue = -input.Ranges["MoveLeft"]; + } + else if (input.Ranges.ContainsKey("MoveRight")) + { + xValue = input.Ranges["MoveRight"]; + } + + float yValue = 0f; + + if (input.Ranges.ContainsKey("MoveUp")) + { + yValue = input.Ranges["MoveUp"]; + } + else if (input.Ranges.ContainsKey("MoveDown")) + { + yValue = -input.Ranges["MoveDown"]; + } + + _astronaut.Move(xValue, yValue); + + if (input.Ranges.ContainsKey("Dash")) + { + if (input.Ranges["Dash"] > 0.8f) + _astronaut.Dash(); + } + } + + private void HandlePlayerButtons(MappedInput input) + { + if (this == null) return; + + if (input.Actions.Contains("Jump")) + { + _astronaut.Jump(); + } + } +} + diff --git a/Assets/Scripts/AstronautController2.cs.meta b/Assets/Scripts/AstronautController2.cs.meta new file mode 100644 index 0000000..2dadbdf --- /dev/null +++ b/Assets/Scripts/AstronautController2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d7792093ffcd687448b5875a8ce0cc32 +timeCreated: 1460133633 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 68671b2..6298910 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -12,7 +12,7 @@ public class PlanetManager : MonoBehaviour public bool CartierResetRatioSpeedRandomize = true; public float CartierMinRatio = 0.4f; public float CartierMaxRatio = 2.0f; - public float CartierStepSize = 0.25; + public float CartierStepSize = 0.25f; public GameObject WedgePrefab = null; public List wedges = new List(); diff --git a/Assets/_Scenes/sophieScene.unity b/Assets/_Scenes/sophieScene.unity index 9480a93..6750b83 100644 --- a/Assets/_Scenes/sophieScene.unity +++ b/Assets/_Scenes/sophieScene.unity @@ -171,6 +171,53 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 +--- !u!1001 &160670874 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.x + value: -0.6692338 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.y + value: 1.7862048 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.z + value: -0.045327663 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 11450178, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: InputMapperAsset + value: + objectReference: {fileID: 11400000, guid: ba52e0f13249c9e46bb162622e61904f, + type: 2} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 158e745881137e04ca2086294f44d74c, type: 2} + m_IsPrefabParent: 0 --- !u!1 &238389812 GameObject: m_ObjectHideFlags: 0 @@ -231,44 +278,110 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!1 &1024275268 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1024275269} - - 114: {fileID: 1024275270} - m_Layer: 0 - m_Name: spawnAsteroid - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1024275269 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1024275268} - 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: 0} m_RootOrder: 1 ---- !u!114 &1024275270 +--- !u!212 &841465700 stripped +SpriteRenderer: + m_PrefabParentObject: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660503799} +--- !u!1001 &1660503799 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.y + value: 3.46 + objectReference: {fileID: 0} + - target: {fileID: 21257324, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 157058, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_FlipX + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: SpriteWalk + value: + objectReference: {fileID: 841465700} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.b + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_IsPrefabParent: 0 +--- !u!1 &1660503800 stripped +GameObject: + m_PrefabParentObject: {fileID: 170392, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_PrefabInternal: {fileID: 1660503799} +--- !u!114 &1660503801 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1024275268} + m_GameObject: {fileID: 1660503800} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 665432c96ca23f140a869ed98ade0dde, type: 3} + m_Script: {fileID: 11500000, guid: 77462b2431858f84b9bc2d055c2f4d45, type: 3} m_Name: m_EditorClassIdentifier: - myAsteroid: {fileID: 160026, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + aspi: {fileID: 0} + WalkAnimSpeed: 4 + WalkAnimAngle: 20 + EjectSpinSpeed: 60 From 8d80c2fbdcd6efea1a6896f0f4dcfac693cdf772 Mon Sep 17 00:00:00 2001 From: Sophie Date: Fri, 8 Apr 2016 22:02:02 -0400 Subject: [PATCH 02/12] Corrected merge errors --- Assets/Scripts/Astronaut.cs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index dbd40ca..75db2fc 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -71,11 +71,12 @@ public class Astronaut : MonoBehaviour { _astronautAnimator = GetComponent(); _astronautAnimator.aspi = this; State = AstronautState.Idle; + if (!planet) { - p if (!planet) - {e(); + planet = FindObjectOfType(); } + State = AstronautState.Idle; //Debug.Log(planet.GetPlanetRadius(0)); theta = 0; @@ -232,11 +233,11 @@ public class Astronaut : MonoBehaviour { public void Dash() { - iS(Time.time < DashTime + lastDashTime) + if (Time.time < DashTime + lastDashTime) return; - if (_state >= AstronautState.Ejecting) - return; + if (State >= AstronautState.Ejecting) + return; lastDashTime = Time.time; planet.PushWedge(this.theta); @@ -272,14 +273,5 @@ public class Astronaut : MonoBehaviour { State = AstronautState.Walking; _astronautAnimator.Walk(); } - - if (GUI.Button(new Rect(10, 190, 150, 50), "Eject")) - { - Debug.Lif(State == AstronautState.Walking) - { StartCoroutine("WalkingStance"); - } - { - StartCoroutine("WalkingStance"); - } - }*/ + } } From 72b4975ab1d080a69c8595eb292844298e9307d8 Mon Sep 17 00:00:00 2001 From: Sophie Date: Fri, 8 Apr 2016 22:26:21 -0400 Subject: [PATCH 03/12] All merges accepted --- Assets/Scripts/Astronaut.cs | 5 +++++ Assets/_Scenes/Main.unity | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 45dda95..89de1c7 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -228,9 +228,13 @@ public class Astronaut : MonoBehaviour { public void Jump() { + Debug.Log("Jump!"); + if (State >= AstronautState.Ejecting) return; + _astronautAnimator.Jump(); + if (State == AstronautState.Jumping) { Dash(); @@ -238,6 +242,7 @@ public class Astronaut : MonoBehaviour { return; } + if (!grounded) return; vSpeed = JumpSpeed; grounded = false; diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 650a3fa..7133947 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -85,6 +85,31 @@ NavMeshSettings: cellSize: 0.16666667 manualCellSize: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &431637404 stripped +GameObject: + m_PrefabParentObject: {fileID: 170392, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_PrefabInternal: {fileID: 1660116367} +--- !u!114 &431637410 stripped +MonoBehaviour: + m_PrefabParentObject: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660116367} + m_Script: {fileID: 11500000, guid: 8c32c40e0b8e5eb47bb7a91068af09ca, type: 3} +--- !u!114 &431637411 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 431637404} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 77462b2431858f84b9bc2d055c2f4d45, type: 3} + m_Name: + m_EditorClassIdentifier: + aspi: {fileID: 431637410} + WalkAnimSpeed: 3 + WalkAnimAngle: 20 + EjectSpinSpeed: 5 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, @@ -138,6 +163,11 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 158e745881137e04ca2086294f44d74c, type: 2} m_IsPrefabParent: 0 +--- !u!212 &1106066633 stripped +SpriteRenderer: + m_PrefabParentObject: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660116367} --- !u!1001 &1223268487 Prefab: m_ObjectHideFlags: 0 @@ -297,6 +327,10 @@ Prefab: propertyPath: m_Radius value: 0.76 objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: SpriteWalk + value: + objectReference: {fileID: 1106066633} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_IsPrefabParent: 0 From f6269e20bb92021d3b068138ba382539d754e79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 22:33:50 -0400 Subject: [PATCH 04/12] ajout gameobject pour ajouter des particle emitters aux Asteroids --- Assets/Scripts/Asteroid.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index ad160d6..cc5fc62 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -10,6 +10,10 @@ public class Asteroid : MonoBehaviour public float rotationDirection = 1.0f; public bool RandomRotationSpeed = true; + public GameObject CrashFlamesEmitter; //Emitter on impact + + public GameObject TrailFlamesEmitter; // trailing smoke + // Use this for initialization public void Start() { @@ -56,6 +60,13 @@ public class Asteroid : MonoBehaviour { var pmgr = FindObjectOfType(); pmgr.PushWedge(otherCol.gameObject.transform.parent.eulerAngles.z); + + if (CrashFlamesEmitter) + { + Instantiate(CrashFlamesEmitter, this.transform.position, this.transform.forward); + } + + Destroy(this.gameObject); } } From 2d63fef4a0609300c5b016cd6c6cade461ea2dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 22:34:39 -0400 Subject: [PATCH 05/12] merge --- Assets/Prefabs/Astronaut.prefab | 21 +- Assets/Scripts/Asteroid.cs | 10 +- Assets/Scripts/AsteroidSpawner.cs | 7 +- Assets/Scripts/Astronaut.cs | 103 +++-- Assets/Scripts/AstronautAnimator.cs | 75 +++ Assets/Scripts/AstronautAnimator.cs.meta | 12 + Assets/Scripts/AstronautController2.cs | 70 +++ Assets/Scripts/AstronautController2.cs.meta | 12 + Assets/Scripts/PlanetManager.cs | 488 ++++++++++---------- Assets/Test/SR_Player2.unity | 8 + Assets/_Scenes/Main.unity | 34 ++ Assets/_Scenes/sophieScene.unity | 177 +++++-- 12 files changed, 681 insertions(+), 336 deletions(-) create mode 100644 Assets/Scripts/AstronautAnimator.cs create mode 100644 Assets/Scripts/AstronautAnimator.cs.meta create mode 100644 Assets/Scripts/AstronautController2.cs create mode 100644 Assets/Scripts/AstronautController2.cs.meta diff --git a/Assets/Prefabs/Astronaut.prefab b/Assets/Prefabs/Astronaut.prefab index dd5900a..6bbf479 100644 --- a/Assets/Prefabs/Astronaut.prefab +++ b/Assets/Prefabs/Astronaut.prefab @@ -57,8 +57,9 @@ GameObject: - 4: {fileID: 403646} - 114: {fileID: 11494368} - 114: {fileID: 11434752} - - 54: {fileID: 5402556} - 136: {fileID: 13683032} + - 54: {fileID: 5462614} + - 136: {fileID: 13672180} m_Layer: 0 m_Name: Character m_TagString: Player @@ -117,7 +118,7 @@ Transform: - {fileID: 403646} m_Father: {fileID: 0} m_RootOrder: 0 ---- !u!54 &5402556 +--- !u!54 &5462614 Rigidbody: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} @@ -130,7 +131,7 @@ Rigidbody: m_UseGravity: 0 m_IsKinematic: 0 m_Interpolate: 0 - m_Constraints: 0 + m_Constraints: 120 m_CollisionDetection: 0 --- !u!114 &11434752 MonoBehaviour: @@ -164,7 +165,21 @@ MonoBehaviour: JumpSpeed: 5 Gravity: 15 Speed: 5 + EjectSpeed: 20 planet: {fileID: 0} +--- !u!136 &13672180 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 170392} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.77 + m_Height: 3.37 + m_Direction: 1 + m_Center: {x: -0.03, y: 0.35, z: 0} --- !u!136 &13683032 CapsuleCollider: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index cc5fc62..754c5c6 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -18,15 +18,13 @@ public class Asteroid : MonoBehaviour public void Start() { speed = Random.Range(1.8F, 3F); - // print(speed); center = new Vector3(0, 0); - - + if (RandomRotationSpeed) rotationSpeed = 10 * UnityEngine.Random.Range(0.25f, 5f); - - rotationDirection = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f))*2 - 1); - + + rotationDirection = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); + } // Update is called once per frame diff --git a/Assets/Scripts/AsteroidSpawner.cs b/Assets/Scripts/AsteroidSpawner.cs index 567a2f7..7d6d89e 100644 --- a/Assets/Scripts/AsteroidSpawner.cs +++ b/Assets/Scripts/AsteroidSpawner.cs @@ -68,10 +68,11 @@ public class AsteroidSpawner : TimerFunctionsClass var angle = ( 360.0f + (((playerTheta * 180)) / Mathf.PI)) % 360; ///TODO : a changer pour p.theta print("angle:" + angle); - var AsteroidType = Mathf.RoundToInt(Mathf.Floor(UnityEngine.Random.Range(0f, 3.999f))); - + var AsteroidType = Mathf.RoundToInt(Mathf.Floor(UnityEngine.Random.Range(0f, 3.999f))); + float direction = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); + Instantiate(AsteroidPrefabTypes[AsteroidType], - planet.GetPlanetCoordinatesFromPlayerXY(angle, UnityEngine.Random.Range(10f,15f)), + direction*planet.GetPlanetCoordinatesFromPlayerXY(angle, UnityEngine.Random.Range(10f,15f)), Quaternion.identity); } diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 0a66ef2..89de1c7 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -1,15 +1,17 @@ using UnityEngine; using System.Collections; +[RequireComponent(typeof(AstronautAnimator))] public class Astronaut : MonoBehaviour { - private enum AstronautState + private AstronautAnimator _astronautAnimator; + public enum AstronautState { Idle, Walking, Jumping, Dashing, Ejecting, Dead } public GameObject Rotator; - public GameObject SpriteWalk; + public SpriteRenderer SpriteWalk; public GameObject SpriteDash; public float Width; @@ -19,11 +21,13 @@ public class Astronaut : MonoBehaviour { public float JumpSpeed; public float Gravity; public float Speed; + public float EjectSpeed; + //public float DashSpeed; public PlanetManager planet; private AstronautState _state; - private AstronautState State + public AstronautState State { get { @@ -37,19 +41,20 @@ public class Astronaut : MonoBehaviour { if (oldState == _state) return; if (oldState == AstronautState.Dashing) - { - SpriteWalk.SetActive(false); - SpriteDash.SetActive(true); + { + SpriteWalk.gameObject.SetActive(false); + SpriteDash.gameObject.SetActive(true); } else - { - SpriteWalk.SetActive(true); - SpriteDash.SetActive(false); + { + SpriteWalk.gameObject.SetActive(true); + SpriteDash.gameObject.SetActive(false); } - + /*if (_state == AstronautState.Walking) { - StartCoroutine(WalkingStance()); + //StartCoroutine(WalkingStance()); + _astronautAnimator.Walk(); }*/ } } @@ -62,12 +67,18 @@ public class Astronaut : MonoBehaviour { private float walkTime = 0; private int nextStep = 1; - // Use this for initialization - public void Start () { + // Use this for initialization + void Start() + { + _astronautAnimator = GetComponent(); + _astronautAnimator.aspi = this; + State = AstronautState.Idle; + if (!planet) { planet = FindObjectOfType(); } + State = AstronautState.Idle; //Debug.Log(planet.GetPlanetRadius(0)); theta = 0; @@ -111,15 +122,27 @@ public class Astronaut : MonoBehaviour { if (!grounded) { height += vSpeed * delta; - vSpeed -= Gravity * delta; + if (State != AstronautState.Ejecting) + vSpeed -= Gravity * delta; + else + vSpeed *= 0.98f; } float radius = GetGroundRadius(); if (grounded = (height <= radius)) { + /*if (State == AstronautState.Dashing) + { + planet.PushWedge(Repeat(theta,360)); + State = AstronautState.Idle; + //TODO_SR Create dash impact here + }*/ + height = radius; if (State == AstronautState.Jumping) State = AstronautState.Idle; + + vSpeed = 0f; } UpdatePosition(); @@ -135,8 +158,7 @@ public class Astronaut : MonoBehaviour { { walkTime += Time.deltaTime / StepTime; Vector3 rotation = transform.rotation.eulerAngles; - rotation.z = Mathf.Sin(walkTime * Mathf.PI)*50; - transform.rotation = Quaternion.Euler(rotation); + rotation.z = Mathf.Sin(walkTime * Mathf.PI)*50; transform.rotation = Quaternion.Euler(rotation); }*/ /* @@ -199,15 +221,20 @@ public class Astronaut : MonoBehaviour { } if (State == AstronautState.Dashing && grounded) { - //TODO arreter mouvelement lateral + //TODO arreter mouvement lateral State=AstronautState.Idle; } } public void Jump() { + Debug.Log("Jump!"); + if (State >= AstronautState.Ejecting) return; + + _astronautAnimator.Jump(); + if (State == AstronautState.Jumping) { Dash(); @@ -215,6 +242,7 @@ public class Astronaut : MonoBehaviour { return; } + if (!grounded) return; vSpeed = JumpSpeed; grounded = false; @@ -225,13 +253,23 @@ public class Astronaut : MonoBehaviour { { if (Time.time < DashTime + lastDashTime) - return; + return; - if (_state >= AstronautState.Ejecting) - return; + if (State >= AstronautState.Ejecting) + return; lastDashTime = Time.time; planet.PushWedge(this.theta); + + //State = AstronautState.Dashing; + //vSpeed = -DashSpeed; + } + + public void Eject() + { + State = AstronautState.Ejecting; + vSpeed = EjectSpeed; + grounded = false; } /// @@ -242,31 +280,12 @@ public class Astronaut : MonoBehaviour { print("Stunned"); } - - public void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 50), State.ToString())) + { Debug.Log("Clicked the button with an image"); + Eject(); + } } - - /*IEnumerator WalkingStance() - { - Debug.Log("walking stance"); - walkTime += Time.deltaTime / StepTime; - while (State <= AstronautState.Walking || walkTime <= 1f) - { - Vector3 rotation = transform.rotation.eulerAngles; - rotation.z = Mathf.Sin(walkTime*Mathf.PI)*50; - // print("rotation " + rotation); - transform.rotation = Quaternion.Euler(rotation); - yield return null; - } - - walkTime = 0f; - if(State == AstronautState.Walking) - { - StartCoroutine("WalkingStance"); - } - }*/ } diff --git a/Assets/Scripts/AstronautAnimator.cs b/Assets/Scripts/AstronautAnimator.cs new file mode 100644 index 0000000..4699bd6 --- /dev/null +++ b/Assets/Scripts/AstronautAnimator.cs @@ -0,0 +1,75 @@ +using UnityEngine; +using System.Collections; + +public class AstronautAnimator : MonoBehaviour { + + //init + public Astronaut aspi; + public float WalkAnimSpeed; + public float WalkAnimAngle; + public float EjectSpinSpeed; + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } + + public void Jump() + { + aspi.SpriteWalk.gameObject.SetActive(false); + aspi.SpriteDash.gameObject.SetActive(true); + } + + public void Land() + { + aspi.SpriteWalk.gameObject.SetActive(true); + aspi.SpriteDash.gameObject.SetActive(false); + } + + public void Walk() + { + StartCoroutine(Rotate()); + } + + public void Eject() + { + StartCoroutine(Spin()); + } + + IEnumerator Spin() + { + for (float i = 0f; i < 3000f; i += Time.deltaTime * EjectSpinSpeed) + { + transform.rotation = Quaternion.Euler(0, 0, i); + yield return null; + } + } + + IEnumerator Rotate() + { + for (float i = 0.5f; i < 2.5f; i+= Time.deltaTime*WalkAnimSpeed) + { + /*int roundDown = 10; + //0.5, 1.5 et 2.5 + if (Mathf.Floor(i * roundDown) == roundDown || Mathf.Floor(i * roundDown) == 2 * roundDown) + { + print(i * roundDown + " " + Mathf.Floor(i * roundDown)); + aspi.SpriteWalk.flipX = !aspi.SpriteWalk.flipX; + }*/ + float position = Mathf.PingPong(i, 1f); + transform.rotation = Quaternion.Euler(0, 0, (position - 0.5f) * WalkAnimAngle * 2); + yield return null; + } + + if (aspi.State == Astronaut.AstronautState.Walking) + { + StartCoroutine(Rotate()); + } + yield return null; + } +} diff --git a/Assets/Scripts/AstronautAnimator.cs.meta b/Assets/Scripts/AstronautAnimator.cs.meta new file mode 100644 index 0000000..dc6173f --- /dev/null +++ b/Assets/Scripts/AstronautAnimator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 77462b2431858f84b9bc2d055c2f4d45 +timeCreated: 1460135550 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AstronautController2.cs b/Assets/Scripts/AstronautController2.cs new file mode 100644 index 0000000..5de5d5f --- /dev/null +++ b/Assets/Scripts/AstronautController2.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using System.Collections; +using InputHandler; + +[RequireComponent(typeof(Astronaut))] +public class AstronautController2 : MonoBehaviour +{ + + private Astronaut _astronaut; + + public int PlayerNumber; + + // Use this for initialization + void Start() + { + InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerButtons); + + _astronaut = GetComponent(); + } + + private void HandlePlayerAxis(MappedInput input) + { + if (this == null) return; + + // movement + + float xValue = 0f; + + if (input.Ranges.ContainsKey("MoveLeft")) + { + xValue = -input.Ranges["MoveLeft"]; + } + else if (input.Ranges.ContainsKey("MoveRight")) + { + xValue = input.Ranges["MoveRight"]; + } + + float yValue = 0f; + + if (input.Ranges.ContainsKey("MoveUp")) + { + yValue = input.Ranges["MoveUp"]; + } + else if (input.Ranges.ContainsKey("MoveDown")) + { + yValue = -input.Ranges["MoveDown"]; + } + + _astronaut.Move(xValue, yValue); + + if (input.Ranges.ContainsKey("Dash")) + { + if (input.Ranges["Dash"] > 0.8f) + _astronaut.Dash(); + } + } + + private void HandlePlayerButtons(MappedInput input) + { + if (this == null) return; + + if (input.Actions.Contains("Jump")) + { + _astronaut.Jump(); + } + } +} + diff --git a/Assets/Scripts/AstronautController2.cs.meta b/Assets/Scripts/AstronautController2.cs.meta new file mode 100644 index 0000000..2dadbdf --- /dev/null +++ b/Assets/Scripts/AstronautController2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d7792093ffcd687448b5875a8ce0cc32 +timeCreated: 1460133633 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 0d56be4..4d560f8 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -1,250 +1,238 @@ -using System; -using UnityEngine; -using System.Collections; -using System.Collections.Generic; - -public class PlanetManager : MonoBehaviour -{ - - public int NbCartiers = 10; - public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 - public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly - public bool CartierResetRatioSpeedRandomize = true; - public bool CartierResetOverTime = true; - public float CartierMinRatio = 0.4f; - public float CartierMaxRatio = 2.0f; - public float CartierStepSize = 0.25f; - public GameObject WedgePrefab = null; - public List wedges = new List(); - - // Use this for initialization - public void Awake () { - TailleCartiersEnDegres = 360.0f / NbCartiers; - - for(int i = 0; i < NbCartiers; i++) - { - float debutAngleTheta = i* TailleCartiersEnDegres; - var w = new Wedge() {tMin = debutAngleTheta, tMax = debutAngleTheta + TailleCartiersEnDegres}; - - //float angle = i * Mathf.PI * 2 / NbCartiers * 360; - //var wedgePos = GetPlanetCoordinatesFromPlayerXY(debutAngleTheta, 0); - // wedgePos.x -= Mathf.Cos(debutAngleTheta * Mathf.PI / 180); - //wedgePos.y -= Mathf.Sin(debutAngleTheta * Mathf.PI / 180); - var obj = Instantiate(WedgePrefab, new Vector3(0.0f,0.0f, 0.0f), Quaternion.Euler(0, 0, debutAngleTheta)); - obj.name = "wedge_" + i; - w.sprite = GameObject.Find(obj.name); - wedges.Add(w); //pushes at end. - } - } - - // Update is called once per frame - public void Update () { - - - } - - public void FixedUpdate() - { - if (!this.CartierResetOverTime) return; - //Ramener les plateforme vers leur position initiale 0; - - foreach (var w in wedges) - { - if (w.offset <= 1.05f && w.offset >= 0.95f) - { - w.offset = 1.0f; - } - else if (w.offset > 1.0f) - { - if (!CartierResetRatioSpeedRandomize) - { - w.offset -= 0.005f*CartierResetRatioSpeedFactor; - } - else - { - w.offset -= 0.005f*CartierResetRatioSpeedFactor * UnityEngine.Random.Range(-0.5f, 2f); - } - } - else if (w.offset < 1.0f) - { - if (!CartierResetRatioSpeedRandomize) - { - w.offset += 0.005f*CartierResetRatioSpeedFactor; - } - else - { - w.offset += 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 3f); - } - } - - w.sprite.transform.localScale = new Vector3(w.offset, w.offset,1.0f); - } - //TODO_SR For each player - } - - public void PushWedge(float thetaPlayerX) - { - var index = GetWedgeIndex(thetaPlayerX); - var w = wedges[index]; - - w.offset = w.offset - CartierStepSize; - if (w.offset < CartierMinRatio) - w.offset = CartierMinRatio; - - - w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); - - //push back l'opposée - var indexOppose = GetWedgeOpposé(index); - var v = wedges[indexOppose]; - - v.offset = v.offset + CartierStepSize; - if (v.offset > CartierMaxRatio) - v.offset = CartierMaxRatio; - - v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); - - // call fill gauge after every hit. - var earthQuakeGauge = FindObjectOfType(); - earthQuakeGauge.FillGauge(); - } - - - /// - /// On a earthquake, everything expands by a step - /// - public void CallEarthQuake() - { - foreach (var w in wedges) - { - w.offset = w.offset + CartierStepSize; - if (w.offset > CartierMaxRatio) - w.offset = CartierMaxRatio; - } - } - - //public void PushWedge(float thetaPlayerX) - //{ - // var index = GetWedgeIndex(thetaPlayerX); - // var w = wedges[index]; - - - - // w.offset = w.offset - 0.5f; - // if (w.offset < -1.0f) - // w.offset = -1.0f; - - // var angle = w.tMin; //w.tMax - TailleCartiersEnDegres/2; - - // var normalPos = GetPlanetCoordinatesFromPlayerXY(angle, 0); - // normalPos.x -= Mathf.Cos(angle * Mathf.PI / 180); - // normalPos.y -= Mathf.Sin(angle * Mathf.PI / 180); - - // var wedgePos = GetPlanetCoordinatesFromPlayerXY(angle, 0); - // wedgePos.x -= Mathf.Cos(angle * Mathf.PI / 180) - 50 * w.offset * Mathf.Cos(angle * Mathf.PI / 180); - // wedgePos.y -= Mathf.Sin(angle * Mathf.PI / 180) - 50 * w.offset * Mathf.Sin(angle * Mathf.PI / 180); - - - // w.sprite.transform.position = Vector3.Lerp(normalPos, wedgePos, Time.deltaTime); - - // ///push back l'opposée - // var indexOppose = GetWedgeOpposé(index); - // var v = wedges[indexOppose]; - - // v.offset = v.offset + 0.5f; - // if (v.offset > 1.0f) - // v.offset = 1.0f; - - // angle = v.tMin; //w.tMax - TailleCartiersEnDegres/2; - - // normalPos = GetPlanetCoordinatesFromPlayerXY(angle, 0); - // normalPos.x -= Mathf.Cos(angle * Mathf.PI / 180); - // normalPos.y -= Mathf.Sin(angle * Mathf.PI / 180); - - // wedgePos = GetPlanetCoordinatesFromPlayerXY(angle, 0); - // wedgePos.x -= Mathf.Cos(angle * Mathf.PI / 180) - 50 * v.offset * Mathf.Cos(angle * Mathf.PI / 180); - // wedgePos.y -= Mathf.Sin(angle * Mathf.PI / 180) - 50 * v.offset * Mathf.Sin(angle * Mathf.PI / 180); - - - // v.sprite.transform.position = Vector3.Lerp(normalPos, wedgePos, Time.deltaTime); - - - //} - - - /// - /// Radius sphere est scale/2 - /// - /// - public float GetPlanetRadius() - { - return gameObject.transform.localScale.x / 2.0f; - } - - /// - /// Radius sphere est scale/2 - /// - /// - public float GetPlanetRadius(float thetaPlayerX) - { - var wedge = GetWedgeFromTheta(thetaPlayerX); - return GetPlanetRadius() * wedge.offset; - } - - - public Vector3 GetPlanetCoordinatesFromPlayerXY(float playerLocalX, float playerLocalY) - { - var theta = playerLocalX; - var wedgeRadius = GetPlanetRadius(playerLocalX) + playerLocalY; - var x = wedgeRadius * Mathf.Cos(theta * Mathf.PI / 180); - var y = wedgeRadius * Mathf.Sin(theta * Mathf.PI / 180) ; - - return new Vector3(x, y, 0); - } - - - /// - /// retourn le no de plateforme - /// - /// - public int GetWedgeIndex(float thetaPlayerX) - { - return (int)Math.Floor(thetaPlayerX / TailleCartiersEnDegres); - } - - /// - /// - /// - /// - /// - public int GetWedgeOpposé(int wedgeIndex) - { - //(i + 5) % 10 => [0,9] - return (wedgeIndex + NbCartiers / 2) % (NbCartiers); - } - - - /// - /// retourne l'objet interne - /// - /// - /// - public Wedge GetWedgeFromTheta(float thetaPlayerX) - { - return wedges[GetWedgeIndex(thetaPlayerX % 360)]; - } - - /// - /// Représente une plateforme qui bouge. - /// - public class Wedge - { - public float offset = 1.0f; //valeurs entre minRatio et maxRatio; < 1 étant renfoncé, 1 position normale, et > 1 vers l'extérieur - public float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; - public float tMax = 0; - - public GameObject sprite; //sprite et collider 2D - - } - -} +using System; +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +public class PlanetManager : MonoBehaviour +{ + + public int NbCartiers = 10; + public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 + public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly + public bool CartierResetRatioSpeedRandomize = true; + public bool CartierResetOverTime = true; + public float CartierMinRatio = 0.4f; + public float CartierMaxRatio = 2.0f; + public float CartierStepSize = 0.25f; + public GameObject WedgePrefab = null; + public List wedges = new List(); + + // Use this for initialization + public void Awake () { + TailleCartiersEnDegres = 360.0f / NbCartiers; + + for(int i = 0; i < NbCartiers; i++) + { + float debutAngleTheta = i* TailleCartiersEnDegres; + var w = new Wedge() {tMin = debutAngleTheta, tMax = debutAngleTheta + TailleCartiersEnDegres}; + + //float angle = i * Mathf.PI * 2 / NbCartiers * 360; + //var wedgePos = GetPlanetCoordinatesFromPlayerXY(debutAngleTheta, 0); + // wedgePos.x -= Mathf.Cos(debutAngleTheta * Mathf.PI / 180); + //wedgePos.y -= Mathf.Sin(debutAngleTheta * Mathf.PI / 180); + var obj = Instantiate(WedgePrefab, new Vector3(0.0f,0.0f, 0.0f), Quaternion.Euler(0, 0, debutAngleTheta)); + obj.name = "wedge_" + i; + w.sprite = GameObject.Find(obj.name); + wedges.Add(w); //pushes at end. + } + } + + // Update is called once per frame + public void Update () { + + + } + + public void FixedUpdate() + { + if (!this.CartierResetOverTime) return; + //Ramener les plateforme vers leur position initiale 0; + + foreach (var w in wedges) + { + if (w.offset <= 1.05f && w.offset >= 0.95f) + { + w.offset = 1.0f; + } + else if (w.offset > 1.0f) + { + if (!CartierResetRatioSpeedRandomize) + { + w.offset -= 0.005f*CartierResetRatioSpeedFactor; + } + else + { + w.offset -= 0.005f*CartierResetRatioSpeedFactor * UnityEngine.Random.Range(-0.5f, 2f); + } + } + else if (w.offset < 1.0f) + { + if (!CartierResetRatioSpeedRandomize) + { + w.offset += 0.005f*CartierResetRatioSpeedFactor; + } + else + { + w.offset += 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 3f); + } + } + + w.sprite.transform.localScale = new Vector3(w.offset, w.offset,1.0f); + } + //TODO_SR For each player + } + + public void PushWedge(float thetaPlayerX) + { + var index = GetWedgeIndex(thetaPlayerX); + var w = wedges[index]; + + w.offset = w.offset - CartierStepSize; + if (w.offset < CartierMinRatio) + w.offset = CartierMinRatio; + + + w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); + + //push back l'opposée + var indexOppose = GetWedgeOpposé(index); + var v = wedges[indexOppose]; + + v.offset = v.offset + CartierStepSize; + if (v.offset > CartierMaxRatio) + v.offset = CartierMaxRatio; + + v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); + + // call fill gauge after every hit. + var earthQuakeGauge = FindObjectOfType(); + earthQuakeGauge.FillGauge(); + } + + /// + /// On a earthquake, everything expands by a step + /// + public void CallEarthQuake() + { + foreach (var w in wedges) + { + w.offset = w.offset + CartierStepSize; + if (w.offset > CartierMaxRatio) + w.offset = CartierMaxRatio; + } + } + + //public void PushWedge(float thetaPlayerX) + //{ + // var index = GetWedgeIndex(thetaPlayerX); + // var w = wedges[index]; + + // w.offset = w.offset - 0.5f; + // if (w.offset < -1.0f) + // w.offset = -1.0f; + + // var angle = w.tMin; //w.tMax - TailleCartiersEnDegres/2; + + // var normalPos = GetPlanetCoordinatesFromPlayerXY(angle, 0); + // normalPos.x -= Mathf.Cos(angle * Mathf.PI / 180); + // normalPos.y -= Mathf.Sin(angle * Mathf.PI / 180); + + // var wedgePos = GetPlanetCoordinatesFromPlayerXY(angle, 0); + // wedgePos.x -= Mathf.Cos(angle * Mathf.PI / 180) - 50 * w.offset * Mathf.Cos(angle * Mathf.PI / 180); + // wedgePos.y -= Mathf.Sin(angle * Mathf.PI / 180) - 50 * w.offset * Mathf.Sin(angle * Mathf.PI / 180); + + // w.sprite.transform.position = Vector3.Lerp(normalPos, wedgePos, Time.deltaTime); + + // ///push back l'opposée + // var indexOppose = GetWedgeOpposé(index); + // var v = wedges[indexOppose]; + + // v.offset = v.offset + 0.5f; + // if (v.offset > 1.0f) + // v.offset = 1.0f; + + // angle = v.tMin; //w.tMax - TailleCartiersEnDegres/2; + + // normalPos = GetPlanetCoordinatesFromPlayerXY(angle, 0); + // normalPos.x -= Mathf.Cos(angle * Mathf.PI / 180); + // normalPos.y -= Mathf.Sin(angle * Mathf.PI / 180); + + // wedgePos = GetPlanetCoordinatesFromPlayerXY(angle, 0); + // wedgePos.x -= Mathf.Cos(angle * Mathf.PI / 180) - 50 * v.offset * Mathf.Cos(angle * Mathf.PI / 180); + // wedgePos.y -= Mathf.Sin(angle * Mathf.PI / 180) - 50 * v.offset * Mathf.Sin(angle * Mathf.PI / 180); + + // v.sprite.transform.position = Vector3.Lerp(normalPos, wedgePos, Time.deltaTime); + + //} + + /// + /// Radius sphere est scale/2 + /// + /// + public float GetPlanetRadius() + { + return gameObject.transform.localScale.x / 2.0f; + } + + /// + /// Radius sphere est scale/2 + /// + /// + public float GetPlanetRadius(float thetaPlayerX) + { + var wedge = GetWedgeFromTheta(thetaPlayerX); + return GetPlanetRadius() * wedge.offset; + } + public Vector3 GetPlanetCoordinatesFromPlayerXY(float playerLocalX, float playerLocalY) + { + var theta = playerLocalX; + var wedgeRadius = GetPlanetRadius(playerLocalX) + playerLocalY; + var x = wedgeRadius * Mathf.Cos(theta * Mathf.PI / 180); + var y = wedgeRadius * Mathf.Sin(theta * Mathf.PI / 180) ; + + return new Vector3(x, y, 0); + } + + /// + /// retourn le no de plateforme + /// + /// + public int GetWedgeIndex(float thetaPlayerX) + { + return (int)Math.Floor(thetaPlayerX / TailleCartiersEnDegres); + } + + /// + /// + /// + /// + /// + public int GetWedgeOpposé(int wedgeIndex) + { + //(i + 5) % 10 => [0,9] + return (wedgeIndex + NbCartiers / 2) % (NbCartiers); + } + + /// + /// retourne l'objet interne + /// + /// + /// + public Wedge GetWedgeFromTheta(float thetaPlayerX) + { + return wedges[GetWedgeIndex(thetaPlayerX % 360)]; + } + + /// + /// Représente une plateforme qui bouge. + /// + public class Wedge + { + public float offset = 1.0f; //valeurs entre minRatio et maxRatio; < 1 étant renfoncé, 1 position normale, et > 1 vers l'extérieur + public float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; + public float tMax = 0; + + public GameObject sprite; //sprite et collider 2D + + } +} diff --git a/Assets/Test/SR_Player2.unity b/Assets/Test/SR_Player2.unity index 2007a20..cf24f80 100644 --- a/Assets/Test/SR_Player2.unity +++ b/Assets/Test/SR_Player2.unity @@ -572,6 +572,14 @@ Prefab: propertyPath: Width value: 0.4 objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: EjectSpeed + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: DashSpeed + value: 12 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 650a3fa..7133947 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -85,6 +85,31 @@ NavMeshSettings: cellSize: 0.16666667 manualCellSize: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &431637404 stripped +GameObject: + m_PrefabParentObject: {fileID: 170392, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_PrefabInternal: {fileID: 1660116367} +--- !u!114 &431637410 stripped +MonoBehaviour: + m_PrefabParentObject: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660116367} + m_Script: {fileID: 11500000, guid: 8c32c40e0b8e5eb47bb7a91068af09ca, type: 3} +--- !u!114 &431637411 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 431637404} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 77462b2431858f84b9bc2d055c2f4d45, type: 3} + m_Name: + m_EditorClassIdentifier: + aspi: {fileID: 431637410} + WalkAnimSpeed: 3 + WalkAnimAngle: 20 + EjectSpinSpeed: 5 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, @@ -138,6 +163,11 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 158e745881137e04ca2086294f44d74c, type: 2} m_IsPrefabParent: 0 +--- !u!212 &1106066633 stripped +SpriteRenderer: + m_PrefabParentObject: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660116367} --- !u!1001 &1223268487 Prefab: m_ObjectHideFlags: 0 @@ -297,6 +327,10 @@ Prefab: propertyPath: m_Radius value: 0.76 objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: SpriteWalk + value: + objectReference: {fileID: 1106066633} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/_Scenes/sophieScene.unity b/Assets/_Scenes/sophieScene.unity index 9480a93..6750b83 100644 --- a/Assets/_Scenes/sophieScene.unity +++ b/Assets/_Scenes/sophieScene.unity @@ -171,6 +171,53 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 +--- !u!1001 &160670874 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.x + value: -0.6692338 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.y + value: 1.7862048 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalPosition.z + value: -0.045327663 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 498212, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 11450178, guid: 158e745881137e04ca2086294f44d74c, type: 2} + propertyPath: InputMapperAsset + value: + objectReference: {fileID: 11400000, guid: ba52e0f13249c9e46bb162622e61904f, + type: 2} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 158e745881137e04ca2086294f44d74c, type: 2} + m_IsPrefabParent: 0 --- !u!1 &238389812 GameObject: m_ObjectHideFlags: 0 @@ -231,44 +278,110 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!1 &1024275268 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1024275269} - - 114: {fileID: 1024275270} - m_Layer: 0 - m_Name: spawnAsteroid - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1024275269 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1024275268} - 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: 0} m_RootOrder: 1 ---- !u!114 &1024275270 +--- !u!212 &841465700 stripped +SpriteRenderer: + m_PrefabParentObject: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, + type: 2} + m_PrefabInternal: {fileID: 1660503799} +--- !u!1001 &1660503799 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 403646, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_LocalPosition.y + value: 3.46 + objectReference: {fileID: 0} + - target: {fileID: 21257324, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 157058, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_FlipX + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: SpriteWalk + value: + objectReference: {fileID: 841465700} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21220066, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: m_Color.b + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_IsPrefabParent: 0 +--- !u!1 &1660503800 stripped +GameObject: + m_PrefabParentObject: {fileID: 170392, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + m_PrefabInternal: {fileID: 1660503799} +--- !u!114 &1660503801 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1024275268} + m_GameObject: {fileID: 1660503800} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 665432c96ca23f140a869ed98ade0dde, type: 3} + m_Script: {fileID: 11500000, guid: 77462b2431858f84b9bc2d055c2f4d45, type: 3} m_Name: m_EditorClassIdentifier: - myAsteroid: {fileID: 160026, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + aspi: {fileID: 0} + WalkAnimSpeed: 4 + WalkAnimAngle: 20 + EjectSpinSpeed: 60 From 26bd529a1a671ccc6a2467437b8d0975545dd1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 22:38:24 -0400 Subject: [PATCH 06/12] erreur compile --- Assets/Scripts/Asteroid.cs | 2 +- Assets/Scripts/Asteroid.cs.orig | 72 ++++++++++++++++++++++++++++ Assets/Scripts/Asteroid.cs.orig.meta | 8 ++++ Assets/_Scenes/Main.unity | 14 ++---- 4 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 Assets/Scripts/Asteroid.cs.orig create mode 100644 Assets/Scripts/Asteroid.cs.orig.meta diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index 754c5c6..04ba30f 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -61,7 +61,7 @@ public class Asteroid : MonoBehaviour if (CrashFlamesEmitter) { - Instantiate(CrashFlamesEmitter, this.transform.position, this.transform.forward); + //Instantiate(CrashFlamesEmitter, this.transform.position, this.transform.forward); } diff --git a/Assets/Scripts/Asteroid.cs.orig b/Assets/Scripts/Asteroid.cs.orig new file mode 100644 index 0000000..754c5c6 --- /dev/null +++ b/Assets/Scripts/Asteroid.cs.orig @@ -0,0 +1,72 @@ +using UnityEngine; +using System.Collections; + +public class Asteroid : MonoBehaviour +{ + Vector3 center; + public float speed; + public float step; + public float rotationSpeed = 1.0f; + public float rotationDirection = 1.0f; + public bool RandomRotationSpeed = true; + + public GameObject CrashFlamesEmitter; //Emitter on impact + + public GameObject TrailFlamesEmitter; // trailing smoke + + // Use this for initialization + public void Start() + { + speed = Random.Range(1.8F, 3F); + center = new Vector3(0, 0); + + if (RandomRotationSpeed) + rotationSpeed = 10 * UnityEngine.Random.Range(0.25f, 5f); + + rotationDirection = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); + + } + + // Update is called once per frame + public void Update () { + MoveObject(center); + + } + + public void MoveObject(Vector3 center) + { + step = speed * Time.deltaTime; + this.transform.position = Vector3.MoveTowards(transform.position, center, step); + + + + this.transform.Rotate(new Vector3(0, 0, 1.0f), rotationDirection * rotationSpeed * Time.deltaTime); + + } + + //collider must be set as "isTrigger" in unity for this method to work + public void OnTriggerEnter(Collider otherCol) + { + + + if (otherCol.gameObject.tag == "Player") + { + ///Stun the player + otherCol.gameObject.GetComponent().Stun(); + } + if (otherCol.gameObject.tag == "Wedge") + { + var pmgr = FindObjectOfType(); + pmgr.PushWedge(otherCol.gameObject.transform.parent.eulerAngles.z); + + if (CrashFlamesEmitter) + { + Instantiate(CrashFlamesEmitter, this.transform.position, this.transform.forward); + } + + + Destroy(this.gameObject); + } + } + +} diff --git a/Assets/Scripts/Asteroid.cs.orig.meta b/Assets/Scripts/Asteroid.cs.orig.meta new file mode 100644 index 0000000..c83a42c --- /dev/null +++ b/Assets/Scripts/Asteroid.cs.orig.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 190ea851aec618c4797f7963dd7d386d +timeCreated: 1460169373 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 7133947..499aa62 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -89,12 +89,6 @@ NavMeshSettings: GameObject: m_PrefabParentObject: {fileID: 170392, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_PrefabInternal: {fileID: 1660116367} ---- !u!114 &431637410 stripped -MonoBehaviour: - m_PrefabParentObject: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, - type: 2} - m_PrefabInternal: {fileID: 1660116367} - m_Script: {fileID: 11500000, guid: 8c32c40e0b8e5eb47bb7a91068af09ca, type: 3} --- !u!114 &431637411 MonoBehaviour: m_ObjectHideFlags: 0 @@ -106,10 +100,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 77462b2431858f84b9bc2d055c2f4d45, type: 3} m_Name: m_EditorClassIdentifier: - aspi: {fileID: 431637410} - WalkAnimSpeed: 3 - WalkAnimAngle: 20 - EjectSpinSpeed: 5 + aspi: {fileID: 0} + WalkAnimSpeed: 0 + WalkAnimAngle: 0 + EjectSpinSpeed: 0 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, From 653cd7aeccf9b21c98d6e35f9d37483d24599ea5 Mon Sep 17 00:00:00 2001 From: Thibault Stones Date: Fri, 8 Apr 2016 22:32:41 -0400 Subject: [PATCH 07/12] A - Added an entier explosion particle made for meteors impacts. --- Assets/Art/M_ExplosionParticle.mat | 138 ++ Assets/Art/M_ExplosionParticle.mat.meta | 8 + Assets/Art/T_ExplosionParticle_01.png | Bin 0 -> 28651 bytes Assets/Art/T_ExplosionParticle_01.png.meta | 57 + Assets/Prefabs/P_Explosion.prefab | 1547 ++++++++++++++++++++ Assets/Prefabs/P_Explosion.prefab.meta | 8 + 6 files changed, 1758 insertions(+) create mode 100644 Assets/Art/M_ExplosionParticle.mat create mode 100644 Assets/Art/M_ExplosionParticle.mat.meta create mode 100644 Assets/Art/T_ExplosionParticle_01.png create mode 100644 Assets/Art/T_ExplosionParticle_01.png.meta create mode 100644 Assets/Prefabs/P_Explosion.prefab create mode 100644 Assets/Prefabs/P_Explosion.prefab.meta diff --git a/Assets/Art/M_ExplosionParticle.mat b/Assets/Art/M_ExplosionParticle.mat new file mode 100644 index 0000000..4f292f3 --- /dev/null +++ b/Assets/Art/M_ExplosionParticle.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: M_ExplosionParticle + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + 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} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: 0.5 + data: + first: + name: _Parallax + second: 0.02 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: 0.5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + data: + first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Art/M_ExplosionParticle.mat.meta b/Assets/Art/M_ExplosionParticle.mat.meta new file mode 100644 index 0000000..9837439 --- /dev/null +++ b/Assets/Art/M_ExplosionParticle.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7d0e59685de7d7449e84875524fa9c2 +timeCreated: 1460164692 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/T_ExplosionParticle_01.png b/Assets/Art/T_ExplosionParticle_01.png new file mode 100644 index 0000000000000000000000000000000000000000..11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BBIWFe)S8ifz2_nw^;eT5JooKF_eUu`!m< z?Sdtfc}|qya_YUm3?_W;p2}e|iYft;40`oks15CSVFalU%$CApus*djXUG~c79`7W z;}Se{r%t`#^I5P;Uw)9wx`q5E3_Y#s$Fv~f3HlWs`iXj*XH${CUKf@xoO81Qa2 zeyM=jNQt*T7ti_yX_gDQU|^-B{lF8!YygV zV{~6&yr=|~yNs&nCb$|?P30w)lEH~!hM-#{0}V%|cjS)*IOUUpsWwImUbHQTrP37n zn3b5c3TA|hy8Ky*-ZaKvx4-NZN|S8i)aC=YKMlM^SL1VbaY-9qZ`J%5Q3Q@jigqa| zfBQUOrG8~_R(P94+ac=~y@ez9xJGD+CBJH=O_xrC_i;ebxR{uaH!UesrY>GENkse6 ztgr%Zh20@>*@uDSQ9soYLp|iYj5tK>9ePzWl?KRzM#z&}0{O9>yqe$er-_pyaJIyWp$dr=!BE9up)No-B zFKanwnGcm)P@jYW`Bw=)NM1Pl+^VY$DdS^A63t5%)J0_XucLq}= zizC598ZK4xCROtDn`ksTym*qmt}sDPxftbV(sbQ32>BLJM(b1qrqU2vQHyN??zdX#`ua`^&)p|s#@JrE?l2!tvA)Y z_$n*CB9Xs}x{>qrY&sCN69n^?H)pE*i*Nm?f=G1W*mHepJspNNoau_OPKNQWy&=U) zZGGX7vw0MSAAs~G2UBE0G&zy=mEpsy4j>S{=mwp>`A(whyA*(aFPh5yBcdmvdZw9{ zyWhJ+_97bhw(e@}tD98?csHB8+cCVCmRf=yJv*7btK8f3QaO5BG2i9^vu42D_UdS= zV`ubWk>Vw82Sbq5xvhNk@lyjV^;)*0EUUg&g2Y<7McnmTnb%%(vac6DKOavZrg##B zD*B|RUb-z&6jUlI1~-V S26@W~N=8Ca{GI4)|NjG~j91D4 literal 0 HcmV?d00001 diff --git a/Assets/Art/T_ExplosionParticle_01.png.meta b/Assets/Art/T_ExplosionParticle_01.png.meta new file mode 100644 index 0000000..d20cc0a --- /dev/null +++ b/Assets/Art/T_ExplosionParticle_01.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 29eb5cb075e0c1344981ff1e034e6b65 +timeCreated: 1460164629 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + 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: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/P_Explosion.prefab b/Assets/Prefabs/P_Explosion.prefab new file mode 100644 index 0000000..503b6bb --- /dev/null +++ b/Assets/Prefabs/P_Explosion.prefab @@ -0,0 +1,1547 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &120238 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 433226} + - 198: {fileID: 19875420} + - 199: {fileID: 19948450} + m_Layer: 0 + m_Name: P_Explosion + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &433226 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 120238} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -7.23, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!198 &19875420 +ParticleSystem: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 120238} + serializedVersion: 2 + lengthInSec: 3 + startDelay: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + speed: 1 + randomSeed: 0 + looping: 1 + prewarm: 0 + playOnAwake: 1 + moveWithTransform: 1 + scalingMode: 1 + InitialModule: + serializedVersion: 2 + enabled: 1 + startLifetime: + scalar: 2 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startSpeed: + scalar: 1.5 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0.3333333 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0.6666667 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minMaxState: 1 + startColor: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 0 + startSize: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startRotationX: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minMaxState: 3 + startRotationY: + scalar: 3.1415927 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minMaxState: 3 + startRotation: + scalar: 6.283185 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minMaxState: 3 + randomizeRotationDirection: 0 + gravityModifier: -0 + maxNumParticles: 16 + rotation3D: 1 + ShapeModule: + serializedVersion: 2 + enabled: 1 + type: 5 + radius: 1 + angle: 25 + length: 5 + boxX: 1 + boxY: 1 + boxZ: 1 + arc: 360 + placementMode: 0 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + randomDirection: 0 + EmissionModule: + enabled: 1 + serializedVersion: 2 + m_Type: 0 + rate: + scalar: 1000 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + cnt0: 30 + cnt1: 30 + cnt2: 30 + cnt3: 30 + cntmax0: 30 + cntmax1: 30 + cntmax2: 30 + cntmax3: 30 + time0: 0 + time1: 0 + time2: 0 + time3: 0 + m_BurstCount: 0 + SizeModule: + enabled: 1 + curve: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 0.6080802 + value: 0.7249191 + inSlope: -0.87725496 + outSlope: -0.87725496 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: -2.8275726 + outSlope: -2.8275726 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 1 + RotationModule: + enabled: 1 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + curve: + scalar: 1.0471976 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxes: 0 + ColorModule: + enabled: 1 + gradient: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4278238975 + key1: + serializedVersion: 2 + rgba: 4278205852 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 1 + UVModule: + enabled: 0 + frameOverTime: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minMaxState: 1 + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + randomRow: 1 + VelocityModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + ForceModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + enabled: 0 + multiplier: 1 + ClampVelocityModule: + enabled: 0 + x: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + magnitude: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxis: 0 + inWorldSpace: 0 + dampen: 1 + SizeBySpeedModule: + enabled: 0 + curve: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 1 + range: {x: 0, y: 1} + RotationBySpeedModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + curve: + scalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 1 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 2 + type: 0 + collisionMode: 0 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + m_Bounce: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + m_EnergyLossOnCollision: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + minKillSpeed: 0 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 1 + SubModule: + enabled: 0 + subEmitterBirth: {fileID: 0} + subEmitterBirth1: {fileID: 0} + subEmitterCollision: {fileID: 0} + subEmitterCollision1: {fileID: 0} + subEmitterDeath: {fileID: 0} + subEmitterDeath1: {fileID: 0} +--- !u!199 &19948450 +ParticleSystemRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 120238} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: c7d0e59685de7d7449e84875524fa9c2, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_RenderMode: 0 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 120238} + m_IsPrefabParent: 1 diff --git a/Assets/Prefabs/P_Explosion.prefab.meta b/Assets/Prefabs/P_Explosion.prefab.meta new file mode 100644 index 0000000..8fb7686 --- /dev/null +++ b/Assets/Prefabs/P_Explosion.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a5b0b5645fa6104087fd9f96b6104b9 +timeCreated: 1460164322 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From b3dfa5d641a233fe184fbabdc3b7b7e93af8402d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 23:19:00 -0400 Subject: [PATCH 08/12] Des explosions, partout ! --- Assets/Art/M_ExplosionParticle.mat | 14 ++- Assets/Prefabs/Asteroid_1.prefab | 5 + Assets/Prefabs/P_Explosion.prefab | 2 +- Assets/Scripts/Asteroid.cs | 15 ++- Assets/Scripts/AsteroidSpawner.cs | 170 ++++++++++++++--------------- Assets/_Scenes/Main.unity | 42 +++++++ 6 files changed, 156 insertions(+), 92 deletions(-) diff --git a/Assets/Art/M_ExplosionParticle.mat b/Assets/Art/M_ExplosionParticle.mat index 4f292f3..b782019 100644 --- a/Assets/Art/M_ExplosionParticle.mat +++ b/Assets/Art/M_ExplosionParticle.mat @@ -7,10 +7,10 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: M_ExplosionParticle - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: m_LightmapFlags: 5 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 3000 stringTagMap: {} m_SavedProperties: serializedVersion: 2 @@ -19,7 +19,7 @@ Material: first: name: _MainTex second: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: 29eb5cb075e0c1344981ff1e034e6b65, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: @@ -127,6 +127,10 @@ Material: first: name: _Metallic second: 0 + data: + first: + name: _InvFade + second: 1 m_Colors: data: first: @@ -136,3 +140,7 @@ Material: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} + data: + first: + name: _TintColor + second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Assets/Prefabs/Asteroid_1.prefab b/Assets/Prefabs/Asteroid_1.prefab index f7681f9..c1d2116 100644 --- a/Assets/Prefabs/Asteroid_1.prefab +++ b/Assets/Prefabs/Asteroid_1.prefab @@ -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 diff --git a/Assets/Prefabs/P_Explosion.prefab b/Assets/Prefabs/P_Explosion.prefab index 503b6bb..6d68b20 100644 --- a/Assets/Prefabs/P_Explosion.prefab +++ b/Assets/Prefabs/P_Explosion.prefab @@ -74,7 +74,7 @@ ParticleSystem: minMaxState: 0 speed: 1 randomSeed: 0 - looping: 1 + looping: 0 prewarm: 0 playOnAwake: 1 moveWithTransform: 1 diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index 04ba30f..e26761d 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -61,10 +61,19 @@ public class Asteroid : MonoBehaviour if (CrashFlamesEmitter) { - //Instantiate(CrashFlamesEmitter, this.transform.position, this.transform.forward); + var crashPosition = this.transform.position; + //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 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.GetComponent().Play(true); } - - Destroy(this.gameObject); } } diff --git a/Assets/Scripts/AsteroidSpawner.cs b/Assets/Scripts/AsteroidSpawner.cs index 7d6d89e..e99d374 100644 --- a/Assets/Scripts/AsteroidSpawner.cs +++ b/Assets/Scripts/AsteroidSpawner.cs @@ -1,86 +1,86 @@ -using UnityEngine; -using System.Collections; -using System; -using System.Collections.Generic; - -public class AsteroidSpawner : TimerFunctionsClass -{ - - public float NextSpawnTime = 1.0f; - public GameObject AsteroidPrefab1; - public GameObject AsteroidPrefab2; - public GameObject AsteroidPrefab3; - public GameObject AsteroidPrefab4; - private List AsteroidPrefabTypes = new List(); - - public bool GenerationVersLesjoueurs = false; //random lorsque false; - - // Use this for initialization - public void Start () - { - - if (!AsteroidPrefab1 || !AsteroidPrefab2 || !AsteroidPrefab3 || !AsteroidPrefab4) - { - Destroy(this.gameObject); - print("WARNING un type d'asteroide n'est pas defini dans les prefab. Vérifier l'objet avec un component AsteroidSpawner"); - return; - } - AsteroidPrefabTypes.Add(AsteroidPrefab1); - AsteroidPrefabTypes.Add(AsteroidPrefab2); - AsteroidPrefabTypes.Add(AsteroidPrefab3); - AsteroidPrefabTypes.Add(AsteroidPrefab4); - - - if (GenerationVersLesjoueurs) NextSpawnTime = 3 * NextSpawnTime; - this.SetTimer(NextSpawnTime, SpawnAsteroidEvent); - this.StartTimer(); - } - - // Update is called once per frame - public void Update () { - base.Update(); - } - - public void SpawnAsteroidEvent() - { - if (!GenerationVersLesjoueurs) - { - // Random entre 10 et 20, * 1 ou -1 - var x = UnityEngine.Random.Range(10.0f, 20.0f)*(Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f))*2 - 1); - var y = UnityEngine.Random.Range(10.0f, 20.0f)*(Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f))*2 - 1); - - - //0-3 - var AsteroidType = Mathf.RoundToInt(Mathf.Floor(UnityEngine.Random.Range(0f, 3.999f))); - - //instantiate as child of AsteroidSpawner - var a = Instantiate(AsteroidPrefabTypes[AsteroidType], new Vector3(x, y, 0.0f), Quaternion.identity); - //a.tranform.parent = this.transform; - - } - else - { - var players = GameObject.FindGameObjectsWithTag("Player"); - var planet = FindObjectOfType(); - foreach (var p in players) - { - var playerTheta = Mathf.Atan2(p.transform.position.y, p.transform.position.x); - var angle = ( 360.0f + (((playerTheta * 180)) / Mathf.PI)) % 360; ///TODO : a changer pour p.theta - print("angle:" + angle); - +using UnityEngine; +using System.Collections; +using System; +using System.Collections.Generic; + +public class AsteroidSpawner : TimerFunctionsClass +{ + + public float NextSpawnTime = 1.0f; + public GameObject AsteroidPrefab1; + public GameObject AsteroidPrefab2; + public GameObject AsteroidPrefab3; + public GameObject AsteroidPrefab4; + private List AsteroidPrefabTypes = new List(); + + public bool GenerationVersLesjoueurs = false; //random lorsque false; + + // Use this for initialization + public void Start () + { + + if (!AsteroidPrefab1 || !AsteroidPrefab2 || !AsteroidPrefab3 || !AsteroidPrefab4) + { + Destroy(this.gameObject); + print("WARNING un type d'asteroide n'est pas defini dans les prefab. Vérifier l'objet avec un component AsteroidSpawner"); + return; + } + AsteroidPrefabTypes.Add(AsteroidPrefab1); + AsteroidPrefabTypes.Add(AsteroidPrefab2); + AsteroidPrefabTypes.Add(AsteroidPrefab3); + AsteroidPrefabTypes.Add(AsteroidPrefab4); + + + if (GenerationVersLesjoueurs) NextSpawnTime = 3 * NextSpawnTime; + this.SetTimer(NextSpawnTime, SpawnAsteroidEvent); + this.StartTimer(); + } + + // Update is called once per frame + public void Update () { + base.Update(); + } + + public void SpawnAsteroidEvent() + { + if (!GenerationVersLesjoueurs) + { + // Random entre 10 et 20, * 1 ou -1 + var x = UnityEngine.Random.Range(10.0f, 20.0f)*(Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f))*2 - 1); + var y = UnityEngine.Random.Range(10.0f, 20.0f)*(Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f))*2 - 1); + + + //0-3 + var AsteroidType = Mathf.RoundToInt(Mathf.Floor(UnityEngine.Random.Range(0f, 3.999f))); + + //instantiate as child of AsteroidSpawner + var a = Instantiate(AsteroidPrefabTypes[AsteroidType], new Vector3(x, y, 0.0f), Quaternion.identity); + //a.tranform.parent = this.transform; + + } + else + { + var players = GameObject.FindGameObjectsWithTag("Player"); + var planet = FindObjectOfType(); + foreach (var p in players) + { + var playerTheta = Mathf.Atan2(p.transform.position.y, p.transform.position.x); + var angle = ( 360.0f + (((playerTheta * 180)) / Mathf.PI)) % 360; ///TODO : a changer pour p.theta + //print("angle:" + angle); + var AsteroidType = Mathf.RoundToInt(Mathf.Floor(UnityEngine.Random.Range(0f, 3.999f))); - float direction = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); - - Instantiate(AsteroidPrefabTypes[AsteroidType], - direction*planet.GetPlanetCoordinatesFromPlayerXY(angle, UnityEngine.Random.Range(10f,15f)), - Quaternion.identity); - } - - } - - - //Cooldown untill next random spawn - SetTimer(NextSpawnTime, SpawnAsteroidEvent); - StartTimer(); - } -} + float direction = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); + + Instantiate(AsteroidPrefabTypes[AsteroidType], + direction*planet.GetPlanetCoordinatesFromPlayerXY(angle, UnityEngine.Random.Range(10f,15f)), + Quaternion.identity); + } + + } + + + //Cooldown untill next random spawn + SetTimer(NextSpawnTime, SpawnAsteroidEvent); + StartTimer(); + } +} diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 499aa62..e7fa360 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -104,6 +104,48 @@ MonoBehaviour: WalkAnimSpeed: 0 WalkAnimAngle: 0 EjectSpinSpeed: 0 +--- !u!1001 &595727044 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalPosition.x + value: 8.22 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalPosition.y + value: 1.36 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} + m_IsPrefabParent: 0 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, From c0c7600e33162ebeefb793eae9db72aed7c1bc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 23:48:56 -0400 Subject: [PATCH 09/12] =?UTF-8?q?Ajout=20des=20explosions=20aux=20autres?= =?UTF-8?q?=20ast=C3=A9roides?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefabs/Asteroid_2.prefab | 5 +++++ Assets/Prefabs/Asteroid_3.prefab | 7 ++++++- Assets/Prefabs/Asteroid_4.prefab | 7 ++++++- Assets/Prefabs/P_Explosion.prefab | 6 +++--- Assets/Scripts/Asteroid.cs | 6 ++++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/Asteroid_2.prefab b/Assets/Prefabs/Asteroid_2.prefab index 1c0c354..ff6f54b 100644 --- a/Assets/Prefabs/Asteroid_2.prefab +++ b/Assets/Prefabs/Asteroid_2.prefab @@ -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 diff --git a/Assets/Prefabs/Asteroid_3.prefab b/Assets/Prefabs/Asteroid_3.prefab index 86f96dc..845b654 100644 --- a/Assets/Prefabs/Asteroid_3.prefab +++ b/Assets/Prefabs/Asteroid_3.prefab @@ -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 diff --git a/Assets/Prefabs/Asteroid_4.prefab b/Assets/Prefabs/Asteroid_4.prefab index 25ac131..88b5aa6 100644 --- a/Assets/Prefabs/Asteroid_4.prefab +++ b/Assets/Prefabs/Asteroid_4.prefab @@ -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 diff --git a/Assets/Prefabs/P_Explosion.prefab b/Assets/Prefabs/P_Explosion.prefab index 6d68b20..d861656 100644 --- a/Assets/Prefabs/P_Explosion.prefab +++ b/Assets/Prefabs/P_Explosion.prefab @@ -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} diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index e26761d..d65329d 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -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().Play(true); } Destroy(this.gameObject); From 2be41bbd147442ef516f105cbeb3c3e60ce0537e Mon Sep 17 00:00:00 2001 From: Thibault Stones Date: Sat, 9 Apr 2016 00:17:57 -0400 Subject: [PATCH 10/12] A - Added particleSystem destined to the Dash Impact Effect. --- Assets/Prefabs/P_DashImpact.prefab | 1572 +++++++++++++++++++++++ Assets/Prefabs/P_DashImpact.prefab.meta | 8 + 2 files changed, 1580 insertions(+) create mode 100644 Assets/Prefabs/P_DashImpact.prefab create mode 100644 Assets/Prefabs/P_DashImpact.prefab.meta diff --git a/Assets/Prefabs/P_DashImpact.prefab b/Assets/Prefabs/P_DashImpact.prefab new file mode 100644 index 0000000..eea93a7 --- /dev/null +++ b/Assets/Prefabs/P_DashImpact.prefab @@ -0,0 +1,1572 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &138982 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 422702} + - 198: {fileID: 19815948} + - 199: {fileID: 19947904} + m_Layer: 0 + m_Name: P_DashImpact + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &422702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 138982} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 4.32, y: -0.92, z: 0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!198 &19815948 +ParticleSystem: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 138982} + serializedVersion: 2 + lengthInSec: 0.75 + startDelay: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + speed: 1 + randomSeed: 0 + looping: 1 + prewarm: 0 + playOnAwake: 1 + moveWithTransform: 1 + scalingMode: 1 + InitialModule: + serializedVersion: 2 + enabled: 1 + startLifetime: + scalar: 0.5 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startSpeed: + scalar: 0.45 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startColor: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 0 + startSize: + scalar: 0.5 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startRotationX: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startRotationY: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + startRotation: + scalar: 6.283185 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minMaxState: 3 + randomizeRotationDirection: 0 + gravityModifier: 0 + maxNumParticles: 16 + rotation3D: 0 + ShapeModule: + serializedVersion: 2 + enabled: 1 + type: 2 + radius: 0.01 + angle: 20 + length: 5 + boxX: 1 + boxY: 1 + boxZ: 1 + arc: 360 + placementMode: 0 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + randomDirection: 0 + EmissionModule: + enabled: 1 + serializedVersion: 2 + m_Type: 0 + rate: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + cnt0: 30 + cnt1: 30 + cnt2: 30 + cnt3: 30 + cntmax0: 30 + cntmax1: 30 + cntmax2: 30 + cntmax3: 30 + time0: 0 + time1: 0 + time2: 0 + time3: 0 + m_BurstCount: 1 + SizeModule: + enabled: 1 + curve: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0.6089386 + inSlope: -0.0000011523595 + outSlope: -0.0000011523595 + tangentMode: 0 + - time: 0.70159143 + value: 0.17473963 + inSlope: -2.580285 + outSlope: -2.580285 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: -0.2995969 + outSlope: -0.2995969 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 1 + RotationModule: + enabled: 1 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + curve: + scalar: 0.7853981 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxes: 0 + ColorModule: + enabled: 0 + gradient: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 1 + UVModule: + enabled: 0 + frameOverTime: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minMaxState: 1 + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + randomRow: 1 + VelocityModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + ForceModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + enabled: 0 + multiplier: 1 + ClampVelocityModule: + enabled: 0 + x: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + z: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + magnitude: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxis: 0 + inWorldSpace: 0 + dampen: 1 + SizeBySpeedModule: + enabled: 0 + curve: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 1 + range: {x: 0, y: 1} + RotationBySpeedModule: + enabled: 0 + x: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + y: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + curve: + scalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + maxGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + key0: + serializedVersion: 2 + rgba: 4294967295 + key1: + serializedVersion: 2 + rgba: 4294967295 + key2: + serializedVersion: 2 + rgba: 0 + key3: + serializedVersion: 2 + rgba: 0 + key4: + serializedVersion: 2 + rgba: 0 + key5: + serializedVersion: 2 + rgba: 0 + key6: + serializedVersion: 2 + rgba: 0 + key7: + serializedVersion: 2 + rgba: 0 + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minColor: + serializedVersion: 2 + rgba: 4294967295 + maxColor: + serializedVersion: 2 + rgba: 4294967295 + minMaxState: 1 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 2 + type: 0 + collisionMode: 0 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + m_Bounce: + scalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + m_EnergyLossOnCollision: + scalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + 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 + minMaxState: 0 + minKillSpeed: 0 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 1 + SubModule: + enabled: 0 + subEmitterBirth: {fileID: 0} + subEmitterBirth1: {fileID: 0} + subEmitterCollision: {fileID: 0} + subEmitterCollision1: {fileID: 0} + subEmitterDeath: {fileID: 0} + subEmitterDeath1: {fileID: 0} +--- !u!199 &19947904 +ParticleSystemRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 138982} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 2100000, guid: c7d0e59685de7d7449e84875524fa9c2, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_RenderMode: 0 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 138982} + m_IsPrefabParent: 1 diff --git a/Assets/Prefabs/P_DashImpact.prefab.meta b/Assets/Prefabs/P_DashImpact.prefab.meta new file mode 100644 index 0000000..1658ccf --- /dev/null +++ b/Assets/Prefabs/P_DashImpact.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6233079c5a9a756458811f283fdca112 +timeCreated: 1460171282 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 3a7d1de39fa0b23d1a917725ad5a4909cf30d198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Sat, 9 Apr 2016 00:34:00 -0400 Subject: [PATCH 11/12] Ejection de l'astronaute sur impact plaque et si atteint le maximum hauteur et toujours au sol.. --- Assets/Prefabs/P_Explosion.prefab | 8 +++--- Assets/Scripts/Astronaut.cs | 18 ++++++++++-- Assets/Scripts/PlanetManager.cs | 21 ++++++++++++-- Assets/_Scenes/Main.unity | 46 +++---------------------------- 4 files changed, 42 insertions(+), 51 deletions(-) diff --git a/Assets/Prefabs/P_Explosion.prefab b/Assets/Prefabs/P_Explosion.prefab index d861656..fb2fc0b 100644 --- a/Assets/Prefabs/P_Explosion.prefab +++ b/Assets/Prefabs/P_Explosion.prefab @@ -36,7 +36,7 @@ ParticleSystem: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 120238} serializedVersion: 2 - lengthInSec: 3 + lengthInSec: 0.75 startDelay: scalar: 0 maxCurve: @@ -83,7 +83,7 @@ ParticleSystem: serializedVersion: 2 enabled: 1 startLifetime: - scalar: 3 + scalar: 0.75 maxCurve: serializedVersion: 2 m_Curve: @@ -237,7 +237,7 @@ ParticleSystem: rgba: 4294967295 minMaxState: 0 startSize: - scalar: 1 + scalar: 0.5 maxCurve: serializedVersion: 2 m_Curve: @@ -359,7 +359,7 @@ ParticleSystem: length: 5 boxX: 1 boxY: 1 - boxZ: 35.55 + boxZ: 1 arc: 360 placementMode: 0 m_Mesh: {fileID: 0} diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 89de1c7..0eb37b1 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -61,13 +61,23 @@ public class Astronaut : MonoBehaviour { private float theta = 0; private float height = 0; - private float vSpeed = 0; + public float vSpeed = 0; private bool grounded = false; private float walkTime = 0; private int nextStep = 1; - // Use this for initialization + public float GetTheta() + { + return theta; + } + + public bool IsGrounded() + { + return grounded; + } + + // Use this for initialization void Start() { _astronautAnimator = GetComponent(); @@ -142,9 +152,10 @@ public class Astronaut : MonoBehaviour { if (State == AstronautState.Jumping) State = AstronautState.Idle; - vSpeed = 0f; + if (State < AstronautState.Ejecting) vSpeed = 0f; } + UpdatePosition(); //float x, y; @@ -224,6 +235,7 @@ public class Astronaut : MonoBehaviour { //TODO arreter mouvement lateral State=AstronautState.Idle; } + } public void Jump() diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 4d560f8..607a232 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -33,6 +33,7 @@ public class PlanetManager : MonoBehaviour var obj = Instantiate(WedgePrefab, new Vector3(0.0f,0.0f, 0.0f), Quaternion.Euler(0, 0, debutAngleTheta)); obj.name = "wedge_" + i; w.sprite = GameObject.Find(obj.name); + w.gameObject = (GameObject)obj; wedges.Add(w); //pushes at end. } } @@ -99,9 +100,25 @@ public class PlanetManager : MonoBehaviour var v = wedges[indexOppose]; v.offset = v.offset + CartierStepSize; - if (v.offset > CartierMaxRatio) + if (v.offset >= CartierMaxRatio) + { v.offset = CartierMaxRatio; + + //checker si on éjecte des players + var players = FindObjectsOfType(); + foreach (var p in players) + { + if (v.tMax >= p.GetTheta() && p.GetTheta() >= v.tMin && p.IsGrounded()) + { + p.Eject(); + } + } + + + } + + v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); // call fill gauge after every hit. @@ -233,6 +250,6 @@ public class PlanetManager : MonoBehaviour public float tMax = 0; public GameObject sprite; //sprite et collider 2D - + public GameObject gameObject; //wedge prefab avec collider } } diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index e7fa360..296f6ee 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -104,48 +104,6 @@ MonoBehaviour: WalkAnimSpeed: 0 WalkAnimAngle: 0 EjectSpinSpeed: 0 ---- !u!1001 &595727044 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalPosition.x - value: 8.22 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalPosition.y - value: 1.36 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 494682, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: cc1a204562630cd40a1dd685b5ed8e6e, type: 2} - m_IsPrefabParent: 0 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, @@ -367,6 +325,10 @@ Prefab: propertyPath: SpriteWalk value: objectReference: {fileID: 1106066633} + - target: {fileID: 11494368, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} + propertyPath: EjectSpeed + value: 50 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_IsPrefabParent: 0 From 00a6812a96bd91b3d66d48dcf515b4768eaadb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Sat, 9 Apr 2016 00:40:52 -0400 Subject: [PATCH 12/12] =?UTF-8?q?remis=20vSpeed=20priv=C3=A9e=20=20apr?= =?UTF-8?q?=C3=A8s=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Astronaut.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 0eb37b1..f51e846 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -61,7 +61,7 @@ public class Astronaut : MonoBehaviour { private float theta = 0; private float height = 0; - public float vSpeed = 0; + private float vSpeed = 0; private bool grounded = false; private float walkTime = 0;