private void Awake()
    {
        //cache the animator component

        animator    = GetComponent <Animator>();
        audioPlayer = GetComponent <audioPlayer>();
    }
    // Start is called before the first frame update
    void Start()
    {
        jacob = GameObject.FindWithTag("Player");

        if (gameObject.GetComponent <audioPlayer>() != null)
        {
            audioPlayer = gameObject.GetComponent <audioPlayer>();
            if (audioPlayer != null)
            {
                audioPlayer.setPitch(1.0f);
            }
        }


        pointsDeVie = pointsDeVieMax;
        myPosition  = new Vector3(0, 0, 0);
        if (this.tag == "Lakes")
        {
            lake = true;
        }
    }
Example #3
0
        private void Play(object sender, RoutedEventArgs e)
        {
            List <musicBar> SortedBarList = barList.OrderBy(o => o.startTime).ToList();

            for (int i = 0; i < 12000; i++)
            {
                List <musicBar> deleteList = new List <musicBar>();
                foreach (musicBar mb in SortedBarList)
                {
                    if (mb.startTime != i)
                    {
                        break;
                    }

                    audioPlayer a      = new audioPlayer();
                    var         thread = new Thread(
                        () => a.playSound(mb));
                    thread.Start();

                    deleteList.Add(mb);
                }

                foreach (musicBar mb in deleteList)
                {
                    SortedBarList.Remove(mb);
                }
                if (SortedBarList.Count == 0)
                {
                    break;
                }

                Thread.Sleep(20);
            }

            // Note,,, wavetype - 1-5,,, length 50 = 1 sek,,, volume 0 - 100,,, vibrato 0 = null vibrato. 12 = holestep vibrato?,,,
            //vibratoinetnsity = how often the vibrato peaks. must be higher for higher frequencies, the higher- the less frequent.
        }