示例#1
0
 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;
 }
示例#2
0
        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);
        }
示例#3
0
 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;
 }
示例#5
0
 void Start()
 {
     planet = new PlanetBody(this.gameObject, Random.Range(6, 11), 0, (Random.Range(0, 2) == 0), 1);
 }