1 using System.Collections;
2 using System.Collections.Generic;
7 [RequireComponent(typeof(ParticleSystem))]
13 public GameObject cameraBoom;
14 public float spinRate = 0.2f;
16 public Text slideLabel;
18 private float nextSlideTime;
20 private int currentSlide = 0;
22 private List<ChaosEqn> eqns;
23 private string[] eqnNames;
26 private ParticleSystem particleSys;
28 private Quaternion initialRotation;
30 public float speedTrim = 1.0f;
34 nextSlideTime = Time.time +
timer;
36 maxSlide = eqns.Count;
37 eqnNames =
new string[maxSlide];
40 eqnNames[index] = eqn.
GetName();
43 chaoticParticles = GetComponent<ChaoticParticles>();
45 slideLabel.text = eqnNames[currentSlide];
46 chaoticParticles.
timeZoom = eqns[currentSlide].GetSlideshowSpeed()*speedTrim;
47 chaoticParticles.Init();
48 particleSys = GetComponent<ParticleSystem>();
50 initialRotation = transform.rotation;
56 if (Time.time > nextSlideTime) {
57 nextSlideTime = Time.time +
timer;
61 if (Time.time < (nextSlideTime - timer/2f)) {
62 cameraBoom.transform.rotation *= Quaternion.AngleAxis( spinRate, Vector3.up);
64 cameraBoom.transform.rotation *= Quaternion.AngleAxis( spinRate, Vector3.right);
69 if (Input.GetKeyUp(KeyCode.N)) {
71 }
else if (Input.GetKeyUp(KeyCode.P)) {
77 private void NextSlide(
bool advance) {
80 if (currentSlide >= maxSlide) {
85 if (currentSlide < 0) {
86 currentSlide = maxSlide-1;
89 Debug.Log(eqnNames[currentSlide]);
91 slideLabel.text = eqnNames[currentSlide];
97 transform.position = Vector3.zero;
98 cameraBoom.transform.rotation = initialRotation;
99 chaoticParticles.
timeZoom = eqns[currentSlide].GetSlideshowSpeed()*speedTrim;
100 chaoticParticles.Init();
int timer
Time interval to show each system for.
int selectedEqn
Number of chaos system to evolve (w.r.t. ChaosFactory list)
float timeZoom
Time scale (>0)
Chaos eqn. Base class for all equations that define a 3D chaotic system.
static List< ChaosEqn > GetEquations()
Returns a List of Equation objects. A singleton reference list is provided for the inspector script t...
string GetName()
Gets the name.