Exemplo n.º 1
0
 public void CreateSprite(Sprite sprite, Vector3 position, BBEntityStats stats, int number)
 {
     Transform spawn = null;
     switch (sprite) {
         case Sprite.PLAYER:
             //	Player hierarchy is different than every other object, so passing parameters is handled a bit differently
             spawn = Instantiate(this.playerSpawnFab, position, Quaternion.identity) as Transform;
             break;
         case Sprite.TURRET:
             spawn = Instantiate(this.turretSpawnFab, position, Quaternion.identity) as Transform;
             break;
         case Sprite.BOMBER:
             spawn = Instantiate(this.bomberSpawnFab, position, Quaternion.identity) as Transform;
             break;
         case Sprite.DUMMY:
             spawn = Instantiate(this.dummySpawnFab, position, Quaternion.identity) as Transform;
             break;
     }
     if (spawn != null) {
         BBSpawnExplosionResult explosionResult = spawn.GetComponent<BBSpawnExplosionResult>();
         explosionResult.SpawnNumber = number;
         explosionResult.SpawnStats = stats;
         BBExplosion explosion = spawn.GetComponent<BBExplosion>();
         if (explosion != null) {
             explosion.Explode(1.0f);
         }
     }
 }
 public void Init(int number, BBEntityStats stats)
 {
     this.number = number;
     this.actionPlayerController = transform.Find(BBSceneConstants.actionEntity).GetComponent<BBActionPlayerController>();
     this.actionPlayerController.Init(number, stats);
     GameObject.FindGameObjectWithTag(BBSceneConstants.canvasControllerTag).GetComponent<BBCanvasController>().SyncPlayerStat(this.number, stats);
 }
Exemplo n.º 3
0
 public void SyncPlayerStat(int number, BBEntityStats stats)
 {
     Transform targetHUD = transform.FindChild(playerHUD + " " + number);
     targetHUD.GetComponent<BBPlayerHUDController>().Stats = stats;
 }
Exemplo n.º 4
0
 public void CreateSprite(Sprite sprite, Vector3 position, BBEntityStats stats)
 {
     this.CreateSprite(sprite, position, stats, (int)BBSceneConstants.NumberConventions.DEFAULTNUMBER);
 }
Exemplo n.º 5
0
 //    If number is not needed, just feed it a negative number. This will be the convention we use instead of assigning it random values
 public SpawnUnit(BBSpriteFactory.Sprite sprite, float spawnDelaySeconds, float spawnOffsetSeconds, BBCoordinate coordinate, bool atOpenCoordinate, BBEntityStats stats, int number)
 {
     this.sprite = sprite;
     this.spawnSeconds = spawnDelaySeconds + spawnOffsetSeconds;
     this.coordinate = coordinate;
     this.atOpenCoordinate = atOpenCoordinate;
     this.stats = stats;
     this.number = number;
 }
Exemplo n.º 6
0
 public SpawnUnit CreateSpawnUnit(BBSpriteFactory.Sprite sprite, float spawnDelaySeconds, BBCoordinate coordinate, bool atValidCoordinate, BBEntityStats stats)
 {
     return this.CreateSpawnUnit(sprite, spawnDelaySeconds, coordinate, atValidCoordinate, stats, (int)BBSceneConstants.NumberConventions.DEFAULTNUMBER);
 }
Exemplo n.º 7
0
 //    Place wherever you want
 public SpawnUnit CreateSpawnUnit(BBSpriteFactory.Sprite sprite, float spawnDelaySeconds, BBCoordinate coordinate, bool atValidCoordinate, BBEntityStats stats, int number)
 {
     BBNode referencedNode = this.gridController.grid[coordinate.x, coordinate.y];
     return new SpawnUnit(sprite, spawnDelaySeconds, this.timer.Seconds, coordinate, atValidCoordinate, stats, number);
 }
Exemplo n.º 8
0
 public void Init(int number, BBEntityStats stats)
 {
     this.number = number;
     this.stats = stats;
 }