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

comment out old particles

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