void Start()
 {
     sp        = GetComponent <Image>();
     sp.color  = color;
     audioPeer = FindObjectOfType <AudioPeer>();
     bluetooth = FindObjectOfType <Bluetooth>();
 }
Example #2
0
    public void StartGame()
    {
        StartCanvas.gameObject.SetActive(false);
        AudioPeer audiopeer = maincam.gameObject.AddComponent <AudioPeer>();

        maincam.gameObject.GetComponent <AudioSource>().Play();
    }
    // Use this for initialization
    void Start()
    {
        audioPeer      = GameObject.FindObjectOfType <AudioPeer>();
        noiseFlowField = GetComponent <NoiseFlowField>();

        audioMaterial = new Material[8];
        color1        = new Color[8];
        color2        = new Color[8];

        for (int i = 0; i < 8; i++)
        {
            color1[i]        = gradient1.Evaluate((1f / 8f) * i);
            color2[i]        = gradient2.Evaluate((1f / 8f) * i);
            audioMaterial[i] = new Material(material);
        }

        int countBand = 0;

        for (int i = 0; i < noiseFlowField.particles.Count; i++)
        {
            band = countBand % 8;
            noiseFlowField.particleMeshRenderer[i].material = audioMaterial[band];
            noiseFlowField.particles[i].audioband           = band;

            countBand++;
        }
    }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     audioPeer       = GameObject.Find("Audio").GetComponent <AudioPeer>();
     startScale      = .5f;
     scaleMultiplier = .5f;
     mr = GetComponentInChildren <MeshRenderer>();
 }
Example #5
0
 private void Start()
 {
     _audioPeer     = GetComponentInChildren <AudioPeer>();
     Time.timeScale = 1;
     _isPaused      = false;
     _gameover      = false;
     _levelWon      = false;
 }
Example #6
0
    private void Update()
    {
        float freqOrBandBuffer = AudioPeer.GetFreqOrBandBuffer(useBufferFreq, band);
        Color color            = new Color(freqOrBandBuffer, freqOrBandBuffer, freqOrBandBuffer);

        _material.SetColor("_EmissionColor", color);

        transform.localScale = new Vector3(transform.localScale.x, (freqOrBandBuffer * scaleMultiplier) + startScale, transform.localScale.z);
    }
 void Start()
 {
     NFF       = GameObject.Find("NoiseFlowField").GetComponent <NoiseFlowField>();
     audioPeer = GameObject.Find("AudioPeer").GetComponent <AudioPeer>();
     AFF       = NFF.GetComponent <AudioFlowField>();
     this.gameObject.GetComponent <MeshRenderer>().material = AFF.audioMaterial[band];
     audioband = band;
     this.transform.rotation = Random.rotation;
 }
Example #8
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < 64; i++)
     {
         GameObject o = Instantiate(flyPrefab, transform);
         o.transform.position = new Vector3(i * Dimensions.x, 0, 0);
         flies[i]             = o;
     }
     audioPeer = GetComponent <AudioPeer>();
 }
 // Use this for initialization
 void Start()
 {
     // wait for the user to tap the screen then spawn all three platforms and start spawning obstacles
     platforms  = new GameObject[3];
     spawnedObs = new List <GameObject>();
     ap         = audioTrack.GetComponent <AudioPeer>();
     gen        = GetComponent <ObstacleGenerator>();
     song       = audioTrack.GetComponent <AudioSource>();
     song.Pause();
 }
Example #10
0
    private void _GetAmplitudeValue()
    {
        float amplitudeOrAmplitudeBuffer = AudioPeer.GetAmplitudeOrBuffer(userBufferAmplitude);
        Color color = new Color(red * amplitudeOrAmplitudeBuffer, green * amplitudeOrAmplitudeBuffer, blue * amplitudeOrAmplitudeBuffer);

        _material.SetColor("_EmissionColor", color);

        float transformScale = (amplitudeOrAmplitudeBuffer * maxScale) + startScale;

        transform.localScale = new Vector3(transformScale, transformScale, transformScale);
    }
Example #11
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != null)
     {
         Destroy(gameObject);
     }
 }
