// Use this for initialization void Start() { pc = points.GetComponent <pointCounter>(); rb = GetComponent <Rigidbody> (); rb.collisionDetectionMode = CollisionDetectionMode.Continuous; playerHealth = player.GetComponent <PlayerHealth>(); }
// Update is called once per frame void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { if (!used) { pointCounter Playerpoints = GameObject.Find("Canvas").GetComponent <pointCounter>(); Playerpoints.pointcount += 600; used = true; Destroy(this.gameObject); } } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { if (!used) { playSound(); print("pu"); pointCounter Playerpoints = GameObject.Find("Points").GetComponent <pointCounter>(); Playerpoints.pointcount += 300; used = true; GameObject.Find("feedDisplay").GetComponent <feedDisplayScript>().display("+300 points"); Destroy(this.gameObject); } } }
void saveScore() { pointCounter p = gameObject.GetComponent <pointCounter>(); PlayerPrefs.SetInt("SumaOfPt", PlayerPrefs.GetInt("SumaOfPt", 0) + p.point); }
// Use this for initialization void Start() { tt = GetComponent <Text> (); pc = GameObject.Find("Points").GetComponent <pointCounter>(); }