Guest User

Untitled

a guest
Dec 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Collections;
  4. using UnityEngine;
  5.  
  6. public class SolarNrgRecycler : Part
  7. {
  8.  
  9. private void OnCollisionEnter(Collision collisionInfo)
  10. {
  11. print("COLLISION!:\t" + collisionInfo.gameObject.name);
  12. if (collisionInfo.gameObject.name == "rock1(Clone)")
  13. {
  14. aluminium++;
  15. Destroy(collisionInfo.gameObject);
  16. //do stuff. add to resource etc
  17. }
  18. if (collisionInfo.gameObject.name == "rock2(Clone)")
  19. {
  20. water++;
  21. Destroy(collisionInfo.gameObject);
  22. //do stuff. add to resource etc
  23. }
  24. }
Add Comment
Please, Sign In to add comment