Example #12
0
    // Use this for initialization
    void Awake()
    {
        ap           = this;
        _audioSource = GetComponent <AudioSource>();
        timePlaying  = _audioSource.time;

        //Select random song, not tutorial 0 index
        selectClip_index  = Random.Range(1, album.Count);
        _audioSource.clip = album[selectClip_index].clip;
        bpm = album[selectClip_index].bpm; //menu song

        _audioSource.Play();               //plays menu song
    }
Example #13
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
 void Start()
 {
     AudioSource = GetComponent <AudioSource>();
     AudioProfile(audioProfile);
     if (AudioPeerInstance != null)
     {
         DontDestroyOnLoad(this);
     }
     else
     {
         AudioPeerInstance = this;
     }
     isAudioOn = false;
 }
Example #15
0
    void Start()
    {
        if (!Config.ConfigGeneral())
        {
            return;
        }

        Input.multiTouchEnabled = true;
        cam = Camera.main;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        //startPozitionOnScreen = Screen.height;
        startPozitionOnScreen = Mathf.Round(Screen.height * Config.LYRIC_START_POINT_IN_PERCENT);
        endPozitionOnScreen   = Mathf.Round(Screen.height * Config.LYRIC_END_POINT_IN_PERCENT);
        distanceOnScreen      = startPozitionOnScreen - endPozitionOnScreen;
        float screenQ = Screen.width / 3;

        xPozitions = new float[3];
        //xPozitions[1] = 0;
        xPozitions[0] = Mathf.Round(screenQ / 2);
        xPozitions[1] = Mathf.Round(Screen.width / 2);
        xPozitions[2] = Mathf.Round(screenQ * 3 - screenQ / 2);

        startPositionsInWorld = new Vector3[3];
        //startPositionsInWorld[0] = new Vector3();
        startPositionsInWorld[0] = cam.ScreenToWorldPoint(new Vector3(xPozitions[0], startPozitionOnScreen, screenZ));
        startPositionsInWorld[1] = cam.ScreenToWorldPoint(new Vector3(xPozitions[1], startPozitionOnScreen, screenZ));
        startPositionsInWorld[2] = cam.ScreenToWorldPoint(new Vector3(xPozitions[2], startPozitionOnScreen, screenZ));

        endPositionsOnInWorld = new Vector3[3];
        //endPositionsOnInWorld[0] = new Vector3();
        endPositionsOnInWorld[0] = cam.ScreenToWorldPoint(new Vector3(xPozitions[0], endPozitionOnScreen, screenZ));
        endPositionsOnInWorld[1] = cam.ScreenToWorldPoint(new Vector3(xPozitions[1], endPozitionOnScreen, screenZ));
        endPositionsOnInWorld[2] = cam.ScreenToWorldPoint(new Vector3(xPozitions[2], endPozitionOnScreen, screenZ));

        bottomLine.transform.position = endPositionsOnInWorld[2];

        clickAreas[0].gameObject.transform.position = endPositionsOnInWorld[0];
        clickAreas[1].gameObject.transform.position = endPositionsOnInWorld[1];
        clickAreas[2].gameObject.transform.position = endPositionsOnInWorld[2];

        stageVisualPosition            = cam.ScreenToWorldPoint(new Vector3(Mathf.Round(Screen.width * 0.5f), Mathf.Round(Screen.height * Config.STAGE_VISUAL_POSITION_IN_PERCENT), screenZ));
        stageVisual.transform.position = stageVisualPosition;

        PoolManager.WarmPool(successWordHitFX, 20);

        audioPeer = GetComponent <AudioPeer>();
    }
    public void PlayAudioClip(AudioClip audio)
    {
        if (myAud != audio && myAud != null)
        {
            isTriggered = false;
        }

        if (isTriggered == false)
        {
            AudioPeer aud = GetComponent <AudioPeer>();
            aud._audioClip = audio;
            aud.StartPlaying();
            myAud       = audio;
            isTriggered = true;
        }
    }
