Commit 5f639056 authored by 神楽坂玲奈's avatar 神楽坂玲奈

comment out old particles

parent c7864393
...@@ -3,8 +3,8 @@ using System.Collections; ...@@ -3,8 +3,8 @@ using System.Collections;
public class mouseParticle : MonoBehaviour { public class mouseParticle : MonoBehaviour {
public Camera camera; public Camera camera;
public EllipsoidParticleEmitter e1; // public EllipsoidParticleEmitter e1;
public EllipsoidParticleEmitter e2; // public EllipsoidParticleEmitter e2;
public Transform trans; public Transform trans;
// Use this for initialization // Use this for initialization
void Start () { void Start () {
...@@ -28,17 +28,17 @@ public class mouseParticle : MonoBehaviour { ...@@ -28,17 +28,17 @@ public class mouseParticle : MonoBehaviour {
{ {
time = 0.49f; time = 0.49f;
} }
e1.maxEmission = (0.5f - time) * 60f; // e1.maxEmission = (0.5f - time) * 60f;
e1.minEmission = (0.5f - time) * 60f; // e1.minEmission = (0.5f - time) * 60f;
e2.maxEmission = e1.maxEmission / 3f; // e2.maxEmission = e1.maxEmission / 3f;
e2.minEmission = e1.minEmission / 3f; // e2.minEmission = e1.minEmission / 3f;
e1.emit = true; // e1.emit = true;
e2.emit = true; // e2.emit = true;
} }
else else
{ {
e1.emit = false; // e1.emit = false;
e2.emit = false; // e2.emit = false;
} }
} }
} }
...@@ -14,12 +14,12 @@ public class partical_scaler : MonoBehaviour { ...@@ -14,12 +14,12 @@ public class partical_scaler : MonoBehaviour {
public void eltersGo() public void eltersGo()
{ {
var elters = gameObject.GetComponentsInChildren<EllipsoidParticleEmitter>(true); // var elters = gameObject.GetComponentsInChildren<EllipsoidParticleEmitter>(true);
foreach (var p in elters) // foreach (var p in elters)
{ // {
p.maxSize *= scale; // p.maxSize *= scale;
p.minSize *= scale; // p.minSize *= scale;
} // }
} }
// Update is called once per frame // Update is called once per frame
......
...@@ -95,34 +95,34 @@ public class ParticleScaler : MonoBehaviour ...@@ -95,34 +95,34 @@ public class ParticleScaler : MonoBehaviour
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
//get all emitters we need to do scaling on //get all emitters we need to do scaling on
ParticleEmitter[] emitters = GetComponentsInChildren<ParticleEmitter>(); // ParticleEmitter[] emitters = GetComponentsInChildren<ParticleEmitter>();
//
//get all animators we need to do scaling on // //get all animators we need to do scaling on
ParticleAnimator[] animators = GetComponentsInChildren<ParticleAnimator>(); // ParticleAnimator[] animators = GetComponentsInChildren<ParticleAnimator>();
//apply scaling to emitters //apply scaling to emitters
foreach (ParticleEmitter emitter in emitters) // foreach (ParticleEmitter emitter in emitters)
{ // {
emitter.minSize *= scaleFactor; // emitter.minSize *= scaleFactor;
emitter.maxSize *= scaleFactor; // emitter.maxSize *= scaleFactor;
emitter.worldVelocity *= scaleFactor; // emitter.worldVelocity *= scaleFactor;
emitter.localVelocity *= scaleFactor; // emitter.localVelocity *= scaleFactor;
emitter.rndVelocity *= scaleFactor; // emitter.rndVelocity *= scaleFactor;
//
//some variables cannot be accessed through regular script, we will acces them through a serialized object // //some variables cannot be accessed through regular script, we will acces them through a serialized object
SerializedObject so = new SerializedObject(emitter); // SerializedObject so = new SerializedObject(emitter);
//
so.FindProperty("m_Ellipsoid").vector3Value *= scaleFactor; // so.FindProperty("m_Ellipsoid").vector3Value *= scaleFactor;
so.FindProperty("tangentVelocity").vector3Value *= scaleFactor; // so.FindProperty("tangentVelocity").vector3Value *= scaleFactor;
so.ApplyModifiedProperties(); // so.ApplyModifiedProperties();
} // }
//
//apply scaling to animators // //apply scaling to animators
foreach (ParticleAnimator animator in animators) // foreach (ParticleAnimator animator in animators)
{ // {
animator.force *= scaleFactor; // animator.force *= scaleFactor;
animator.rndForce *= scaleFactor; // animator.rndForce *= scaleFactor;
} // }
#endif #endif
} }
......
...@@ -19,21 +19,21 @@ public class fusion_tweener : MonoBehaviour { ...@@ -19,21 +19,21 @@ public class fusion_tweener : MonoBehaviour {
system.gravityModifier *= scaleFactor; system.gravityModifier *= scaleFactor;
} }
//apply scaling to emitters //apply scaling to emitters
foreach (ParticleEmitter emitter in emitters) // foreach (ParticleEmitter emitter in emitters)
{ // {
emitter.minSize *= scaleFactor; // emitter.minSize *= scaleFactor;
emitter.maxSize *= scaleFactor; // emitter.maxSize *= scaleFactor;
emitter.worldVelocity *= scaleFactor; // emitter.worldVelocity *= scaleFactor;
emitter.localVelocity *= scaleFactor; // emitter.localVelocity *= scaleFactor;
emitter.rndVelocity *= scaleFactor; // emitter.rndVelocity *= scaleFactor;
} // }
//
//apply scaling to animators // //apply scaling to animators
foreach (ParticleAnimator animator in animators) // foreach (ParticleAnimator animator in animators)
{ // {
animator.force *= scaleFactor; // animator.force *= scaleFactor;
animator.rndForce *= scaleFactor; // animator.rndForce *= scaleFactor;
} // }
} }
int step = 1; int step = 1;
float scaleFactor = 0.1f; float scaleFactor = 0.1f;
...@@ -82,20 +82,20 @@ public class fusion_tweener : MonoBehaviour { ...@@ -82,20 +82,20 @@ public class fusion_tweener : MonoBehaviour {
system.gravityModifier *= scaleFactor; system.gravityModifier *= scaleFactor;
} }
//apply scaling to emitters //apply scaling to emitters
foreach (ParticleEmitter emitter in emitters) // foreach (ParticleEmitter emitter in emitters)
{ // {
emitter.minSize *= scaleFactor; // emitter.minSize *= scaleFactor;
emitter.maxSize *= scaleFactor; // emitter.maxSize *= scaleFactor;
emitter.worldVelocity *= scaleFactor; // emitter.worldVelocity *= scaleFactor;
emitter.localVelocity *= scaleFactor; // emitter.localVelocity *= scaleFactor;
emitter.rndVelocity *= scaleFactor; // emitter.rndVelocity *= scaleFactor;
} // }
//
//apply scaling to animators // //apply scaling to animators
foreach (ParticleAnimator animator in animators) // foreach (ParticleAnimator animator in animators)
{ // {
animator.force *= scaleFactor; // animator.force *= scaleFactor;
animator.rndForce *= scaleFactor; // animator.rndForce *= scaleFactor;
} // }
} }
} }
...@@ -17,15 +17,15 @@ public class LightningBolt : MonoBehaviour ...@@ -17,15 +17,15 @@ public class LightningBolt : MonoBehaviour
Perlin noise; Perlin noise;
float oneOverZigs; float oneOverZigs;
private Particle[] particles; // private Particle[] particles;
void Start() void Start()
{ {
oneOverZigs = 1f / (float)zigs; oneOverZigs = 1f / (float)zigs;
GetComponent<ParticleEmitter>().emit = false; // GetComponent<ParticleEmitter>().emit = false;
GetComponent<ParticleEmitter>().Emit(zigs); // GetComponent<ParticleEmitter>().Emit(zigs);
particles = GetComponent<ParticleEmitter>().particles; // particles = GetComponent<ParticleEmitter>().particles;
} }
void Update () void Update ()
...@@ -37,27 +37,27 @@ public class LightningBolt : MonoBehaviour ...@@ -37,27 +37,27 @@ public class LightningBolt : MonoBehaviour
float timey = Time.time * speed * 1.21688f; float timey = Time.time * speed * 1.21688f;
float timez = Time.time * speed * 2.5564f; float timez = Time.time * speed * 2.5564f;
for (int i=0; i < particles.Length; i++) // for (int i=0; i < particles.Length; i++)
{ // {
Vector3 position = Vector3.Lerp(transform.position, target.position, oneOverZigs * (float)i); // Vector3 position = Vector3.Lerp(transform.position, target.position, oneOverZigs * (float)i);
Vector3 offset = new Vector3(noise.Noise(timex + position.x, timex + position.y, timex + position.z), // Vector3 offset = new Vector3(noise.Noise(timex + position.x, timex + position.y, timex + position.z),
noise.Noise(timey + position.x, timey + position.y, timey + position.z), // noise.Noise(timey + position.x, timey + position.y, timey + position.z),
noise.Noise(timez + position.x, timez + position.y, timez + position.z)); // noise.Noise(timez + position.x, timez + position.y, timez + position.z));
position += (offset * scale * ((float)i * oneOverZigs)); // position += (offset * scale * ((float)i * oneOverZigs));
//
particles[i].position = position; // particles[i].position = position;
particles[i].color = Color.white; // particles[i].color = Color.white;
particles[i].energy = 1f; // particles[i].energy = 1f;
} // }
//
GetComponent<ParticleEmitter>().particles = particles; // GetComponent<ParticleEmitter>().particles = particles;
//
if (GetComponent<ParticleEmitter>().particleCount >= 2) // if (GetComponent<ParticleEmitter>().particleCount >= 2)
{ // {
if (startLight) // if (startLight)
startLight.transform.position = particles[0].position; // startLight.transform.position = particles[0].position;
if (endLight) // if (endLight)
endLight.transform.position = particles[particles.Length - 1].position; // endLight.transform.position = particles[particles.Length - 1].position;
} // }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment