Ejemplo n.º 1
0
    public IEnumerator ThirdPersonUserControl_Skill_U_Test_WithEnumeratorPasses()
    {
        UnityEngine.SceneManagement.SceneManager.LoadScene("Untitled");
        SetCharacter.istest = true;
        yield return(null);

        /// init GameObject
        GameObject hero = SetCharacter.hero;

        Assert.AreNotEqual(hero, null);
        hero.transform.position = new Vector3(12, 0, 15);
        hero.transform.rotation = Quaternion.identity;

        GameObject enemy = SetCharacter.enemy;

        Assert.AreNotEqual(enemy, null);
        enemy.transform.position = new Vector3(14, 0, 15);
        enemy.transform.rotation = Quaternion.identity;

        hero.transform.LookAt(enemy.transform);
        /// init script test
        yield return(null);

        ThirdPersonUserControl testcs   = hero.GetComponent <ThirdPersonUserControl> ();
        ThirdPersonCharacter   messagea = hero.GetComponent <ThirdPersonCharacter> ();
        attribute messageb = hero.GetComponent <attribute> ();

        float presp = messagea.m_MoveSpeedMultiplier;

        /// test Skill1
        messageb.Skill_Level [0] = 10;
        testcs.Operation_U();
        yield return(null);

        Assert.Greater(messagea.m_MoveSpeedMultiplier, presp);

        SetCharacter.istest = false;
    }