public virtual void Start() { this.damageSpeech = transform.GetComponent<BBDamageSpeech>(); this.controller = (transform.parent != null) ? gameObject.GetComponentInParent<BBController3D>() : gameObject.GetComponent<BBController3D>(); this.animatedEntity = transform.FindChild(BBSceneConstants.animatedEntity).GetComponent<BBAnimatedEntity>(); this.gridController = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBGridController>(); BoxCollider collider = GetComponent<BoxCollider>(); this.boundX = (int)(collider.size.x * transform.localScale.x); this.boundY = (int)(collider.size.y * transform.localScale.y); }
public void Init(GameObject originObject) { base.Init(originObject); this.gridController = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBGridController>(); this.originCoordinate = this.gridController.CoordinateFromWorldPoint(originObject.transform.position); this.path = new BBCoordinate[] { BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(1, 1) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(0, 2) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(-1, 1) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(-2, 0) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(-1, -1) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(0, -2) }), BBCoordinate.CompoundCoordinate(new BBCoordinate[] { this.originCoordinate, new BBCoordinate(1, -1) }) }; transform.GetComponent<BBPathFollow>().Path = this.path; }
// Use this for initialization void Start() { this.timer = new BBTimer(); this.Expand(); this.gridController = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBGridController>(); }
// Use this for initialization void Start() { this.platformGenerator = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBPlatformerGenerator>(); this.spawnController = GameObject.FindGameObjectWithTag(BBSceneConstants.spawnControllerTag).GetComponent<BBSpawnController>(); this.gridController = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBGridController>(); this.playerCameraController = Camera.main.GetComponent<BBPlayerCameraController>(); Transform playerHUD = null; switch (this.playerCount) { case 1: playerHUD = Instantiate(this.playerHUD1, Vector3.zero, Quaternion.identity) as Transform; break; case 2: break; case 3: break; case 4: playerHUD = Instantiate(this.playerHUD4, Vector3.zero, Quaternion.identity) as Transform; break; default: BBErrorHelper.DLog(BBErrorConstants.InvalidSwitchInput, "Player count is invalid"); break; } playerHUD.parent = GameObject.FindGameObjectWithTag(BBSceneConstants.controllersTag).transform; this.platformGenerator.GenerateMap(); this.spawnController.LoadTrack(new List<BBSpawnController.SpawnUnit>() { this.spawnController.CreateSpawnUnit(BBSpriteFactory.Sprite.PLAYER, 0.0f, new BBCoordinate(13, 16), true, new BBEntityStats("Raul", 100, 0, 4), 0), this.spawnController.CreateSpawnUnit(BBSpriteFactory.Sprite.BOMBER, 1.0f, new BBCoordinate(17, 18), true, new BBEntityStats(BBSceneConstants.enemy, 20, 0, 0)), this.spawnController.CreateSpawnUnit(BBSpriteFactory.Sprite.TURRET, 1.0f, new BBCoordinate(19, 18), true, new BBEntityStats(BBSceneConstants.enemy, 20, 0, 0)), this.spawnController.CreateSpawnUnit(BBSpriteFactory.Sprite.DUMMY, 1.0f, new BBCoordinate(22,20), true, new BBEntityStats(BBSceneConstants.enemy, 20, 0, 0)) }); this.players = GameObject.FindGameObjectsWithTag(BBSceneConstants.playerTag); this.UpdatePlayers(); this.enemies = GameObject.FindGameObjectsWithTag(BBSceneConstants.enemyTag); this.neutrals = GameObject.FindGameObjectsWithTag(BBSceneConstants.neutralTag); this.allies = GameObject.FindGameObjectsWithTag(BBSceneConstants.allyTag); this.haters = GameObject.FindGameObjectsWithTag(BBSceneConstants.haterTag); }
void Awake() { this.requestManager = GetComponent<BBPathRequestController>(); this.grid = GetComponent<BBGridController>(); }
void Awake() { this.timer = new BBTimer(); this.spawnTrack = new List<SpawnUnit>(); this.gridController = GameObject.FindGameObjectWithTag(BBSceneConstants.layoutControllerTag).GetComponent<BBGridController>(); }