Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
el valor dentro del interruptor no cambiará, unidad

Tengo interruptor y algún caso. este código solo funciona en la primera línea. necesita recargar dos veces para que el resto del código funcione. cambia el daño del enemigo al principio, pero necesita recargar dos veces para cambiar killScore. alguien sabe porque?

 using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; public class Difficulty : MonoBehaviour { public int difficulty; public ammo enemyDamage; public enemy enemy1; public enemy enemy2; //public enemy enemy2; public TextMeshProUGUI diff; // Start is called before the first frame update void Awake() { difficulty = PlayerPrefs.GetInt("Difficulty"); diff.text = PlayerPrefs.GetInt("Difficulty").ToString(); switch(PlayerPrefs.GetInt("Difficulty")) { case 0: difficulties(3,100); break; case 1: difficulties(5,200); break; case 2: difficulties(7,300); break; } Debug.Log("kill score : " + enemy1.killScore); Debug.Log("difficulty : " + difficulty); } // Update is called once per frame void Update() { } void difficulties(int a, int b) { enemyDamage.enemyDamage = a; enemy1.killScore = b; enemy2.killScore = b; } }

cambia el valor en el prefabricado pero el prefabricado que puse en escena no lo hace.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Cambio el guión y pongo killScore en PlayerPref y cambiará en el menú principal antes de la escena de juego. gracias

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!