/// <summary> /// Create the ChaosEqn implementation for the specified index in the eqnList, with the /// selected param bundle in place /// </summary> /// <param name="index">Index.</param> public static ChaosEqn Create(int index, int paramIndex, ParamBundle customParams) { ChaosEqn chaosEqn = System.Activator.CreateInstance(eqnClasses[index]) as ChaosEqn; ParamBundle[] paramBundles = chaosEqn.GetParamBundles(); if (paramIndex < paramBundles.Length) { chaosEqn.paramBundle = paramBundles[paramIndex]; } else { chaosEqn.paramBundle = customParams; } chaosEqn.SetParams(chaosEqn.paramBundle); return(chaosEqn); }
/// <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(); }
public override void Init() { chaosEqn = ChaosEqnFactory.Create(selectedEqn, selectedParams, customParams); initialPosition = transform.position; TimeInit(); }