Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Collections;
- using UnityEngine;
- public class SolarNrgRecycler : Part
- {
- private void OnCollisionEnter(Collision collisionInfo)
- {
- print("COLLISION!:\t" + collisionInfo.gameObject.name);
- if (collisionInfo.gameObject.name == "rock1(Clone)")
- {
- aluminium++;
- Destroy(collisionInfo.gameObject);
- //do stuff. add to resource etc
- }
- if (collisionInfo.gameObject.name == "rock2(Clone)")
- {
- water++;
- Destroy(collisionInfo.gameObject);
- //do stuff. add to resource etc
- }
- }
Add Comment
Please, Sign In to add comment