Ejemplo n.º 1
0
    // public void LoadGame()
    // {
    //     gameBaseRun = (GameBase)GameObject.Instantiate(gameBase);
    //     gameBase.mainCamera = mainCamera;
    //     gameBaseRun.mainCamera = mainCamera;
    //     gameBaseRun.Init();
    // }

    public void OnShotPageFinish(ShotItemInfo info)
    {
        if (callbackShotPageFinish != null)
        {
            callbackShotPageFinish(info);
        }
    }
    void OnGotoScrenShot(int idx)
    {
        if (!deviceInfoNow.isMain)
        {
            return;
        }
        // if (shotBase != null)
        // {
        //     shotBase.ShowPage(idx);
        // }
        shotItemInfo = screenShotConfig.GetPage(deviceInfoNow, idx);

        NaviViewController navi = this.controller as NaviViewController;

        if (navi != null)
        {
            navi.Pop();
            navi.Push(shotItemInfo.controller);
        }

        if (shotItemInfo.controller != null)
        {
            shotItemInfo.controller.callbackUIFinish = OnUIDidFinishCallBack;
        }
    }
    public override void LayOut()
    {
        base.LayOut();
        screenDisplayWordWidth  = Common.ScreenToWorldWidth(mainCam, deviceInfoNow.width);
        screenDisplayWordHeight = Common.ScreenToWorldHeight(mainCam, deviceInfoNow.height);


        // {
        //     SpriteRenderer spRender = objSpriteBg.GetComponent<SpriteRenderer>();
        //     float scalex = screenDisplayWordWidth / spRender.size.x;
        //     float scaley = screenDisplayWordHeight / spRender.size.y;
        //     float scale = Mathf.Max(scalex, scaley);
        //     Debug.Log("spRender.size=" + spRender.size);
        //     objSpriteBg.transform.localScale = new Vector3(scalex, scaley, 1f);

        // }
        ShotItemInfo info = screenShotConfig.GetPage(deviceInfoNow, indexScreenShot);

        if (info != null)
        {
            if (info.controller != null)
            {
                info.controller.LayOutView();
            }
        }
    }
Ejemplo n.º 4
0
    public ShotItemInfo GetPage(ShotDeviceInfo dev, int idx)
    {
        ShotItemInfo     info       = new ShotItemInfo();
        UIViewController controller = null;

        info.isRealGameUI = true;
        if (dev.name == ScreenDeviceInfo.DEVICE_NAME_ICON)
        {
            controller = IconViewController.main;
            IconViewController.main.deviceInfo = dev;
        }
        else if (dev.name == ScreenDeviceInfo.DEVICE_NAME_AD)
        {
            controller = AdHomeViewController.main;
        }
        else if ((dev.name == ScreenDeviceInfo.DEVICE_NAME_COPY_RIGHT_HUAWEI) || (dev.name == ScreenDeviceInfo.DEVICE_NAME_COPY_RIGHT_HD_HUAWEI))
        {
            controller = CopyRightViewController.main;
            CopyRightViewController.main.deviceInfo = dev;
        }
        else
        {
            switch (idx)
            {
            case 0:
                LevelManager.main.gameLevel = 0;
                controller = GameViewController.main;
                break;

            case 1:
                controller = PlaceViewController.main;
                break;

            case 2:
                // LevelManager.main.gameLevel = 2;
                controller = LearnViewController.main;
                break;

            case 3:
                controller = GuankaViewController.main;
                break;

            case 4:
                controller = HomeViewController.main;
                break;

            default:
                controller = HomeViewController.main;
                break;
            }
        }
        info.controller = controller;

        return(info);
    }
    public ShotItemInfo GetPage(ShotDeviceInfo dev, int idx)
    {
        ShotItemInfo     info       = new ShotItemInfo();
        UIViewController controller = null;

        info.isRealGameUI = true;
        if (dev.name == UIScreenShotController.DEVICE_NAME_ICON)
        {
            controller = IconViewController.main;
            IconViewController.main.deviceInfo = dev;
        }
        else if (dev.name == UIScreenShotController.DEVICE_NAME_AD)
        {
            controller = AdHomeViewController.main;
        }
        else if (dev.name == UIScreenShotController.DEVICE_NAME_COPY_RIGHT_HUAWEI)
        {
            controller = CopyRightViewController.main;
            CopyRightViewController.main.deviceInfo = dev;
        }
        else
        {
            switch (idx)
            {
            // case 0:
            //     controller = HomeViewController.main;
            //     break;
            // case 1:
            //     controller = GuankaViewController.main;
            //     break;
            // case 2:
            //     controller = GameViewController.main;
            //     break;
            // case 3:
            //   //  controller = HowToPlayViewController.main;
            //     break;
            default:
                controller = CopyRightViewController.main;
                break;
            }
        }
        info.controller = controller;

        return(info);
    }