private void ImDead() { float increment = 2; score.AddScore(increment); //float wholeAmount = GameObject.Find("SCOREAMOUNT").transform.position.x; //GameObject.Find("SCOREAMOUNT").transform.position = new Vector3(wholeAmount + increment, 0, 0); //GameObject.Find("SCORE").GetComponent<Text>().text = "SCORE: " + GameObject.Find("SCOREAMOUNT").transform.position.x.ToString(); Destroy(this.gameObject); randomNumber = Random.value; if (randomNumber > 0.9) { Rigidbody wP; wP = Instantiate(weaponPowerup, this.transform.position, this.transform.rotation) as Rigidbody; wP.name = "weaponPowerup"; if (name == "drone1(Clone)") { wP.AddForce(this.transform.forward * 2000); } if (name == "drone2(Clone)") { wP.AddForce(this.transform.forward * -2000); } } if (GameObject.Find("ebName").transform.position.z < GameObject.Find("ebPub").transform.position.z) { GameObject.Find("ebName").transform.Translate(Vector3.down * 4); } }
private void ImDead() { float increment = 1; score.AddScore(increment); //float wholeAmount = GameObject.Find("SCOREAMOUNT").transform.position.x; //GameObject.Find("SCOREAMOUNT").transform.position = new Vector3(wholeAmount + increment, 0, 0); //GameObject.Find("SCORE").GetComponent<Text>().text = "SCORE: " + // GameObject.Find("SCOREAMOUNT").transform.position.x.ToString(); Destroy(this.gameObject); randomNumber = Random.value; if (randomNumber > 0.9) { Rigidbody wP; wP = Instantiate(weaponPowerup, gattlingTransform.position, gattlingTransform.rotation) as Rigidbody; wP.name = "weaponPowerup"; if (name == "gattling1") { wP.AddForce(gattlingTransform.forward * 2000); } if (name == "gattling2") { wP.AddForce(gattlingTransform.forward * -2000); } } }
private void ImDead() { float increment = 20; score.AddScore(increment); //float wholeAmount = GameObject.Find("SCOREAMOUNT").transform.position.x; //GameObject.Find("SCOREAMOUNT").transform.position = new Vector3(wholeAmount + increment, 0, 0); //GameObject.Find("SCORE").GetComponent<Text>().text = "SCORE: " + GameObject.Find("SCOREAMOUNT").transform.position.x.ToString(); Destroy(this.gameObject); if (GameObject.Find("ebName").transform.position.z < GameObject.Find("ebPub").transform.position.z) { GameObject.Find("ebName").transform.Translate(Vector3.down * 4); } }