Пример #1
0
        public IEnumerator AttackAudioPlayNoDamageTest()
        {
            game = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Game"));
            yield return(new WaitForSecondsRealtime(1f));

            audio = GameObject.Find("SwordSlot").GetComponent <AttackAudio>();
            audio.PLayNoDamage();
            Assert.IsTrue(audio.Source.clip.name == "ВзмахМечом");
            GameObject.Destroy(game);
        }
Пример #2
0
        public IEnumerator AttackAudioPlayDamageTest()
        {
            game = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Game"));
            yield return(new WaitForSecondsRealtime(1f));

            audio = GameObject.Find("SwordSlot").GetComponent <AttackAudio>();
            audio.PlayDamage();
            yield return(new WaitForSecondsRealtime(0.05f));

            Assert.IsTrue(audio.Source.clip.name == "Удар мечом по противнику");
        }
Пример #3
0
    public bool isOpened = false; //Открыто ли внутриигровое меню

    void Start()
    {
        playerXP = PlayerXP.LoadFromJson("PX");
        //Commented for debug
        //playerXP = PlayerXP.LoadFromJson(PlayerPrefs.GetString("PlayerJson"));
        playerStats        = PlayerStats.LoadFromJson();
        xpBar              = xpBar.GetComponent <Image>();
        xpText             = xpBar.GetComponentInChildren <Text>();
        xpText.text        = playerXP.CurrentLevel.ToString();
        xpBar.fillAmount   = playerXP.GetFillAmount();
        attackAnim         = GetComponentInChildren <PlayerAttackAnimation>();
        healthText         = hpBar.GetComponentInChildren <Text>();
        hpBar              = hpBar.GetComponent <Image>();
        manaText           = manaBar.GetComponentInChildren <Text>();
        manaBar            = manaBar.GetComponent <Image>();
        nameText.text      = playerStats.name;
        money.text         = playerStats.money.ToString();
        inventory          = GetComponent <Inventory>();
        audio              = GetComponentInChildren <AttackAudio>();
        plusMoneyCoroutine = ShowAddedMoney();
    }
Пример #4
0
 void Start()
 {
     audio      = GetComponent <AttackAudio>();
     playerAnim = player.GetComponent <Animator>();
     animator   = GetComponent <Animator>();
 }
Пример #5
0
 public void DestroyAudio(AttackAudio aa)
 {
     aa.transform.SetParent(null);
     aa.gameObject.SetActive(false);
     obj2LifeTime[aa] = 0;
 }