public void increaseScore() { if (this.isDamage) { damageCountdown tmpObj = this.damageCountdown.GetComponent(typeof(damageCountdown)) as damageCountdown; //Debug.Log("decrease pts ..."); tmpObj.decreaseLife(); } else { scoreDisplay tmpObj = this.scoreUpdater.GetComponent(typeof(scoreDisplay)) as scoreDisplay; tmpObj.addScore(this.ptsToIncrease); } }
private void OnTriggerEnter2D(Collider2D other) { if (this.originTag == other.gameObject.tag) { //Debug.Log("No dejes que nos lleve el diablo amor .."+ this.originTag +".."+other.gameObject.tag); //cuando veo atravez del humo me voy volando y tu eres mi guia .... } else { if (this.isDamage) { // Debug.Log("Checking Damage .."+this.scoreManagerTag +".."+other.gameObject.tag); if (other.gameObject.CompareTag(this.scoreManagerTag)) { // Debug.Log("The Other .."+this.scoreManagerTag); this.increaseScore(); damageCountdown tmpObj = this.damageCountdown.GetComponent(typeof(damageCountdown)) as damageCountdown; if (tmpObj.remainingLife < 0) { GameObject e = Instantiate(this.explosion) as GameObject; e.transform.position = transform.position; Destroy(other.gameObject); Destroy(this.gameObject);//f*****g destroy //POPUP RESTART HERE //post username and points to firebase //get top ten scores //legend pointing to restart } else { GameObject e = Instantiate(this.roundHit) as GameObject; e.transform.position = other.gameObject.transform.position; Destroy(this.gameObject);//f*****g destroy } } } else { GameObject e = Instantiate(this.explosion) as GameObject; e.transform.position = transform.position; Destroy(other.gameObject); Destroy(this.gameObject);//f*****g destroy this.increaseScore(); } } }