Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Green Key Script
- // name
- using UnityEngine;
- // This is the wing cap script.
- class GreenKeyScript : MonoBehaviour
- {
- // Something just collided with a Green Key.
- protected void OnCollisionEnter2D(Collision2D localCollision)
- {
- // What is the other object?
- GameObject localOtherObject = localCollision.gameObject;
- // Is it Hero?
- if (localOtherObject.name.StartsWith("Hero"))
- {
- // Hero picks up a Greek Key by deactivating it.
- this.gameObject.SetActive(false);
- }
- }
- // This completes the Green Key script.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement