Example #1
0
        private static void Awake(ref Hud __instance)
        {
            if (Main.showCharacterXP.Value && _bar == null)
            {
                _bar = XPBar.Awake(__instance);
            }

            if (useCustomHud)
            {
                // Try to support QuickSlots
                Compatibility.QuickSlotsHotkeyBar.Unanchor(__instance);
                // Load custom elements, before getting positions.
                if (Main.useCustomHealthBar.Value)
                {
                    CustomElements.HealthBar.Create();
                }
                if (Main.useCustomStaminaBar.Value)
                {
                    CustomElements.StaminaBar.Create();
                }
                if (Main.useCustomFoodBar.Value)
                {
                    CustomElements.FoodBar.Create();
                }

                CustomHud.Load(__instance);
                CustomHud.PositionTemplates();
            }
        }
Example #2
0
        private void Start()
        {
            var value = Mathf.RoundToInt(xp.RandomRange() + timeMultiplier.RandomRange() * SpeedIncreaser.Speed +
                                         elapsedMultiplier.RandomRange() * GameController.Elapsed);

            GetComponent <TextMeshPro>().text = $"+{value}xp";
            XPBar.AddXP(value);
        }
Example #3
0
 private void Start()
 {
     numEnemigos = FindObjectOfType <SpawnEnemigos>();
     colliderS   = GetComponent <SphereCollider>();
     healthBar   = FindObjectOfType <HealthBar>();
     expBar      = FindObjectOfType <XPBar>();
     playerS     = FindObjectOfType <PlayerMove>();
     player      = GameObject.FindGameObjectWithTag("Player").transform;
     anim        = GetComponent <Animator>();
     nav         = GetComponent <NavMeshAgent>();
     resetEnemys = FindObjectOfType <Respawn>();
     Nreina      = GameObject.Find("Nreina").GetComponent <Text>();
     aguaM       = FindObjectOfType <AguaMagica>();
 }
Example #4
0
 protected void Start()
 {
     mCurrentHP = mMaxHP;
     xpBar      = FindObjectOfType <XPBar>();
 }
Example #5
0
 private void Awake()
 {
     stats  = GetComponent <Stats>();
     xp     = GetComponent <XPBar>();
     player = GetComponent <PlayerControls>();
 }