void InstantiateRoom()//Instancia uma sala aleatoria e remove ela da lista { onNewRoom?.Invoke(); if (roomsPassed < 10)//salas faceis { int random = UnityEngine.Random.Range(0, easyRooms.Count); currentRoom = Instantiate(easyRooms[random], spawnRoomPoint.position, Quaternion.identity); easyRooms.Remove(easyRooms[random]); } else if (roomsPassed >= 10 && roomsPassed < 20)//salas medias { int random = UnityEngine.Random.Range(0, mediumRooms.Count); currentRoom = Instantiate(mediumRooms[random], spawnRoomPoint.position, Quaternion.identity); mediumRooms.Remove(mediumRooms[random]); } else if (roomsPassed >= 20 && roomsPassed <= 30)//salas dificeis { if (hardRooms.Count > 0) { int random = UnityEngine.Random.Range(0, hardRooms.Count); currentRoom = Instantiate(hardRooms[random], spawnRoomPoint.position, Quaternion.identity); hardRooms.Remove(hardRooms[random]); } else { HelpfulFunctions.LoadScene("MenuInicial"); } } roomsPassed++; navMesh.BuildNavMesh(); }
private void Start() { StartCoroutine(FadeOut()); PlayerClass.ingredients = PlayerPrefs.GetInt("Ingredients"); HelpfulFunctions.LoadStatus(selectedCharacter); UpdtadeUI(); }
protected virtual void NetGetHit(string bodyPartHit, string hitVector, int damage, int knockbackForce) { Vector3 hitNormal = HelpfulFunctions.StringToVector3(hitVector); if (bodyPartHit == "Eye") { damage = Mathf.RoundToInt(damage * criticalHitMultiplier); audioSource.PlayOneShot(eyeHitSound); } else { audioSource.PlayOneShot(hitSound); } health -= damage; if (health <= 0) { Die(); } if (knockbackEnabled) { rb.AddForce(-hitNormal * knockbackForce, ForceMode.Impulse); rb.AddTorque(hitNormal * knockbackForce, ForceMode.Impulse); } }
IEnumerator LoadScene(string cena) { AM.SetTrigger("Ficar grande"); yield return(new WaitForSeconds(1.5f)); HelpfulFunctions.LoadScene(cena); }
IEnumerator LoadScene(string sceneName) { AM.SetTrigger("Ficar grande"); yield return(new WaitForSeconds(1.5f)); GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatus>().Save(); HelpfulFunctions.LoadScene(sceneName); }
public void UpdtadeUI() { expBar.value = (float)selectedCharacter.experience / selectedCharacter.experienceToNextLevel; levelText.text = "Level: " + (selectedCharacter.level + 1); expPonts.text = "Skill points available: " + selectedCharacter.experiencePoints; ingredientes.text = "" + PlayerClass.ingredients; ingredientesUpgrade.text = "" + PlayerClass.ingredients; HelpfulFunctions.SaveStatus(selectedCharacter); }
void NetProjectileHit(int index, string hitPoint) { if (hitParticles != null) { Vector3 hitVector = HelpfulFunctions.StringToVector3(hitPoint); Instantiate(hitParticles, hitVector, Quaternion.identity); } Destroy(projectiles[index], .5f); }
public Leaves() { Health = 5; MinDamageToHit = 1; Texture = Battle.leaves; Body = new System.Windows.Shapes.Rectangle { Width = standartSize, Height = standartSize, Fill = HelpfulFunctions.BitmapToBrush(Texture) }; Panel.SetZIndex(Body, 10); }
public Bomb() { Health = 1; Texture = Battle.bomb; Body = new System.Windows.Shapes.Rectangle { Width = standartSize, Height = standartSize, Fill = HelpfulFunctions.BitmapToBrush(Texture) }; Panel.SetZIndex(Body, 50); timer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 10) }; Iterator = 0; }
public Gabaijito() { Speed = 2; Health = 20; Buffs = new ushort[maxNumberOfBuffs]; for (int i = 0; i < maxNumberOfBuffs; ++i) { Buffs[i] = 0; } Texture = Battle.mob; Body = new System.Windows.Shapes.Rectangle { Width = standartSize, Height = standartSize, Fill = HelpfulFunctions.BitmapToBrush(Texture) }; Panel.SetZIndex(Body, 40); }
void Awake() { HelpfulFunctions.LoadStatus(player); }
public void Save() { HelpfulFunctions.SaveStatus(player); }