// 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; }
// Use this for initialization void Start() { this.spriteFactory = GetComponent<BBSpriteFactory>(); }
// 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); }
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); }
// Use this for initialization void Start() { this.factory = GameObject.FindGameObjectWithTag(BBSceneConstants.gameControllerTag).GetComponent<BBSpriteFactory>(); }