Пример #1
0
 // Use this for initialization
 void Start()
 {
     pc = points.GetComponent <pointCounter>();
     rb = GetComponent <Rigidbody> ();
     rb.collisionDetectionMode = CollisionDetectionMode.Continuous;
     playerHealth = player.GetComponent <PlayerHealth>();
 }
Пример #2
0
 // 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);
         }
     }
 }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
    void saveScore()
    {
        pointCounter p = gameObject.GetComponent <pointCounter>();

        PlayerPrefs.SetInt("SumaOfPt", PlayerPrefs.GetInt("SumaOfPt", 0) + p.point);
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     tt = GetComponent <Text> ();
     pc = GameObject.Find("Points").GetComponent <pointCounter>();
 }