Example #17
0
 void Awake()
 {
     main     = this;
     _samples = new float[_numSamples];
     if (_numBands > _numSamples * 0.5f)
     {
         _numBands = (int)(_numSamples * 0.5f);
     }
     _freqBand        = new float[_numBands];
     _bandBuffer      = new float[_numBands];
     _bufferDecrease  = new float[_numBands];
     _freqBandHighest = new float[_numBands];
     _audioBand       = new float[_numBands];
     _audioBandBuffer = new float[_numBands];
     _bars            = new GameObject[_numBands];
     _barMaterials    = new Material[_numBands];
     CreateObjects();
 }
Example #18
0
    // Update is called once per frame
    void Update()
    {
        cast.enabled = false;
        // If left Grip Button is pressed, Spawn ballon
        if (Controller.GetPressDown(SteamVR_Controller.ButtonMask.Grip))
        {
            Debug.Log(gameObject.name + " Grip Press2");
        }
        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Grip))
        {
            Debug.Log(gameObject.name + " Grip Press1");
            Debug.Log("GRIP AUDIO CHANGE" + Controller.GetAxis().x);
            AudioPeer.changeAudio(Controller.GetAxis());
        }
        if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.Grip))
        {
            Debug.Log(gameObject.name + " Grip Release");
            AudioPeer.resetAudio();
        }

        if (Controller.GetAxis() != Vector2.zero)
        {
            Debug.Log(gameObject.name + Controller.GetAxis());
        }


        if (Controller.GetHairTriggerDown())
        {
        }

        if (Controller.GetHairTrigger())
        {
            Debug.Log(gameObject.name + "Press Hold");
            Debug.Log(gameObject.name + Controller.GetAxis());
            laserShow();
        }

        if (Controller.GetHairTriggerUp())
        {
            Debug.Log(gameObject.name + " Trigger Release");
            Teleport();
        }
    }
Example #19
0
    /*
     * NOTE TO SELF:
     * IPV met een static speed te updaten als volume over een bepaalde grens gaat,
     * zet deze grens heel erg laag en map de speed van de box van 0-1. Je moet nu wel
     * een manier verzinnen om vaker van direction te veranderen (bijv bij hoge volume change).
     */
    void Start()
    {
        container = transform.parent.gameObject;

        TrailContainer containerInstance = container.GetComponent <TrailContainer>();

        color           = containerInstance.color;
        trailGradient   = containerInstance.trailGradient;
        audioPeer       = containerInstance.audioPeer;
        bandBufferIndex = containerInstance.bandBufferIndex;

        containerBounds = container.GetComponent <Collider>().bounds;
        meshRenderer    = GetComponent <MeshRenderer>();
        meshRenderer.material.SetColor("_Color", color);
        trailRenderer = GetComponentInChildren <TrailRenderer>();
        //trailRenderer.time = 5f;
        beatCounter = audioPeer.GetComponent <BeatCounter>();
        xyz         = new int[3];

        Color.RGBToHSV(color, out h, out s, out v);

        trailRenderer.colorGradient = trailGradient;
    }
Example #20
0
 // Start is called before the first frame update
 void Start()
 {
     _audioPeer = FindObjectOfType <AudioPeer>();
     _light     = GetComponent <Light>();
 }
Example #21
0
 // Start is called before the first frame update
 void Start()
 {
     audioPeer = GameObject.Find("Audio").GetComponent <AudioPeer>();
     material  = GetComponent <MeshRenderer>().material;
     origGlow  = material.GetColor("_InnerGlowColor");
 }
Example #22
0
 private void Awake()
 {
     Instance = this;
 }
Example #23
0
 // Start is called before the first frame update
 void Start()
 {
     _audioPeer = FindObjectOfType <AudioPeer>();
     _material  = GetComponent <MeshRenderer>().materials[0];
 }
 GameObject obstacle;// an array of different types of obstacles that will come at the player
 // Use this for initialization
 void Start()
 {
     controller = GetComponent <TempleRunController>();
     audioMgr   = GameObject.Find("Audio-Obstacle Listener").GetComponent <AudioPeer>();
 }
Example #25
0
 // Use this for initialization
 void Start()
 {
     peer = GameObject.Find("HUDCanvas").GetComponent <AudioPeer>();
 }
 private void Awake()
 {
     audioPeer = FindObjectOfType <AudioPeer>();
     bluetooth = FindObjectOfType <Bluetooth>();
 }