Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    private void Awake()
    {
        if (extraHealthActive)
        {
            timer += Time.deltaTime;
            if (timer > extraHealthSpeed)
            {
                extraHealth--;
                extraHealthBar.setCurrentHealth(extraHealth);
                timer = 0;
            }
        }

        if (contadorMonedasActive)
        {
            timerMonedas += Time.deltaTime;
            if (timerMonedas > tiempoContadorMonedasActivo)
            {
                BarraMonedas.SetActive(false);
                timerMonedas = 0;
            }
        }

        if (FLAGcontadorMonedasActive)
        {
            timerMonedas              = 0;
            contadorMonedasActive     = true;
            FLAGcontadorMonedasActive = false;
        }

        staminaBar      = FindObjectOfType <StaminaBar>();
        animatorHandler = GetComponentInChildren <AnimatorHandler>();
    }
Ejemplo n.º 2
0
 void Start()
 {
     healthBar = FindObjectOfType<HealthBar>();
     staminaBar = FindObjectOfType<StaminaBar>();
     cam = FindObjectOfType<Camera>();
     body = GetComponent<Rigidbody>();
 }
Ejemplo n.º 3
0
 private void Start()
 {
     staminaBar = GetComponent <StaminaBar>();
     rb         = GetComponent <Rigidbody2D>();
     ray        = GetComponent <CollisionRay>();
     fsm        = GetComponent <FiniteStateMachine>();
 }
Ejemplo n.º 4
0
 private void Start()
 {
     fsm        = GetComponent <FiniteStateMachine>();
     staminaBar = GetComponent <StaminaBar>();
     rb         = GetComponent <Rigidbody2D>();
     anim       = GetComponent <Animator>();
 }
Ejemplo n.º 5
0
 private void Start()
 {
     rb         = GetComponent <Rigidbody2D>();
     ray        = GetComponent <CollisionRay>();
     staminaBar = GetComponent <StaminaBar>();
     physics    = GetComponent <ModifyPhysics>();
 }
Ejemplo n.º 6
0
 private void OnStaminaUpdate(object source, PlayerStaminaEventArgs args)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
     {
         StaminaBar.UpdateBar(args.Stamina, args.MaxStamina);
     }));
 }
 void Awake()
 {
     //Obtains the player
     player = GameObject.FindGameObjectWithTag("Player");
     //Obtains the health atributes
     playerHealth    = player.GetComponent <Health>();
     playerHealthBar = GetComponentInChildren <HealthBar>();
     playerHealthBar.SetMaxHealth(playerHealth.GetMaxHealth());
     playerHealthBar.SetCurrentHealth(GameManager.instance.data.HasPlayerData() ? GameManager.instance.GetCurrentPlayerHealth() : playerHealth.GetMaxHealth());
     //Obtains the stamina atributes
     playerStamina    = player.GetComponent <Stamina>();
     playerStaminaBar = GetComponentInChildren <StaminaBar>();
     playerStaminaBar.SetMaxStamina(playerStamina.GetMaxStamina());
     playerStaminaBar.SetCurrentStamina(playerStamina.GetMaxStamina());
     //Disable the panels
     npcNamePanel.SetActive(false);
     textPanel.SetActive(false);
     introTextPanel.SetActive(false);
     savePanel.SetActive(false);
     unlockWeaponPanel.SetActive(false);
     deathPanel.SetActive(false);
     outOfAmmoPanel.SetActive(false);
     sentenceOptionsPanel.SetActive(false);
     fuelBarUI.SetActive(false);
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     //healthbar = FindObjectOfType<HealthBar>();
     staminabar      = FindObjectOfType <StaminaBar>();
     animatorHandler = GetComponentInChildren <AnimatorHandler>();
     levelLoader     = FindObjectOfType <LevelLoader>();
 }
Ejemplo n.º 9
0
    // Start is called before the first frame update
    void Start()
    {
        airMovementComponent = GetComponentInChildren <AirMovement>();
        staminaBar           = GetComponentInChildren <StaminaBar>();

        Input.multiTouchEnabled = false;
        rigidBody = GetComponent <Rigidbody2D>();

        maxRotationDownRight = 360f - maxRotationUp;
        maxRotationUpLeft    = 360f - maxRotationUp;
        maxRotationDownLeft  = maxRotationUp;

        startArrowXScale = slingArrowObject.localScale.x;
        emptyPrefab      = new GameObject();

        minMaskScale          = slingMaskObject.localScale.x;
        scaleXTotalDifference = maxMaskScale - minMaskScale;

        currentMaxMagnitude        = maxMagnitudeOfSlingVector;
        currentMaxTime             = maxTimeAtMaxSlingMagnitude;
        currentMaxTimeTemp         = currentMaxTime;
        currentMaxMaskScale        = maxMaskScale;
        currentMaxPowerupMaskScale = maxPowerUpMaskScale;

        differenceTotalForce = maxForceToApply - minForceToApply;

        minPowerupMaskScale = powerupMaskObject.localScale.x;
    }
