Пример #1
0
 public SongData(List <AnalysisData> analyses, string name, int length, BeatTracker beatTracker, Segmenter segmenter)
 {
     this.analyses    = analyses;
     this.name        = name;
     this.length      = length;
     this.segmenter   = segmenter;
     this.beatTracker = beatTracker;
 }
Пример #2
0
 private void Start()
 {
     _deltaHeight       = 0;
     _camera            = GetComponent <Camera>();
     _cameraBeatTracker = GetComponent <BeatTracker>();
     _levelManager      = GetComponent <LevelManager>();
     _battleModeTimer   = 0;
 }
Пример #3
0
    void IEnemyInitiator.triggerStart()
    {
        BeatTracker track = attackscript.GetTrack();

        if (track != null)
        {
            BeatScheduler.ScheduleNextMeasure(new StartTrackEvent(track));
        }
    }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        if (beatTracker == null)
        {
            beatTracker = FindObjectOfType <BeatTracker> ();
        }

        if (!gameStarted && Time.time - startTime >= introTime)
        {
            startGame();
        }

        if (!gameStarted && Time.time - startTime >= introTime - 1)
        {
            killAllSpawnables();
        }

        if (!gameStarted)
        {
            startmsgs.transform.Find("Countdown").GetComponent <Text>().text = (introTime - (Time.time - startTime)).ToString();
            Player1.GetComponent <Attackable> ().health = 100;
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                startGame();
            }
        }
        else
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
            }
        }

        if (!foundPlayer)
        {
            curPlayer   = GameObject.FindGameObjectWithTag("Player") as GameObject;
            foundPlayer = true;
            Player1     = curPlayer.GetComponent <Player> ();
//			playerHealthUI = (GameObject)Instantiate (playerHealth);
//			playerHealthUI.transform.SetParent (GameObject.FindObjectOfType<Canvas> ().transform);
//			playerHealthUI.GetComponent<RectTransform> ().anchoredPosition = new Vector2 (0.0f, -60.0f);
        }
        else
        {
//			playerHealthUI.GetComponent<Text>().text = "Player Health: " + curPlayer.GetComponent<Controller2D>().health.ToString ();
        }
//		godPowerUI.GetComponent<Text>().text = "Current Power: " + godCursor.GetComponent<PlayerCursor>().currentPower.ToString ();

        /*
         * if (Input.GetMouseButton (0))
         *      lastMouseButtonPressed = "Left button";
         * if (Input.GetMouseButton (1))
         *      lastMouseButtonPressed = "Right button";
         */
    }
 // Use this for initialization
 protected virtual void Start()
 {
     track = new BeatTracker ();
     assignTrack ();
     audioSource = GetComponent <AudioSource> ();
     anim = GetComponent <Animator> ();
     player = GameObject.FindGameObjectWithTag ("Player");
     GameObject managers = GameObject.FindGameObjectWithTag ("CustomManagers");
     damager = managers.GetComponent<DamageManager> ();
 }
    // Use this for initialization
    protected virtual void Start()
    {
        track = new BeatTracker();
        assignTrack();
        audioSource = GetComponent <AudioSource> ();
        anim        = GetComponent <Animator> ();
        player      = GameObject.FindGameObjectWithTag("Player");
        GameObject managers = GameObject.FindGameObjectWithTag("CustomManagers");

        damager = managers.GetComponent <DamageManager> ();
    }
Пример #7
0
    void IEnemyInitiator.triggerStart()
    {
        GameObject inst = GameObject.Instantiate(spawnPrefab, spawnLocation.position, spawnLocation.rotation) as GameObject;

        if (startTrack)
        {
            AbstractEnemyAttack attackscript = inst.GetComponent <AbstractEnemyAttack> ();
            if (attackscript != null)
            {
                BeatTracker track = attackscript.GetTrack();
                if (track != null)
                {
                    BeatScheduler.ScheduleNextMeasure(new StartTrackEvent(track));
                }
            }
        }
    }
Пример #8
0
    void Init()
    {
        //default analyses.
        analyses = new List <Analysis>();

        _low = new Analysis(0, 30, "low");
        analyses.Add(_low);
        _mid = new Analysis(30, 350, "mid");
        analyses.Add(_mid);
        _high = new Analysis(370, 900, "high");
        analyses.Add(_high);
        _all = new Analysis(0, 350, "all");//560 //350
        analyses.Add(_all);

        beatTracker = new BeatTracker();
        segmenter   = new Segmenter(all);

        songLoaded = false;
    }
Пример #9
0
    void Awake()
    {
        audioSource = GetComponent <AudioSource>();

        if (audioClip != null)
        {
            OnSongChanged();
        }

        analyses = new List <Analysis>();

        _low  = new Analysis(0, 30, "low");     //0hz - 645hz
        _mid  = new Analysis(30, 350, "mid");   //645hz - 7500hz
        _high = new Analysis(370, 900, "high"); //7500hz - 20000hz
        _all  = new Analysis(0, 350, "all");    //0hz - 7500hz

        analyses.Add(_low);
        analyses.Add(_mid);
        analyses.Add(_high);
        analyses.Add(_all);

        beatTracker = new BeatTracker();
        segmenter   = new Segmenter(all);
    }
Пример #10
0
 public override void setTrackDelaysAndStart(float [] delays)
 {
     tracker = new BeatTracker();
     assignTrack(delays);
     tracker.Start();
 }
 public override void setTrackDelaysAndStart(float[] delays)
 {
     tracker = new BeatTracker ();
     assignTrack (delays);
     tracker.Start ();
 }
Пример #12
0
 public StartTrackEvent(BeatTracker track)
 {
     this.track = track;
 }