/// <summary> /// Init the equation using the selected equation and parameter bundle. /// </summary> public override void Init() { x = new float[3]; a_n = new float[3]; b_n = new float[3]; c_n = new float[3]; d_n = new float[3]; arg = new float[3]; chaosEqn = ChaosEqnFactory.Create(selectedEqn, selectedParams, customParams); initialPosition = transform.position; lastTrail = transform.position; StartAt(chaosEqn.paramBundle.initialPosition); // check for a ChaosTrail child chaosTrail = GetComponentInChildren <ChaosTrail>(); paused = false; TimeInit(); }
// Use this for initialization void Start() { nextSlideTime = Time.time + timer; eqns = ChaosEqnFactory.GetEquations(); maxSlide = eqns.Count; eqnNames = new string[maxSlide]; int index = 0; foreach (ChaosEqn eqn in eqns) { eqnNames[index] = eqn.GetName(); index++; } chaoticMotion = GetComponent <ChaoticMotion>(); chaoticMotion.selectedEqn = currentSlide; chaoticMotion.timeZoom = eqns[currentSlide].GetSlideshowSpeed(); slideLabel.text = eqnNames[currentSlide]; chaoticMotion.Init(); // get trail (if present) chaosTrail = GetComponentInChildren <ChaosTrail>(); initialRotation = transform.rotation; }