Ejemplo n.º 10
0
 private void Start()
 {
     rb       = GetComponent <Rigidbody2D>();
     sb       = GetComponent <StaminaBar>();
     sr       = GetComponent <SpriteRenderer>();
     lastxpos = transform.position.x;
     mass     = rb.mass;
 }
Ejemplo n.º 11
0
    void Start()
    {
        anim = GetComponent <Animator>();

        instance = GetComponent <StaminaBar>();

        myrigidbody = GetComponent <Rigidbody2D>();
    }
Ejemplo n.º 12
0
 void Start()
 {
     CountSourse               = this.GetComponent <AudioSource>();
     freeze_p                  = player.gameObject.GetComponent <Player_move>();
     freeze_s                  = stamina.gameObject.GetComponent <StaminaBar>();
     _textCountdown.text       = "";
     _textCountdown_third.text = "";
 }
Ejemplo n.º 13
0
 void BuildGameUI()
 {
     mainMenu.gameObject.SetActive(false);
     healthBar     = Instantiate(healthBar, transform);
     staminaBar    = Instantiate(staminaBar, transform);
     debugger      = Instantiate(debugger, transform);
     console       = Instantiate(console, transform);
     waveAnnouncer = Instantiate(waveAnnouncer, transform);
 }
    public override void ResetCharacter()
    {
        healthMeter = Instantiate(healthMeterPrefab);
        staminaBar  = Instantiate(StaminaBarPrefab);

        hitPoints.value       = startingHitPoints;
        stamina.value         = startingStamina;
        healthMeter.character = this;
        staminaBar.character  = this;
    }
Ejemplo n.º 15
0
    void Start()
    {
        AudioListener.volume = 1;

        isStart                   = false;
        CountSourse               = this.GetComponent <AudioSource>();
        freeze_p                  = player.gameObject.GetComponent <Player_move>();
        freeze_s                  = stamina.gameObject.GetComponent <StaminaBar>();
        _textCountdown.text       = "";
        _textCountdown_third.text = "";
        StartCoroutine(CountdownCoroutine());
        Is_Coroutine_flag = true;
    }
Ejemplo n.º 16
0
        private void Awake()
        {
            controller = GetComponent <CharacterController>();

            if (staminaBar == null)
            {
                staminaBar = FindObjectOfType <StaminaBar>();
            }

            if (soundManager == null)
            {
                soundManager = FindObjectOfType <SoundManager>();
            }
        }
Ejemplo n.º 17
0
 void Awake()
 {
     _playerHealthBar  = GetComponentInChildren <HealthBar>();
     _playerStaminaBar = GetComponentInChildren <StaminaBar>();
     _playerCombatBar  = GetComponentInChildren <CombatBar>();
 }
Ejemplo n.º 18
0
 public void InitStaminaBar(StaminaBar staminaBarParam)
 {
     bar = staminaBarParam;
 }
Ejemplo n.º 19
0
    // Start is called before the first frame update

    private void Awake() //почитай про этот метод
    {
        instance = this;
    }
Ejemplo n.º 20
0
 private void Awake()
 {
     instance    = this;
     _staminaBar = GetComponent <Slider>();
 }
Ejemplo n.º 21
0
    public static StaminaBar instance; //used for referensing the staminabar in MovementPlayerScript

    private void Awake()
    {
        instance = this;
    }
Ejemplo n.º 22
0
 void Start()
 {
     currentStaminaBar = ((StaminaBar)this.gameObject.GetComponent <StaminaBar> ());
 }
Ejemplo n.º 23
0
 public void SetStaminaBar(StaminaBar bar)
 {
     m_StaminaBar = bar;
 }
Ejemplo n.º 24
0
 private void Start()
 {
     charController = GetComponent <CharacterController>();
     animator       = gameObject.GetComponent <Animator>();
     staminaBar     = GetComponent <StaminaBar>();
 }
 // Start is called before the first frame update
 void Start()
 {
     eatableShark         = GetComponentInChildren <EatableShark>();
     powerupVisualEffects = GetComponent <PlayerPowerupEffects>();
     staminaBar           = GetComponentInChildren <StaminaBar>();
 }
Ejemplo n.º 26
0
 private void Awake()
 {
     st = GameObject.FindGameObjectWithTag("Stamina").GetComponent <StaminaBar>();
 }