Ejemplo n.º 1
0
    public IEnumerator FindAllOfType()
    {
        yield return(new WaitForSecondsRealtime(2));


        // - REcanvas 1
        // - REtext 4
        // - REimage 4
        // - REbutton 2
        // - REpanel 1


        // Select All
        REcanvas.Selector[] finded = REcanvas.Find();
        Debug.Log(finded.Length);
        Assert.IsTrue(finded.Length == 1);

        REtext.Selector[] finded2 = REtext.Find();
        Debug.Log(finded2.Length);
        Assert.IsTrue(finded2.Length == 4);

        REimage.Selector[] finded3 = REimage.Find();
        Debug.Log(finded3.Length);
        Assert.IsTrue(finded3.Length == 4);

        REbutton.Selector[] finded4 = REbutton.Find();
        Debug.Log(finded4.Length);
        Assert.IsTrue(finded4.Length == 2);

        REpanel.Selector[] finded5 = REpanel.Find();
        Debug.Log(finded5.Length);
        Assert.IsTrue(finded5.Length == 1);



        // Select All
        finded = REcanvas.Find("");
        Debug.Log(finded.Length);
        Assert.IsTrue(finded.Length == 1);

        finded2 = REtext.Find("");
        Debug.Log(finded2.Length);
        Assert.IsTrue(finded2.Length == 4);

        finded3 = REimage.Find("");
        Debug.Log(finded3.Length);
        Assert.IsTrue(finded3.Length == 4);

        finded4 = REbutton.Find("");
        Debug.Log(finded4.Length);
        Assert.IsTrue(finded4.Length == 2);

        finded5 = REpanel.Find("");
        Debug.Log(finded5.Length);
        Assert.IsTrue(finded5.Length == 1);



        yield return(new WaitForSecondsRealtime(2));
    }
Ejemplo n.º 2
0
    public IEnumerator FindByClassNameOfType()
    {
        yield return(new WaitForSecondsRealtime(2));


        // One classname
        var finded = REcanvas.Find(".Back");

        Debug.Log(finded.Length);
        Assert.IsTrue(finded.Length == 1);

        var finded2 = REtext.Find(".H1");

        Debug.Log(finded2.Length);
        Assert.IsTrue(finded2.Length == 2);

        var finded3 = REtext.Find(".Text");

        Debug.Log(finded3.Length);
        Assert.IsTrue(finded3.Length == 4);

        var finded4 = REimage.Find(".Title");

        Debug.Log(finded4.Length);
        Assert.IsTrue(finded4.Length == 0);

        var finded5 = REbutton.Find(".Button");

        Debug.Log(finded5.Length);
        Assert.IsTrue(finded5.Length == 2);

        var finded6 = REcanvas.Find(".White");

        Debug.Log(finded6.Length);
        Assert.IsTrue(finded6.Length == 0);



        // With AND
        var finded7 = REtext.Find(".H1&&.Text&&.Title");

        Debug.Log(finded7.Length);
        Assert.IsTrue(finded7.Length == 1);

        var finded8 = REbutton.Find(".Button&&Title");

        Debug.Log(finded8.Length);
        Assert.IsTrue(finded8.Length == 1);

        var finded9 = REimage.Find(".H1&&.Text");

        Debug.Log(finded9.Length);
        Assert.IsTrue(finded9.Length == 0);

        var finded10 = REcanvas.Find(".H1&&Pink");

        Debug.Log(finded10.Length);
        Assert.IsTrue(finded10.Length == 0);



        // With or
        var finded11 = REtext.Find(".Button||Text");

        Debug.Log(finded11.Length);
        Assert.IsTrue(finded11.Length == 4);

        var finded12 = REpanel.Find(".Back||H1||Text");

        Debug.Log(finded12.Length);
        Assert.IsTrue(finded12.Length == 1);

        var finded13 = REtext.Find(".Back||H1||Grey");

        Debug.Log(finded13.Length);
        Assert.IsTrue(finded13.Length == 2);



        yield return(new WaitForSecondsRealtime(2));
    }