// [HideInInspector] public GameObject car; // Use this for initialization void Awake() { secondCanvas = GameObject.Find("SecondCanvas"); fireBackground = GameObject.Find("FireBackground"); fireStart = GameObject.Find("FireStart"); garage = GameObject.FindObjectOfType<Garage>(); taskMenu = GameObject.FindObjectOfType<TaskMenu>(); kaController = GameObject.FindObjectOfType<KAController>(); waitBackground = GameObject.FindObjectOfType<WaitBackground>(); mainScreen = GameObject.FindObjectOfType<MainScreen>(); bg = GameObject.Find("BG"); carsInfo = GetComponent<CarsInfo>(); filling = GameObject.FindObjectOfType<Filling>(); carChanger = GameObject.FindObjectOfType<CarChanger>(); dustSmall = GameObject.Find("DustSmall"); windowWarning = GameObject.FindObjectOfType<WindowWarning>(); windowConfirmation = GameObject.FindObjectOfType<WindowConfirmation>(); mainBonus = GetComponent<MainBonus>(); dailyEvents = GetComponent<DailyEvents>(); moneyBar = GameObject.FindObjectOfType<MoneyBar>(); boosterMenu = GameObject.FindObjectOfType<BoosterMenu>(); dailyGiftMenu = GameObject.FindObjectOfType<DailyGiftMenu>(); backMenuButton = GameObject.FindObjectOfType<BackMenuButton>(); /* car = garage.transform.Find("Car").gameObject; if (car == null) CreateCar(); */ }
// [HideInInspector] public GameObject car; // Use this for initialization void Awake() { secondCanvas = GameObject.Find("SecondCanvas"); fireBackground = GameObject.Find("FireBackground"); fireStart = GameObject.Find("FireStart"); garage = GameObject.FindObjectOfType <Garage>(); taskMenu = GameObject.FindObjectOfType <TaskMenu>(); kaController = GameObject.FindObjectOfType <KAController>(); waitBackground = GameObject.FindObjectOfType <WaitBackground>(); mainScreen = GameObject.FindObjectOfType <MainScreen>(); bg = GameObject.Find("BG"); carsInfo = GetComponent <CarsInfo>(); filling = GameObject.FindObjectOfType <Filling>(); carChanger = GameObject.FindObjectOfType <CarChanger>(); dustSmall = GameObject.Find("DustSmall"); windowWarning = GameObject.FindObjectOfType <WindowWarning>(); windowConfirmation = GameObject.FindObjectOfType <WindowConfirmation>(); mainBonus = GetComponent <MainBonus>(); dailyEvents = GetComponent <DailyEvents>(); moneyBar = GameObject.FindObjectOfType <MoneyBar>(); boosterMenu = GameObject.FindObjectOfType <BoosterMenu>(); dailyGiftMenu = GameObject.FindObjectOfType <DailyGiftMenu>(); backMenuButton = GameObject.FindObjectOfType <BackMenuButton>(); /* * car = garage.transform.Find("Car").gameObject; * if (car == null) * CreateCar(); */ }
// Start is called before the first frame update void Start() { FLAGGuende = false; FLAGFuego = false; maxHealth = SetMaxHealthFromHelathLevel(); // set la vida maxima que tendra el personaje dependido del healthLevel currentHealth = maxHealth; //indico al iniciar que la vida esta al maximo extraHealth = 0; extraHealthActive = false; healthBar.SetMaxHealth(maxHealth); //le indico a la barra de saluda su valor //stamina maxStamina = SetMaxStaminaFromStaminaLevel(); //recoger stamina amxima staminaBar.SetMaxStamina(Mathf.RoundToInt(maxStamina)); //inicializar valor maximo stamina currentStamina = maxStamina; //inicializar al principio el stamina maximo //monedas moneyBar = FindObjectOfType <MoneyBar>(); BarraMonedas.SetActive(false); contadorMonedas = 0; playerManager = GetComponent <PlayerManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); normalSpeed = playerLocomotion.movementSpeed; rollSpeed = playerLocomotion.sprintSpeed; }