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];
	}
Example #2
0
	public MisGun(int damage, float speed, float frequency, Texture2D texture, GameObject owner) {

		this.damage    = damage;
		this.speed     = speed;
		this.frequency = frequency;
		this.texture   = texture;
		this.owner     = owner;

		_bulletTemplate = Resources.Load ("Prefabs/Particles/MisBullet") as GameObject;

		this.speed = _bulletTemplate.GetComponent<MisBullet>()._moveSpeed;
		_bullets = new MisObjectPool(_bulletTemplate, 50, null, InitBullet);
	}