public IActionResult ObterLevelStatus([FromHeader] string email) { var levelStatus = new LevelStatus(); levelStatus.LevelAtual = 3; levelStatus.DesafiosConcluidos.Add(new Desafio() { Level = 1, Descricao = "Economizar R$20,00" }); levelStatus.DesafiosConcluidos.Add(new Desafio() { Level = 2, Descricao = "Economizar R$50,00" }); levelStatus.DesafiosPendentes.Add(new Desafio() { Level = 3, Descricao = "Economizar R$100,00" }); levelStatus.DesafiosPendentes.Add(new Desafio() { Level = 3, Descricao = "Indique um amigo" }); return(Ok(levelStatus)); }
public virtual IEnumerator Start() { this.characterController = (CharacterController)this.GetComponent(typeof(CharacterController)); this.levelStateMachine = (LevelStatus)GameObject.Find("/Level").GetComponent(typeof(LevelStatus)); if (!this.levelStateMachine) { Debug.Log("EnemyPoliceGuy: ERROR! NO LEVEL STATUS SCRIPT FOUND."); } if (!this.target) { this.target = GameObject.FindWithTag("Player").transform; } this.anim = this.GetComponent <Animation>(); this.anim.wrapMode = WrapMode.Loop; this.anim.Play("idle"); this.anim["threaten"].wrapMode = WrapMode.Once; this.anim["turnjump"].wrapMode = WrapMode.Once; this.anim["gothit"].wrapMode = WrapMode.Once; this.anim["gothit"].layer = 1; this.GetComponent <AudioSource>().clip = this.idleSound; yield return(new WaitForSeconds(Random.value)); while (true) { yield return(this.StartCoroutine(this.Idle())); yield return(this.StartCoroutine(this.Attack())); } }
private void FinishLevel() { FindObjectOfType <CameraController>().ChangeFreeCamera(); FindObjectOfType <CarController>().enabled = false; FindObjectOfType <CarController>().gameObject.GetComponent <Rigidbody>().isKinematic = true; var sounds = FindObjectsOfType <AudioSource>(); foreach (var item in sounds) { item.volume = 0; } if (LevelManager.Instance.currentTimer < LevelMaxTime) { status = LevelStatus.Perfect; } else if (LevelManager.Instance.currentTimer <= LevelMaxTime + (LevelMaxTime / 2)) { status = LevelStatus.Good; } else { status = LevelStatus.NotBad; } LevelManager.Instance.LevelFinish(status, LevelMoney); }
// 레벨에 따른 생성 속도 변경 protected void ChangeRespawnSpeed(LevelStatus currentLevel) { switch (currentLevel) // 변경 시 설정 값 변경 { case LevelStatus.level1: respawnMaxTime = 5.0f; // 시간 변경 TODO : 변수로 받기. break; case LevelStatus.level2: respawnMaxTime = 3.0f; // 시간 변경 TODO : 변수로 받기. break; case LevelStatus.level3: respawnMaxTime = 2.0f; // 시간 변경 TODO : 변수로 받기. break; case LevelStatus.level4: respawnMaxTime = 1.8f; break; case LevelStatus.level5: respawnMaxTime = 1.6f; break; case LevelStatus.level6: respawnMaxTime = 1.4f; break; case LevelStatus.level7: respawnMaxTime = 1.2f; break; } }
// 움직임 변화. public override void SetMoveMent(LevelStatus currentLevel) { base.SetMoveMent(currentLevel); switch (currentLevel) { case LevelStatus.level1: rotationSpeedZ = 0; break; case LevelStatus.level2: rotationSpeedZ = 50f * Random.Range(-1, 2) * Time.deltaTime; // 1, 0, -1값으로 회전, 회전 방향 주기 break; case LevelStatus.level3: rotationSpeedZ = 60f * Random.Range(-1, 2) * Time.deltaTime; break; case LevelStatus.level4: rotationSpeedZ = 70f * Random.Range(-1, 2) * Time.deltaTime; break; case LevelStatus.level5: rotationSpeedZ = 80f * Random.Range(-1, 2) * Time.deltaTime; break; case LevelStatus.level6: rotationSpeedZ = 90f * Random.Range(-1, 2) * Time.deltaTime; break; case LevelStatus.level7: rotationSpeedZ = 100f * Random.Range(-1, 2) * Time.deltaTime; break; } }
private void SpawnDefender() { LevelStatus levelStatus = FindObjectOfType <LevelStatus>(); // Only spawn a unit if we have enough energy available if (levelStatus.energy >= defenderPrefab.defenderUnit.costToSpawn) { Defender spawnedDefender = Instantiate(defenderPrefab, transform.position, Quaternion.identity) as Defender; int defenderCost = defenderPrefab.defenderUnit.costToSpawn; spawnedDefender.transform.SetParent(gameCanvas.transform, false); spawnedDefender.transform.SetParent(transform); spawnedDefender.transform.position = transform.position; spawnedDefender.transform.localScale = new Vector3(1, 1, 1); levelStatus.SpendEnergy(defenderCost); defenderOnTile = spawnedDefender; if (levelStatus.isOvertime) { SpawnFX(overtimeGlowPrefab); } else { SpawnFX(spawnGlowPrefab); } } else { SpawnNotification(insuffEnergyPopup); } }
private void SetStatus(Label labelIcon, LevelStatus status, Label labelText = null) { switch (status) { case LevelStatus.TopLevel: labelIcon.BackColor = Color.LightGreen; labelIcon.ForeColor = Color.DarkGreen; labelIcon.Text = "✓"; if (labelText != null) { labelText.Text = "Keep this creatures!"; } break; case LevelStatus.NewTopLevel: labelIcon.BackColor = Color.LightYellow; labelIcon.ForeColor = Color.Gold; labelIcon.Text = "★"; if (labelText != null) { labelText.Text = "Keep this creatures, it adds new traits to your library!"; } break; default: labelIcon.BackColor = Color.LightGray; labelIcon.ForeColor = Color.Gray; labelIcon.Text = "-"; if (labelText != null) { labelText.Text = "This creature adds nothing new to your library."; } break; } }
void Start() { _levelStatus = LevelStatus.Ongoing; // _victoryCanvas.SetActive(False); { var temp = Resources.FindObjectsOfTypeAll <Canvas>(); foreach (var x in temp) { if (x.name == "VictoryCanvas") { _victoryCanvas = x.gameObject; break; } } } // _defeatCanvas.SetActive(False); { var temp = Resources.FindObjectsOfTypeAll <Canvas>(); foreach (var x in temp) { if (x.name == "DefeatCanvas") { _defeatCanvas = x.gameObject; break; } } } }
public LevelStatus[] ParseLevelStateAfterTyping(string lvlStatus) { LevelStatus[] statuses = new LevelStatus[lvlStatus.Length]; for (int i = 0; i < lvlStatus.Length; i++) { switch (lvlStatus[i]) { case LevelStatusOpened: statuses[i] = LevelStatus.Opened; break; case LevelStatusClosed: statuses[i] = LevelStatus.Closed; break; case LevelStatusInDeveloping: if (i < 20) { statuses[i] = LevelStatus.Closed; } else { statuses[i] = LevelStatus.Developing; } break; case LevelStatusComplited: statuses[i] = LevelStatus.Complited; break; } } return(statuses); }
public void finishLevel(LevelStatus levelStatus) { portal.gameObject.SetActive(true); portal.Open(); AudioManager.instance.StopSound("Music"); player.finishLevel(); }
void Awake() { current = this; string str = PlayerPrefs.GetString("stats" + lvl, null); this.levelStatus = JsonUtility.FromJson <LevelStatus>(str); if (this.levelStatus == null) { this.levelStatus = new LevelStatus(); fruitsMax = this.levelStatus.maxFruits; coins = 0; fruits = 0; crystalBlue = false; crystalGreen = false; crystalRed = false; return; } Debug.Log("Read " + str); fruitsMax = this.levelStatus.maxFruits; coins = 0; fruits = levelStatus.collectedFruits; crystalBlue = levelStatus.hasBlueCrystal; crystalGreen = levelStatus.hasGreenCrystal; crystalRed = levelStatus.hasRedCrystal; }
// 레벨에 따른 속도 변경 public void Fall(LevelStatus currentLevel) { switch (currentLevel) { case LevelStatus.level1: speed = 20.0f; break; case LevelStatus.level2: speed = 25.0f; break; case LevelStatus.level3: speed = 30.0f; break; case LevelStatus.level4: speed = 35.0f; break; case LevelStatus.level5: speed = 40.0f; break; case LevelStatus.level6: speed = 45.0f; break; case LevelStatus.level7: speed = 50.0f; break; } }
private void Awake() { if (instance == null) { instance = this; return; } }
void Awake() { levelStateMachine = (LevelStatus)FindObjectOfType(typeof(LevelStatus)); if (!levelStateMachine) Debug.Log("No link to Level Status"); remainingItems = levelStateMachine.itemsNeeded; }
public void StartLevel() { LoadLevel(); status = LevelStatus.Playing; PlayerManager.Instance.SpawnPlayer(); PieceManager.Instance.StartGenerating(); }
IEnumerator InitiateLoading() { LevelStatus.Complete(0); //Mark Level 1 (id 0) as complete LevelStatus.Unlock(1); //Unlock Level 2 (id 1) transform.parent = GameObject.FindWithTag("GUI").transform; //to keep this script alive through the level-change parent it to the GUI yield return(StartCoroutine(StandardGUI.instance.LoadLevel("Level2"))); //wait for loading to complete Destroy(gameObject); //now destroy this manually }
public LevelButton(int levelIndex, LevelStatus startStatus) : base(levelIndex, startStatus) { // add a label that shows the level index label = new TextGameObject("Fonts/MainFont", 1, Color.White, TextGameObject.Alignment.Right); label.LocalPosition = new Vector2(sprite.Width - 15, 10); label.Parent = this; label.Text = levelIndex.ToString(); }
private int remainingItems; // total number to pick up on this level. Grabbed from LevelStatus. public virtual void Awake() { this.levelStateMachine = (LevelStatus)UnityEngine.Object.FindObjectOfType(typeof(LevelStatus)); if (!this.levelStateMachine) { Debug.Log("No link to Level Status"); } this.remainingItems = this.levelStateMachine.itemsNeeded; }
public void Edit () { currentStatus = LevelStatus.Edit; EnableScriptsInObject(origin, true); foreach (GameObject obj in objectsToEnableOnEdit) { obj.SetActive(true); } DeactivatePlayer(); }
protected virtual void Win() { levelStatus = LevelStatus.WON; foreach (Spawner spawner in spawners) { spawner.KillThemAll(); spawner.shouldSpawn = false; } GameManager.instance.finishLevel(levelStatus); }
public override void ShowWindow() { base.ShowWindow(); LevelStatus levelHistory = LevelHistory.GetLevelHistory(selectedLevelIndexSO.Value); if (levelHistory != null) { highScoreText.text = levelHistory.highScore.ToString(); sessionScoreText.text = levelHistory.currentScore.ToString(); } }
public static bool IsPlayable(this LevelStatus status) { if (status == LevelStatus.LOCKED) { return(false); } else { return(true); } }
public void Test () { currentStatus = LevelStatus.Test; EnableScriptsInObject(origin, false); foreach (GameObject obj in objectsToEnableOnEdit) { obj.SetActive(false); } ResetPlayer(); ActivatePlayer(); }
protected virtual string getSpriteNameForStatus(LevelStatus status) { if (status == LevelStatus.Locked) { return("Sprites/UI/spr_level_locked"); } if (status == LevelStatus.Unlocked) { return("Sprites/UI/spr_level_unsolved"); } return("Sprites/UI/spr_level_solved"); }
private static string getSpriteNameForStatus(LevelStatus status) { if (status == LevelStatus.Locked) { return("Sprites/UI/spr_level_locked"); } if (status == LevelStatus.Unlocked) { return("Sprites/UI/spr_level_unsolved"); } return("Sprites/UI/spr_level_solved@6"); }
public LevelButton(int levelIndex, LevelStatus startStatus) : base(getSpriteNameForStatus(startStatus)) { LevelIndex = levelIndex; Status = startStatus; label = new TextGameObject("Fonts/ScoreFont", Color.Black, TextGameObject.Alignment.Center) { Position = sprite.Center + new Vector2(0, 12), Parent = this, Text = levelIndex.ToString() }; }
public LevelButton(int levelIndex, LevelStatus startStatus) : base(getSpriteNameForStatus(startStatus)) { this.levelIndex = levelIndex; Status = startStatus; // add a label that shows the level index label = new TextGameObject("Fonts/ScoreFont", Color.Black, TextGameObject.Alignment.Center); label.LocalPosition = sprite.Center + new Vector2(0, 12); label.Parent = this; label.Text = levelIndex.ToString(); }
void Start() { levelStatus = FindObjectOfType <LevelStatus>(); prepPhaseUI = FindObjectOfType <PreparationPhase>(); TogglePrepPhaseUI(); LoadPanel(tutIndex); tutorialPassed = new bool[tutorialPanels.Length]; tiles = FindObjectsOfType <DefenderTile>(); for (int i = 0; i < tutorialPanels.Length; i++) { tutorialPassed[i] = false; } }
// Start is called before the first frame update private void Start() { oldPanelColor = new Vector4(0, 0, 0, 0.7f); playerStatus = JetStatus.Get(); EnemiesDestroyedSingleton = EnemiesDestroyed.Get(); playerAircraft = player.GetComponent <AircraftMovement>(); playerCamera = player.GetComponent <AircraftCamera>(); UIPanel = panel.GetComponent <Image>(); enemiesDestroyedText.text = ""; finishText.text = ""; UIPanel.color = new Vector4(0, 0, 0, 0); Cursor.visible = false; levelStatus = GetComponent <LevelStatus>(); }
/// <summary> /// Méthode appelé lorsqu'un tank est détruire. Enlève le tank de la liste si c'est un ennemi ou /// termine le niveau si c'est le joueur. Le score du joueur est aussi ajuster en fonction du tank enlevé. /// </summary> /// <param name='tank'> /// Le tank a enlevé. /// </param> public void removeTank(GameObject tank) { //Remove player tank if (tank == player && levelStatus == LevelStatus.Playing) { Debug.Log("Player killed"); _status = LevelStatus.Failed; //Désactiver les tanks foreach (GameObject enemy in enemies) { enemy.GetComponent <EnemyMain>().pause(); } //Détruire tous les projectiles GameObject[] gameObjects = GameObject.FindObjectsOfType <GameObject>(); foreach (GameObject gameObject in gameObjects) { if (gameObject.GetComponent <Projectile_Mouvement>() != null) { Destroy(gameObject); } } } //Remove enemy tank else if (tank.GetComponent <EnemyMain>() != null && levelStatus == LevelStatus.Playing) { Debug.Log("Enemy killed"); enemies.Remove(tank); gameManager.augmenterPointage(tank.GetComponent <EnemyMain>().point); //Vérifier s'il reste des ennemies if (enemies.Count == 0) { _status = LevelStatus.Completed; player.GetComponent <PlayerMain>().pause(); //Détruire tous les projectiles GameObject[] gameObjects = GameObject.FindObjectsOfType <GameObject>(); foreach (GameObject gameObject in gameObjects) { if (gameObject.GetComponent <Projectile_Mouvement>() != null) { Destroy(gameObject); } } } } }
/// <summary> /// Exécuter les actions nécessaires au début du niveau. Notamment, activer tous les tanks. /// </summary> private void startLevel() { Debug.Log("START LEVEL!"); _status = LevelStatus.Playing; //Activer le joueur player.GetComponent <PlayerMain>().play(); //Assigner le joueur comme cible des ennemis foreach (GameObject enemy in enemies) { enemy.GetComponent <EnemyMain>().play(); } }
void OnGUI() { if (inventoryOpen) { blueBoxStyle = new GUIStyle(GUI.skin.box); blueBoxStyle.normal.background = LevelStatus.MakeTex(1, 1, Color.white); GUI.Box(new Rect(Camera.main.pixelWidth / 2 - 100, 200, 200, 200), "", blueBoxStyle); GUI.DrawTexture(new Rect(Camera.main.pixelWidth / 2 - 100 + 10, 200, 30, 30), texture); textStyle = new GUIStyle(); textStyle.normal.textColor = Color.black; GUI.Label(new Rect(Camera.main.pixelWidth / 2 - 100 + 50, 210, 100, 100), LevelManager.levelManager.GoldCoins + "", textStyle); } }
/// <summary> /// Set the color status and uses the earlier set statsStatus. /// </summary> public void SetColorAnalysis(LevelStatus colorStatus, string colorAnalysis) { _colorStatus = colorStatus; SetStatus(LbColorStatus, colorStatus); LbColorAnalysis.Text = colorAnalysis; var generalStatus = _statsStatus; if (generalStatus != LevelStatus.NewTopLevel && colorStatus != LevelStatus.Neutral) { generalStatus = colorStatus; } SetStatus(LbIcon, generalStatus, LbConclusion); }
//public AudioClip deathSound; //private AudioSource source; // Use this for initialization void Start() { //init audio source //source = GetComponent<AudioSource>(); GameObject gameControllerObject = GameObject.FindWithTag ("GameController"); if (gameControllerObject != null) { levelStatus = gameControllerObject.GetComponent<LevelStatus>(); } if (levelStatus == null) { Debug.Log ("Cannot find levelStatus from game controller"); } }
void Update () { if (oldCurrentStatus != currentStatus) { if (currentStatus == LevelStatus.Edit) { Edit(); } if (currentStatus == LevelStatus.Test) { Test(); } if (currentStatus == LevelStatus.Play) { Play(); } } if (Input.GetKeyDown(KeyCode.Escape)) { Edit(); } oldCurrentStatus = currentStatus; }
private void LevelUpToPestControl() { currentLevel = LevelStatus.pestControl; displayStartOfLevelText=true; Debug.Log ("NICO NICO F**K YOU"); Invoke ("TurnOffText", 5f); }
public void SetCurrentStatus (LevelStatus newStatus) { currentStatus = newStatus; }
// Use this for initialization void Start() { ourGod = this; theHand = new oneHand (); currentLevel = LevelStatus.planting; allPlanted = false; moundsInLevel =GameObject.FindGameObjectsWithTag("mound"); spawners=GameObject.FindGameObjectsWithTag("spawn"); Debug.Log (moundsInLevel.Length); deadPlants = 0; gameOver = false; aTime = 0; pestsKilled = 0; }
//clouds are bugged for this iteration, skipping this phase of the game. private void LevelUpToWatering() { foreach (GameObject m in moundsInLevel) { Vector3 RainCloudPosition = new Vector3(m.transform.position.x, m.transform.position.y +10, m.transform.position.z ); Instantiate (wateringMethod, RainCloudPosition, gameObject.transform.rotation); } currentLevel = LevelStatus.watering; }
private void CheckObjectiveCompletion() { if (objective.CheckCompletion()) { if (popups.Count == 0 && levelStatus == LevelStatus.Complete || levelStatus == LevelStatus.Died) Globals.gameState = GameState.LevelSelect; levelStatus = LevelStatus.Complete; popups.Add(new PopupWindow("You defeated the evil Walmart! :D")); } }
private void UpdateStormHealth() { if(IsStormInStormFront()) storm.stormHealth.ModifyHealth(0); else storm.stormHealth.ModifyHealth(-3); if (storm.stormHealth.CurrentHealth <= 0) { ResetManagers(); levelStatus = LevelStatus.Died; popups.Add(new PopupWindow("You have Died. :(")); storm.stormHealth.ResetHealth(); } }
public void SetLevelStatusSucces() { this.currentLevelStatus = LevelStatus.Success; }
public void SetLevelStatusFail() { this.currentLevelStatus = LevelStatus.Fail; }
// Use this for initialization IEnumerator Start() { // Cache a reference to the rigidbody rigidBody = (Rigidbody)GetComponent(typeof(Rigidbody)); // Cache a link to LevelStatus state machine script: levelStateMachine = (LevelStatus)GameObject.Find("/Level").GetComponent(typeof(LevelStatus)); if (!levelStateMachine) { Debug.Log("EnemyPoliceGuy: ERROR! NO LEVEL STATUS SCRIPT FOUND."); } if (!target) target = GameObject.FindWithTag("Player").transform; animation.wrapMode = WrapMode.Loop; // Setup animations animation.Play("idle"); animation["threaten"].wrapMode = WrapMode.Once; animation["turnjump"].wrapMode = WrapMode.Once; animation["gothit"].wrapMode = WrapMode.Once; animation["gothit"].layer = 1; // initialize audio clip. Make sure it's set to the "idle" sound. audio.clip = idleSound; yield return new WaitForSeconds(Random.value); // Just attack for now while (true) { Debug.Log("loop"); // Don't do anything when idle. And wait for player to be in range! // This is the perfect time for the player to attack us yield return StartCoroutine("Idle"); // Prepare, turn to player and attack him yield return StartCoroutine("Attack"); } }
public void Play () { currentStatus = LevelStatus.Play; ResetPlayer(); ActivatePlayer(); }