Exemple #1
0
    public void Setup()
    {
        var rootGO = new GameObject("rootGo");

        _rootTransform = rootGO.transform;
        var canvasGO = new GameObject("Canvas", typeof(Canvas));

        canvasGO.transform.SetParent(rootGO.transform);
        var eventSystemGO = new GameObject("EventSystem", typeof(EventSystem));

        eventSystemGO.transform.SetParent(rootGO.transform);
        var testDropdownGO = new GameObject("TestDropdown", typeof(RectTransform), typeof(Dropdown));

        testDropdownGO.transform.SetParent(canvasGO.transform);
        _dropdown         = rootGO.GetComponentInChildren <Dropdown>();
        _dropdown.options = new System.Collections.Generic.List <Dropdown.OptionData>()
        {
            new Dropdown.OptionData("None"),
            new Dropdown.OptionData("Option 1"),
            new Dropdown.OptionData("Option 2"),
        };

        var agent = new NativeUnityDriverAgent();

        _driver          = new UnityDriver(agent);
        _dropdownElement = _driver.FindElement(By.Name("TestDropdown"));
    }
Exemple #2
0
    public void SetUp()
    {
        var agent = new NativeUnityDriverAgent();

        _driver     = new UnityDriver(agent);
        _testRootGo = new GameObject("TestRoot").transform;
    }
Exemple #3
0
    public void Setup()
    {
        var rootGO = new GameObject("rootGo");
        _rootTransform = rootGO.transform;
        var canvasGO = new GameObject("Canvas", typeof(Canvas));
        canvasGO.transform.SetParent(rootGO.transform);
        var eventSystemGO = new GameObject("EventSystem", typeof(EventSystem));
        eventSystemGO.transform.SetParent(rootGO.transform);
        var testButtonGO = new GameObject("TestButton", typeof(RectTransform), typeof(Button));
        testButtonGO.transform.SetParent(canvasGO.transform);
        _button = rootGO.GetComponentInChildren<Button>();

        var agent = new NativeUnityDriverAgent();
        var driver = new UnityDriver(agent);
        _buttonElement = driver.FindElement(By.Type<Button>());
    }
        public void Setup()
        {
            var agent = new NativeUnityDriverAgent();

            _driver = new UnityDriver(agent);
        }
Exemple #5
0
        public static void Init(ClientResourceData data)
        {
            IsUseMPQ = data.useMPQ;
            if (IsUseMPQ)
            {
                ResRoot = "mpq://";
            }
            else if (System.IO.File.Exists(UnityEngine.Application.dataPath + "/../resroot.txt"))
            {
                ResRoot = UnityEngine.Application.dataPath + "/.." + System.IO.File.ReadAllText(UnityEngine.Application.dataPath + "/../resroot.txt").Trim();
            }
            else
            {
                ResRoot = UnityEngine.Application.dataPath + data.relativeRootWhenStandalone;
                if (UnityEngine.Application.isEditor == false)
                {
                    switch (UnityEngine.Application.platform)
                    {
                    case UnityEngine.RuntimePlatform.Android:
                        ResRoot = UnityEngine.Application.streamingAssetsPath;
                        break;

                    case UnityEngine.RuntimePlatform.IPhonePlayer:
                        ResRoot = UnityEngine.Application.streamingAssetsPath;
                        break;
                    }
                }
            }

            UnityEngine.Debug.Log("ResRoot=" + ResRoot);
            GAME_EDITOR_ROOT         = ResRoot + data.relativeGameEditor;
            GAME_EDITOR_DATA_ROOT    = ResRoot + data.relativeGameEditor + "/data";
            STREAMING_ASSETS_ROOT    = ResRoot + data.relativeGameEditor;
            UI_EDITOR_ROOT           = ResRoot + data.relativeUIEdit;
            UI_EDITOR_RES_ROOT       = UI_EDITOR_ROOT + "/res";
            UI_EDITOR_XML_ROOT       = UI_EDITOR_ROOT + "/xml";
            CLIENT_SCRIPT_ROOT       = ResRoot + data.relativeScript;
            HTTP_DOWNLOAD_MPQ_SUFFIX = "updates_png";
            REDIRECT_IMAGE_SUFFIX    = ".png";
            switch (UnityEngine.Application.platform)
            {
            case UnityEngine.RuntimePlatform.Android:
                STREAMING_ASSETS_ROOT    = ResRoot + "/StreamingAssets/Android";
                HTTP_DOWNLOAD_MPQ_SUFFIX = "updates_etc";
                REDIRECT_IMAGE_SUFFIX    = ".etc.m3z";
                if (IsUseMPQ)
                {
                    UnityDriver.UnityInstance.RedirectImage = RedirectImage;
                }

                break;

            case UnityEngine.RuntimePlatform.IPhonePlayer:
                STREAMING_ASSETS_ROOT    = ResRoot + "/StreamingAssets/iOS";
                HTTP_DOWNLOAD_MPQ_SUFFIX = "updates_pvr";
                REDIRECT_IMAGE_SUFFIX    = ".pvr.m3z";
                if (IsUseMPQ)
                {
                    UnityDriver.UnityInstance.RedirectImage = RedirectImage;
                }

                break;

            default:
#if UNITY_ANDROID
                STREAMING_ASSETS_ROOT    = ResRoot + "/StreamingAssets/Android";
                HTTP_DOWNLOAD_MPQ_SUFFIX = "updates_etc/";
                REDIRECT_IMAGE_SUFFIX    = ".etc.m3z";
                if (IsUseMPQ)
                {
                    DeepCore.Unity3D.Impl.UnityDriver.UnityInstance.RedirectImage = RedirectImage;
                }
#elif UNITY_IOS
                STREAMING_ASSETS_ROOT    = ResRoot + "/StreamingAssets/iOS";
                HTTP_DOWNLOAD_MPQ_SUFFIX = "updates_pvr/";
                REDIRECT_IMAGE_SUFFIX    = ".pvr.m3z";
                if (IsUseMPQ)
                {
                    DeepCore.Unity3D.Impl.UnityDriver.UnityInstance.RedirectImage = RedirectImage;
                }
#endif
                break;
            }

            UnityDriver.SetDirver();
        }
 private void Start()
 {
     _buttonGridClickHandler.OnButtonClicked += ClickCorrespondingButton;
     _driver = new UnityDriverNative();
 }
 public async Task Setup()
 => _driver = await UnityDriverRemote.Attach(AGENT_PATH);