Exemplo n.º 1
0
	protected override void Start() {

		base.Start ();

		_beatSync = GetComponent<BeatSynchronizer>();
		_beatCounter = GetComponent<BeatCounter>();
		_beatObserver = GetComponent<BeatObserver>();

		_beatSync.enabled = false;
		_boss.gameObject.SetActive(false);

		_tilesSource  = new MisObjectPool (_platforms[(int)PLATFORMS.BREAKABLE], 300, transform);
		_tilesSource.ExecActionInObjects (InitTile);

		_enemiesSource  = new MisObjectPool (_enemies[(int)ENEMIES.MINION], 50, transform);
		_enemiesSource.ExecActionInObjects (InitEnemy);

		_tilesAdded    = new List<GameObject> ();
		_tilesToDelete = new List<GameObject> ();
		_collidebleTiles = new Dictionary <Vector2, GameObject> ();

		_noiseGenerator = new PerlinNoise (0);

		_lenght = (int)(_beatCounter.audioSource.clip.length * 8f);
		_lenght += FST_SECTION + SND_SECTION + FST_JMP_SIZE;

		_spectrum = new float[SONG_SAMPLE_SIZE];
	}
Exemplo n.º 2
0
	// Use this for initialization
	void Awake () {
    counters = GetComponents<BeatCounter>();
    beatConstants = GetComponent<BeatConstants>();
    currentAudioSource = GetComponent<AudioSource>();
    beatSynchronizer = GetComponent<BeatSynchronizer>();
    //StartCoroutine(wait_and_go());
  }
Exemplo n.º 3
0
	void Start () {
//		beatObserver = GetComponent<BeatObserver>();
		syncronizer = GameObject.Find("AudioManager").GetComponent<BeatSynchronizer>();
		syncAudioSrc = GameObject.Find("AudioManager").GetComponent<AudioSource>();
//		counter = GameObject.Find("AudioManager").GetComponent<BeatCounter>();
		levelGenerator = GameObject.Find("LevelGenerator").GetComponent<LevelGenerator>();


	}
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        trackView.SetActive(false);

        audioSource      = songHolder.GetComponent <AudioSource>();
        beatSynchroniser = songHolder.GetComponent <BeatSynchronizer>();
        beatCounter      = songHolder.GetComponent <BeatCounter>();

        FileBrowser.SetFilters(true, new FileBrowser.Filter("Json", ".json"), new FileBrowser.Filter("Sound Files", ".wav", ".ogg"));
    }
Exemplo n.º 5
0
 public void selectSource(int index) {
   counters = GetComponents<BeatCounter>();
   beatConstants = GetComponent<BeatConstants>();
   currentAudioSource = GetComponent<AudioSource>();
   beatSynchronizer = GetComponent<BeatSynchronizer>();
   BeatConstants.BeatElement e = beatConstants.clips[index];
   currentAudioSource.clip = e.clip;
   beatSynchronizer.currentIndex = index;
   beatSynchronizer.bpm = e.bpm;
   beatSynchronizer.startDelay = e.startDelay;
   beatSynchronizer.volumeSmall = e.volumeSmall;
   beatSynchronizer.volumeBig = e.volumeBig;
   beatSynchronizer.enabled = false;
   beatSynchronizer.enabled = true;
   foreach (BeatCounter counter in counters) {
     counter.init();
   }
   //currentPitchModifier = 0.0f;
 }
Exemplo n.º 6
0
 void Awake()
 {
     synchronizer = GameObject.Find ("Main Camera").GetComponent<BeatSynchronizer> ();
     levelRunner = gameObject.GetComponent<LevelRunner> ();
 }
//	  OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
	override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
		
		stepWidth = animator.GetFloat("stepWidth");
		syncronizer = GameObject.Find("AudioManager").GetComponent<BeatSynchronizer>();
	}
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     beatSynch    = GetComponent <BeatSynchronizer>();
     beatObserver = beatBar.GetComponent <BeatObserver>();
 }