100coding
4/11/2017 - 2:59 AM

2683EF7A-F413-41B3-A824-E8C9FF1E96B4

2683EF7A-F413-41B3-A824-E8C9FF1E96B4

using UnityEngine;
using Zenject;

public class GameRunner : ITickable
{
    [Inject] private Ship.Factory ship_factory;

    private Vector3 last_ship_position;

    public void Tick()
    {
        if (!Input.GetKeyDown(KeyCode.Space)) return;

        var ship = this.ship_factory.Create(Random.Range(1, 10));

        this.last_ship_position += Vector3.forward * 2;
        ship.transform.position = this.last_ship_position;
    }
}