IEnumerator Execute() { inputActions.SetListener(inputListener); camera.Priority = 100; yield return(new WaitForSeconds(delayBeforeTrigger)); trigger?.Invoke(); yield return(new WaitForSeconds(delayBeforeRelease)); camera.Priority = 0; inputActions.SetListener(null); }
IEnumerator Success(Action <bool> callback, bool focusCamera) { if (focusCamera) { camera.Priority = 100; } radio.SwitchPower(); float length = engineStartSound.clip.length; engineStartSound.Play(); engineLoopSound.PlayDelayed(length); inputActions.SetListener(this); yield return(new WaitForSeconds(0.3f)); SetTexture(successTextures[0]); yield return(new WaitForSeconds(1f)); for (int i = 1; i < 5; i++) { for (int j = 0; j < 2; j++) { SetTexture(successTextures[i]); yield return(new WaitForSeconds(0.4f)); bipSound.Play(); SetTexture(blinkOffTexture); yield return(new WaitForSeconds(0.4f)); } } SetTexture(successTextures[5]); yield return(new WaitForSeconds(3f)); SetTexture(successTextures[6]); yield return(new WaitForSeconds(3f)); SetTexture(successTextures[7]); yield return(new WaitForSeconds(3f)); SetTexture(successTextures[8]); endingSound.Play(); yield return(new WaitForSeconds(0.2f)); callback.Invoke(true); }
public override void OnDown(Vector3 hitPoint) { inputActions.SetListener(inputListener); grabbable = cameraMovement.GetGrabbable(); iTween.MoveTo(grabbable.gameObject, iTween.Hash("position", contactPosition.position, "easeType", "linear", "time", .5, "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); iTween.RotateTo(grabbable.gameObject, iTween.Hash("rotation", contactPosition.eulerAngles, "easeType", "linear", "time", .3)); }
public virtual void Focus(Action onBack) { inputActionsManager.SetListener(this); this.onBack = onBack; isActive = true; }
private void Start() { inputActionsManager.SetListener(this); mainMonitor.StartScreen(); }