Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using UnityEngine;
  2. using Zenject;
  3.  
  4. public class GameRunner : ITickable
  5. {
  6. private readonly Ship.Factory ship_factory;
  7.  
  8. private Vector3 last_ship_position;
  9.  
  10. public GameRunner(Ship.Factory ship_factory_injection)
  11. {
  12. this.ship_factory = ship_factory_injection;
  13. }
  14.  
  15. public void Tick()
  16. {
  17. if (Input.GetKeyDown(KeyCode.Space))
  18. {
  19. var ship = this.ship_factory.Create(Random.Range(2, 20));
  20.  
  21. ship.transform.position = this.last_ship_position;
  22.  
  23. this.last_ship_position += Vector3.forward * 2;
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement