void Start() { // find scripts sampleInfo_JSONParsed = GameObject.Find("loadJSON_fromMax").GetComponent <LoadJSON_FromMax>().sampleInfo_JSONParsed; globalEvolution_script = GameObject.Find("globalEvolution").GetComponent <GlobalEvolution>(); oscOutScript = GameObject.Find("osc").GetComponent <OscOut>(); cameraExplorerParent_script = GameObject.Find("camera_explorer_parent").GetComponent <CameraExplorerParent_Movement>(); voidsAllInfo_script = GameObject.Find("voidsAllInfo").GetComponent <VoidsAllInfo>(); // init new() shit mixer = new Mixer(); void_static_onOffCn = new OnOff_Cn(); void_static_onOffTracker = new OnOffTracker(); void_upsideDownReveal_onOffCn = new OnOff_Cn(); void_upsideDownReveal_onOffTracker = new OnOffTrackerWeighted(); // evolution and mixer globalEvolutionState = GlobalEvolution.GlobalEvolutionState.begin; EvolutionParams(); MixerValues_Init(); // get the methods goin' New_Qbit_Qtype1_Transposition(); New_Qbit_Brownian_State(); // init Prevs // json data void_upsideDownReveal_prerecorded_brownianBufferDur = sampleInfo_JSONParsed["upsideDownReveal/1/duration"]; // start over for Methods() start = false; }
// return type OnOff_Cn public OnOff_Cn Return_OnOff_Cn(bool init_on, Vector2 onDurRange_shorter, Vector2 onDurRange_longer, float prob_onLonger, Vector2 offDurRange_shorter, Vector2 offDurRange_longer, float prob_offLonger, float fadeDur) { if (_onClick == true) { _onClick = false; } if (_offClick == true) { _offClick = false; } if (init == true) { New_OffDurRange(prob_offLonger, offDurRange_longer, offDurRange_shorter); New_Off(offDurRange); init = false; } eventDeltaTime = Time.time - eventStartTime; if (eventDeltaTime > eventDur) { if (_on == true) { New_OffDurRange(prob_offLonger, offDurRange_longer, offDurRange_shorter); New_Off(offDurRange); } else { New_OnDurRange(prob_onLonger, onDurRange_longer, onDurRange_shorter); New_On(onDurRange); } } if (eventDeltaTime >= eventDur - fadeDur && _on == true) { float timeRemaining = eventDur - eventDeltaTime; float timeRemainingProgress = fadeDur - timeRemaining; _fadeOutPhase = timeRemainingProgress / fadeDur; } else { _fadeOutPhase = 0f; } onOff_cn = new OnOff_Cn { on = _on, onClick = _onClick, offClick = _offClick, fadeOutPhase = _fadeOutPhase, onDur = _onDur, offDur = _offDur }; return(onOff_cn); }
//*********************** void Void_UpsideDownReveal_OnOff() { // here's a nice coordination between OnOffTrackerWeighted and GrowAndFade // we get the onDur and divide it into the proportions we want for grow, stay, and fade void_upsideDownReveal_onOffCn = void_upsideDownReveal_onOffTracker.Return_OnOff_Cn(void_upsideDownReveal_initOn, mx_void_upsideDownReveal_on_shorter_durRange, mx_void_upsideDownReveal_on_longer_durRange, mx_void_upsideDownReveal_prob_onLonger, mx_void_upsideDownReveal_off_shorter_durRange, mx_void_upsideDownReveal_off_longer_durRange, mx_void_upsideDownReveal_prob_offLonger, 1f); void_upsideDownReveal_on = void_upsideDownReveal_onOffCn.on; if (void_upsideDownReveal_on == true) { if (void_upsideDownReveal_onOffCn.onClick == true) { void_upsideDownReveal_eventOnDur = void_upsideDownReveal_onOffCn.onDur; void_upsideDownReveal_growAndFade = new GrowAndFade(); // just make sure all adds to 1. void_upsideDownReveal_growDur = void_upsideDownReveal_eventOnDur * .35f; void_upsideDownReveal_stayDur = void_upsideDownReveal_eventOnDur * .15f; void_upsideDownReveal_fadeDur = void_upsideDownReveal_eventOnDur * .5f; void_upsideDownReveal_prerecorded_playPos = Random.Range(0, void_upsideDownReveal_prerecorded_brownianBufferDur); void_upsideDownReveal_transp = Random.Range(mx_void_upsideDownReveal_transpRange[0], mx_void_upsideDownReveal_transpRange[1]); } void_upsideDownReveal_ampLocal = void_upsideDownReveal_growAndFade.ReturnCurrentValue(false, false, new Vector2(.7f, 1f), Vector2.one * 0, Vector2.one * void_upsideDownReveal_growDur, Vector2.one * void_upsideDownReveal_fadeDur, Vector2.one * void_upsideDownReveal_stayDur, Vector2.one * 0f); } }
//*********************** void Void_Static_OnOff() { void_static_onOffCn = void_static_onOffTracker.Return_OnOff_Cn(void_static_initOn, mx_void_static_onDurRange, mx_void_static_offDurRange, 1f); //<--- we don't care bout fadeOut - just give it any dur void_static_on = void_static_onOffCn.on; }