protected virtual void Kill() { //Talk to spawn //Debug.Log(type); spawnControl.Spawn(-type); Destroy(this.gameObject); }
void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "Player") { //print("Pega"); if (gp.currentPlatform == null) { gp.currentPlatform = this.gameObject; gp.addMelody(points); audio.clip = ls.sounds [ls.currentSound]; audio.Play(); } else if (this.gameObject != gp.currentPlatform) { Destroy(gp.currentPlatform); gp.currentPlatform = this.gameObject; gp.addMelody(points); spawnMax.up(); spawnMin.up(); spawnObj.Spawn(); audio.clip = ls.sounds [ls.currentSound]; audio.Play(); } } }
protected virtual void Kill() { //Talk to spawn if (scaleDownCount <= scaleDownFrames) { transform.localScale -= new Vector3(0.005f, 0.005f, 0); scaleDownCount++; return; } //Check to see if fire will be lite if (pathFinder.getTerrain(mapX, mapY) == 6) { spawnControl.LightFire(mapX, mapY); } spawnControl.Spawn(-type); Destroy(this.gameObject); life = 0; }