Esempio n. 1
0
    //Установить поведение рыцаря
    public void SetKnightBehaviour(int health, SwordData swordData, int combometerNeededPoints)
    {
        foreach (GameObject sword in swords)
        {
            sword.SetActive(false);
        }

        if (gameManager == null)
        {
            gameManager = GameManager.instance;
        }

        if (rhythmManager == null)
        {
            rhythmManager = RhythmManager.instance;
        }

        if (attackMenu == null)
        {
            attackMenu = AttackMenu.instance;
        }

        currentHealth = health;
        defaultHealth = health;

        GameObject currentSword = swords[swordData.id];

        currentSword.SetActive(true);
        combometer = currentSword.transform.Find("Knight Combometer").GetComponent <KnightCombometer>();
        combometer.StartCombometer(combometerNeededPoints);
    }