Пример #1
0
        void Start()
        {
            currentHealth = maxHealth;

            // Update player Bar
            if (playerBar != null)
            {
                playerBar.SetHealth((int)currentHealth);
                playerBar.SetMaxHealth((int)maxHealth);
            }
        }
Пример #2
0
 private void Start()
 {
     health = maxHealth;
     healthBar.SetMaxHealth(health);
     animationController = FindObjectOfType <AnimationController>();
     gameController      = FindObjectOfType <GameController>();
 }
Пример #3
0
 // Update is called once per frame
 void Start()
 {
     currentHealth = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
     attackDelay = 0.5f;
     CanAttack();
     block = false;
 }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
     enemies = new List <Transform>();
     for (int i = 0; i < enemyContainer.transform.childCount; i++)
     {
         enemies.Add(enemyContainer.transform.GetChild(i));
     }
 }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        playerHealthBar.SetMaxHealth(PlayerData.maxHealth);
        playerHealthBar.SetHealth(PlayerData.currentHealth);
        cooldownAttack.SetActive(false);
        cooldownSkill.SetActive(false);
        icon2X.SetActive(false);
        diePanal.SetActive(false);
        timeCooldownAttack = 0;
        timeCooldownSkill  = 0;


        socket = GetComponent <SocketIOComponent>();

        socket.On("SpawnMonster", SpawnMonster);
        socket.On("UpdateMonsterData", UpdateMonsterData);
        socket.On("MonsterAttack", MonsterAttack);
        socket.On("Heal", Heal);
        socket.On("BuffAttack", BuffAttack);
        socket.On("Buffend", Buffend);
        socket.On("MonsterDie", MonsterDie);
    }
Пример #6
0
    private void Awake()
    {
        PlayerData data = SaveSystem.LoadSave();

        if (data != null && SceneManager.GetActiveScene().name != "TutorialScene") // If save file exists AND its not a tutorial level
        {
            maxHealth          = data.maxHealth;
            currentHealth      = data.currentHealth;
            playerDamage       = data.playerDamage;
            playerRangedDamage = data.playerRangedDamage;
            playerRangedSpeed  = data.playerRangedSpeed;
            defence            = data.defence;
            numberOfJumps      = data.numberOfJumps;
            movementSpeed      = data.movementSpeed;
            money = data.money;
            Debug.Log("File succsessfully loaded");
        }
        else // if save file is not found, assing defaul values
        {
            SetDefaultStats();
        }

        text.text = money.ToString();
        playerHealthBar.SetMaxHealth(maxHealth);

        if (SceneManager.GetActiveScene().name == "HubScene")
        {
            currentHealth = maxHealth;
        }

        playerHealthBar.SetHealth(currentHealth);

        pauseUI      = GameObject.Find("Canvas").transform.Find("DeathScreen").gameObject;
        audioManager = GameObject.Find("AudioManager").gameObject;
        audio        = audioManager.GetComponent <AudioManager>();
    }
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = maxHealth;
     rb            = GetComponent <Rigidbody2D>();
     healthBar.SetMaxHealth(maxHealth);
 }
Пример #8
0
 public void Start()
 {
     currentHealth = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
 }
Пример #9
0
 private void Start()
 {
     hitPoints = maxHitPoints;
     healthBar.SetMaxHealth(maxHitPoints);
 }