Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class WateringCan : MonoBehaviour
  6. {
  7. void Update()
  8. {
  9. if (Input.GetButton("Water"))
  10. {
  11. Component[] seeds = (Component[]) Component.FindObjectsOfType<Seed>();
  12. print("press that spacebar");
  13. foreach (Component seed in seeds)
  14. {
  15. Debug.DrawLine(seed.transform.position, gameObject.transform.position, Color.blue, 2);
  16. print("water");
  17. }
  18.  
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement