public BaseLevel() { //declaring positions directionGaugePosition = new Vector2(125f, SacreBleuGame._instance._screenHeight - 50f); powerBarPosition = new Vector2(SacreBleuGame._instance._screenWidth - 75f, SacreBleuGame._instance._screenHeight - 75f); buttonPosition = new Vector2(SacreBleuGame._instance._screenWidth - 150f, SacreBleuGame._instance._screenHeight - 75f); counterPosition = new Vector2(75f, SacreBleuGame._instance._screenHeight / 2 - (0.90f * SacreBleuGame._instance._screenHeight / 2)); pauseMenuContinuePosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 - 50f); pauseMenuRestartPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2); quitPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 + 50f); wonScreenNextLevelPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 - 50f); wonScreenRetryLevelPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2); //setting positions _directionGauge = new DirectionGauge(directionGaugePosition, SacreBleuGame._instance.arrowTexture); _powerBar = new PowerBar(powerBarPosition, SacreBleuGame._instance.powerBarTexture, SacreBleuGame._instance.basicSquare); _hitbutton = new HitButton(buttonPosition, SacreBleuGame._instance.basicSquare, "hitButton"); pauseMenuContinueButton = new ButtonGameObject(pauseMenuContinuePosition, SacreBleuGame._instance.basicSquare, "continueButton"); pauseMenuRestartButton = new ButtonGameObject(pauseMenuRestartPosition, SacreBleuGame._instance.basicSquare, "restartButton"); quitButton = new ButtonGameObject(quitPosition, SacreBleuGame._instance.basicSquare, "quitButton"); wonScreenNextLevelButton = new ButtonGameObject(wonScreenNextLevelPosition, SacreBleuGame._instance.basicSquare, "nextLevelButton"); wonScreenRetryLevelButton = new ButtonGameObject(wonScreenRetryLevelPosition, SacreBleuGame._instance.basicSquare, "retryLevelButton"); //GenerateLevel(levelLayout); numberOfHits = 0; par = 0; entities = new List <GameObject>(); bgEntities = new List <GameObject>(); }
private void SpawnLevelBar(int mode, float beatBlockTime) { hitButtonsContainer = new GameObject("container"); hitButtonsContainer.transform.parent = hitBar.transform; hitButtonsContainer.transform.position = hitBar.transform.position; int count = 0; foreach (int type in beatLevelList) { if (mode == 0) { foreach (float timer in beatBlockList[type].clickAreaList) { GameObject go = Instantiate(hitButton) as GameObject; go.transform.position = hitBar.transform.position; go.transform.Translate(Vector3.up * (timer + (count * beatBlockTime)) * speedMultiply); go.transform.parent = hitButtonsContainer.transform; HitButton hb = go.GetComponent <HitButton>(); hb.beatManager = this; } } else { foreach (float timer in beatBlockListFast[type].clickAreaList) { GameObject go = Instantiate(hitButton) as GameObject; go.transform.position = hitBar.transform.position; go.transform.Translate(Vector3.up * (timer + (count * beatBlockTime)) * speedMultiply); go.transform.parent = hitButtonsContainer.transform; HitButton hb = go.GetComponent <HitButton>(); hb.beatManager = this; } } count++; } }