public GameManager(GameObject ui, ICourseInspector courseInspector, IShooter shooter, ICelestialBody startingPosition) { this.overviewUI = ui; this.courseInspector = courseInspector; this.shooter = shooter; this.currentGolfingPosition = startingPosition; this.normal = Vector3.up; }
public IEnumerator Shoot() { overviewUI.SetActive(false); var shotCmd = shooter.Shoot(currentGolfingPosition, Vector3.up); yield return(shotCmd.Run()); var results = shotCmd.Results(); currentGolfingPosition = results.WhereShotEndedUp; normal = results.Normal; overviewUI.SetActive(true); }
public IShootCommand Shoot(ICelestialBody planetToShootOffOf, Vector3 normal) { return(new BuildPlayerAndShootCommand(playerToInstantiate, planetToShootOffOf, normal)); }
public BuildPlayerAndShootCommand(GameObject playerToInstantiate, ICelestialBody planetToShootOffOf, Vector3 normal) { this.playerToInstantiate = playerToInstantiate; this.planetToShootOffOf = planetToShootOffOf; this.normal = normal; }
void Start() { planet = new PlanetBody(this.gameObject, Random.Range(6, 11), 0, (Random.Range(0, 2) == 0), 1); }