void Start() { playerBehaviour = player.GetComponent <PlayerBehaviour>(); //stimulusScript = GameObject.Find("Stimulus").GetComponent<StimulusScript>(); microphoneController = GetComponent <MicTools.MicrophoneController>(); microphoneInput = GetComponent <MicTools.MicrophoneInput>(); microphoneController.microphoneActive = true; AddRunway(3f); }
private bool _doFFT; // set to true when all is initialised. That way, no need for an expensive try catch. // Init void Awake() { microphoneController = GetComponent <MicrophoneController>(); arrRe = new float[windowSize]; arrI = new float[windowSize]; window = new float[windowSize]; window = Hanning(window); spectrum = new float[windowSize / 2]; fft = new FFT2(); uint logN = (uint)Math.Log(windowSize, 2); fft.init(logN); _doFFT = true; }
void Awake() { microphoneController = this.GetComponent <MicrophoneController>(); if (FindObjectOfType <EventSystem>() == null) { CreateEventSystem(); } CanvasScaler canvasScaler = GetComponent <CanvasScaler>(); canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; Canvas canvas = GetComponent <Canvas>(); canvas.renderMode = RenderMode.ScreenSpaceOverlay; }
void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; PlayerBehaviour = GameObject.FindObjectOfType <PlayerBehaviour>(); ConversationBehaviour = GameObject.FindObjectOfType <ConversationBehaviour>(); ScoreText = GameObject.Find("ScoreText").GetComponent <Text>(); Score = 0; microphoneController = GetComponent <MicTools.MicrophoneController>(); microphoneInput = GetComponent <MicTools.MicrophoneInput>(); microphoneController.microphoneActive = true; Conversation startConvo = new Conversation(); startConvo.Add(new GamePauseLine(true)); startConvo.Add(new DelegateLine(delegate() { PlayerBehaviour.GravityEnabled = false; PlayerBehaviour.SpeechEnabled = false; StartCoroutine(IntroAnimation()); })); startConvo.Add(new DialogueLine(SpeakerType.Professor, "It works!", 2)); startConvo.Add(new DialogueLine(SpeakerType.Sound, "", 2)); startConvo.Add(new GamePauseLine(false)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Right. See that thing you're holding? Turn that to move left and right.", 4)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Or you can use my new invention, the QWERTY keyboard.", 2)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Use the left and right arrow keys.", 3)); startConvo.Add(new DelegateLine(delegate() { PlayerBehaviour.GravityEnabled = true; })); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Look out! You're falling", 0.2f)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "The flying machine is powered by words. Say something quick!", 0.1f)); startConvo.Add(new DelegateLine(delegate() { PlayerBehaviour.SpeechEnabled = true; })); startConvo.Add(new DialogueLine(SpeakerType.Sound, "Doc: The flying machine is powered by words. Say something quick!", 2f)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "My patented phono-motor converts speech into motion.", 2f)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "The more ridiculous a phrase, the more thrust the phono-motor can generate.", 2f)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Don't worry! I compiled a dictionary of ridiculous phrases for just such an occasion!", 2f)); startConvo.Add(new DialogueLine(SpeakerType.Professor, "Now where did I put it?...", 1.5f)); startConvo.Add(new DelegateLine(delegate() { CreateBlueprints(); })); startConvo.Add(new DialogueLine(SpeakerType.Sound, " ", 1f)); startConvo.Add(new DelegateLine(delegate() { ConversationBehaviour.StartConversation(new RandomSuggestionConversation()); })); ConversationBehaviour.StartConversation(startConvo); }
void Awake() { microphoneController = GetComponent <MicrophoneController>(); }