예제 #1
0
    void SetMailIntroduceInfo(ArkCrossEngine.MailInfo mi)
    {
        UnityEngine.Transform tfo = transform.Find("MetalFrame/RoleInfo/DragThing");
        if (tfo != null)
        {
            tfo.localPosition = new UnityEngine.Vector3(0.0f, 11.0f, 0.0f);
        }
        else
        {
            return;
        }
        UnityEngine.Transform tf = tfo.Find("Label");
        if (tf != null)
        {
            if (mi != null)
            {
                nowread = mi.m_MailGuid;
                UILabel ul = tf.gameObject.GetComponent <UILabel>();
                if (ul != null)
                {
                    string str = "";
                    //str += (mi.m_Title + "\n");
                    str    += (mi.m_SendTime.ToString("yyyy/MM/dd/HH/mm/ss") + "\n");
                    str    += mi.m_Text;
                    ul.text = str;
                }
                bool sign = false;
                UnityEngine.Vector3 pos = tf.localPosition;
                pos = new UnityEngine.Vector3(pos.x, pos.y - ul.localSize.y - 15, 0.0f);
                if (mi.m_Money != 0)
                {
                    sign = true;
                    tf   = tfo.Find("Money");
                    if (tf != null)
                    {
                        UnityEngine.GameObject go = tf.gameObject;
                        if (go != null)
                        {
                            UISprite us = go.GetComponent <UISprite>();

                            UnityEngine.Transform tf2 = go.transform.Find("Amount");
                            if (tf2 != null)
                            {
                                UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                if (ul1 != null)
                                {
                                    ul1.text = "X " + mi.m_Money;
                                }
                            }
                            go.transform.localPosition = pos;
                            NGUITools.SetActive(go, true);
                            if (us != null)
                            {
                                pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                            }
                        }
                    }
                }
                if (mi.m_Gold != 0)
                {
                    sign = true;
                    tf   = tfo.Find("Diamond");
                    if (tf != null)
                    {
                        UnityEngine.GameObject go = tf.gameObject;
                        if (go != null)
                        {
                            UISprite us = go.GetComponent <UISprite>();

                            UnityEngine.Transform tf2 = go.transform.Find("Amount");
                            if (tf2 != null)
                            {
                                UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                if (ul1 != null)
                                {
                                    ul1.text = "X " + mi.m_Gold;
                                }
                            }
                            go.transform.localPosition = pos;
                            NGUITools.SetActive(go, true);
                            if (us != null)
                            {
                                pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                            }
                        }
                    }
                }
                //         if (mi.m_Gold != 0) {
                //           sign = true;
                //           tf = tfo.Find("Exp");
                //           if (tf != null) {
                //             UnityEngine.GameObject go = tf.gameObject;
                //             if (go != null) {
                //               UISprite us = go.GetComponent<UISprite>();
                //
                //               UnityEngine.Transform tf2 = go.transform.Find("Amount");
                //               if (tf2 != null) {
                //                 UILabel ul1 = tf2.gameObject.GetComponent<UILabel>();
                //                 if (ul1 != null) {
                //                   ul1.text = "X " + mi.m_Gold;
                //                 }
                //               }
                //               go.transform.localPosition = pos;
                //               NGUITools.SetActive(go, true);
                //               if (us != null) {
                //                 pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                //               }
                //             }
                //           }
                //         }
                if (mi.m_Items != null)
                {
                    foreach (ArkCrossEngine.MailItem mailitem in mi.m_Items)
                    {
                        if (mailitem != null)
                        {
                            sign = true;
                            ArkCrossEngine.ItemConfig ic = ArkCrossEngine.LogicSystem.GetItemDataById(mailitem.m_ItemId);
                            if (ic != null)
                            {
                                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/Mail/MailAward"));
                                if (go != null)
                                {
                                    UITexture ut = go.GetComponent <UITexture>();
                                    if (ut != null)
                                    {
                                        UnityEngine.Texture tt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName);
                                        if (tt != null)
                                        {
                                            ut.mainTexture = tt;
                                        }
                                    }
                                    UnityEngine.Transform tf2 = go.transform.Find("Amount");
                                    if (tf2 != null)
                                    {
                                        UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                        if (ul1 != null)
                                        {
                                            ul1.text = "X " + mailitem.m_ItemNum;
                                        }
                                    }
                                    go = NGUITools.AddChild(tfo.gameObject, go);
                                    if (go != null)
                                    {
                                        go.transform.localPosition = pos;
                                        golist.Add(go);
                                    }
                                    pos = new UnityEngine.Vector3(pos.x, pos.y - ut.localSize.y - 15, 0.0f);
                                }
                            }
                        }
                    }
                }
                if (sign)
                {
                    tf = transform.Find("MetalFrame/RoleInfo/DragThing/ReceiveButton");
                    if (tf != null)
                    {
                        tf.localPosition = new UnityEngine.Vector3(0.0f, pos.y, 0.0f);
                        NGUITools.SetActive(tf.gameObject, true);
                    }
                }
            }
        }
        tf = transform.Find("sp_hongdi1/Label");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                ul.text = mi.m_Title;
            }
        }
        //     tf = transform.Find("sp_hongdi2/Label");
        //     if (tf != null) {
        //       UILabel ul = tf.gameObject.GetComponent<UILabel>();
        //       if (ul != null) {
        //         ul.text = mi.m_Title;
        //       }
        //     }
    }
예제 #2
0
    void InitSuitBtnScorll()
    {
        List <string> typeList = GameTableManager.Instance.GetGlobalConfigKeyList("SuitTypeOpen");

        m_grid_suitgrid.sorting = UIGrid.Sorting.Alphabetic;
        for (int i = 0; i < typeList.Count; i++)
        {
            string        key     = typeList[i];
            List <string> strList = GameTableManager.Instance.GetGlobalConfigList <string>("SuitTypeOpen", key);
            if (strList.Count != 5)
            {
                Engine.Utility.Log.Error("全局配置suittypeopen不符合长度 5");
                continue;
            }
            string suitBtnName = strList[3];
            if (!m_typeDic.ContainsKey(suitBtnName))
            {
                int type = 0;
                if (int.TryParse(key, out type))
                {
                    m_typeDic.Add(suitBtnName, type);
                }
            }
            bool      bOpen        = strList[0] == "1" ? true : false;
            Transform suitBtnTrans = m_grid_suitgrid.transform.Find(suitBtnName);
            if (suitBtnTrans == null)
            {
                GameObject go = NGUITools.AddChild(m_grid_suitgrid.gameObject, m_trans_SuitBtnItem.gameObject);
                if (go != null)
                {
                    go.SetActive(true);
                    suitBtnTrans = go.transform;
                    SuitBtnItem si = go.AddComponent <SuitBtnItem>();
                    if (si != null)
                    {
                        if (!suitDic.ContainsKey(suitBtnName))
                        {
                            suitDic.Add(suitBtnName, si);
                        }
                        si.InitSuitBtnItem(bOpen, strList[1], strList[4], strList[2], (name) =>
                        {
                            if (m_typeDic.ContainsKey(name))
                            {
                                int suitType = m_typeDic[name];


                                OnClickSuitBtn(suitType);
                            }
                        });
                        go.name = suitBtnName;
                    }
                }
            }
            UIButton btn = suitBtnTrans.Find("suitItem").GetComponent <UIButton>();
            if (btn != null)
            {
                //btn.isEnabled = bOpen;
                if (suitBtnName.Equals("1"))
                {
                    btn.SendMessage("OnClick", SendMessageOptions.DontRequireReceiver);
                }
            }
        }
    }
예제 #3
0
    /// <summary>
    /// Start the dragging operation.
    /// </summary>
    protected virtual void OnDragStart()
    {
        if (!enabled || mTouchID != int.MinValue)
        {
            return;
        }

        // If we have a restriction, check to see if its condition has been met first
        if (restriction != Restriction.None)
        {
            if (restriction == Restriction.Horizontal)
            {
                Vector2 delta = UICamera.currentTouch.totalDelta;
                if (Mathf.Abs(delta.x) < Mathf.Abs(delta.y))
                {
                    return;
                }
            }
            else if (restriction == Restriction.Vertical)
            {
                Vector2 delta = UICamera.currentTouch.totalDelta;
                if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y))
                {
                    return;
                }
            }
            else if (restriction == Restriction.PressAndHold)
            {
                if (mPressTime + 1f > RealTime.time)
                {
                    return;
                }
            }
        }

        if (cloneOnDrag)
        {
            GameObject clone = NGUITools.AddChild(transform.parent.gameObject, gameObject);
            clone.transform.localPosition = transform.localPosition;
            clone.transform.localRotation = transform.localRotation;
            clone.transform.localScale    = transform.localScale;

            UIButtonColor bc = clone.GetComponent <UIButtonColor>();
            if (bc != null)
            {
                bc.defaultColor = GetComponent <UIButtonColor>().defaultColor;
            }

            UICamera.Notify(UICamera.currentTouch.pressed, "OnPress", false);

            UICamera.currentTouch.pressed = clone;
            UICamera.currentTouch.dragged = clone;

            UIDragDropItem item = clone.GetComponent <UIDragDropItem>();
            item.Start();
            item.OnDragDropStart();
        }
        else
        {
            OnDragDropStart();
        }
    }
예제 #4
0
    /// <summary>
    /// Generate an item preview for the specified item.
    /// </summary>

    void GeneratePreview(Item item, UISnapshotPoint point)
    {
        if (item == null || item.prefab == null)
        {
            return;
        }

        // Render textures only work in Unity Pro
        if (!UnityEditorInternal.InternalEditorUtility.HasPro())
        {
            string path = "Assets/NGUI/Editor/Preview/" + item.prefab.name + ".png";
            item.tex        = File.Exists(path) ? (Texture2D)AssetDatabase.LoadAssetAtPath(path, typeof(Texture2D)) : null;
            item.dynamicTex = false;
            return;
        }

        int dim = (cellSize - 4) * 2;

        // Asset Preview-based approach is unreliable, and most of the time fails to provide a texture.
        // Sometimes it even throws null exceptions.
        //item.tex = AssetPreview.GetAssetPreview(item.prefab);
        //item.dynamicTex = false;
        //if (item.tex != null) return;

        // Let's create a basic scene
        GameObject root = EditorUtility.CreateGameObjectWithHideFlags(
            "Preview Root", HideFlags.HideAndDontSave);

        GameObject camGO = EditorUtility.CreateGameObjectWithHideFlags(
            "Preview Camera", HideFlags.HideAndDontSave, typeof(Camera));

        // Position it far away so that it doesn't interfere with existing objects
        root.transform.position = new Vector3(0f, 0f, 10000f);
        root.layer = item.prefab.layer;

        // Set up the camera
        Camera cam = camGO.GetComponent <Camera>();

        cam.renderingPath   = RenderingPath.Forward;
        cam.clearFlags      = CameraClearFlags.Skybox;
        cam.orthographic    = true;
        cam.backgroundColor = new Color(0f, 0f, 0f, 0f);
        cam.targetTexture   = (item.tex as RenderTexture);
        cam.enabled         = false;

        // Finally instantiate the prefab as a child of the root
        GameObject child = NGUITools.AddChild(root, item.prefab);

        // Try to find the snapshot point script
        if (point == null)
        {
            point = child.GetComponentInChildren <UISnapshotPoint>();
        }

        // If there is a UIRect present (widgets or panels) then it's an NGUI object
        RenderTexture rt = (SetupPreviewForUI(cam, root, child, point) || SetupPreviewFor3D(cam, root, child, point)) ?
                           cam.RenderToTexture(dim, dim) : null;

        // Did we have a different render texture? Get rid of it.
        if (item.tex != rt && item.tex != null && item.dynamicTex)
        {
            NGUITools.DestroyImmediate(item.tex);
            item.tex        = null;
            item.dynamicTex = false;
        }

        // Do we have a new render texture? Assign it.
        if (rt != null)
        {
            item.tex        = rt;
            item.dynamicTex = true;
        }

        // Clean up everything
        DestroyImmediate(camGO);
        DestroyImmediate(root);
    }
    void Update()
    {
        if (canRefresh == true)
        {
            if (step == nextSetp)
            {
                return;
            }
            if (step == 0)
            {
                background.gameObject.SetActive(true);
                showObjEff.SetActive(true);
                effectCard.init(mainCardOld, this, null);
                Card newCard = StorageManagerment.Instance.getRole(mainCardOld.uid);
                newQuality.spriteName = QualityManagerment.qualityIDToString(quNum) + "Bg";
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + newCard.getImageID(), effectCard.icon);

                TweenPosition tp = TweenPosition.Begin(effectCard.gameObject, 0.3f, effectCard.transform.localPosition);
                tp.from = new Vector3(500, effectCard.transform.localPosition.y, 0);
                EventDelegate.Add(tp.onFinished, () => {
                    StartCoroutine(Utils.DelayRun(() => {
                        nextSetp++;
                    }, 0.2f));
                }, true);
            }

            else if (step == 1)
            {
                NGUITools.AddChild(effectCard.gameObject, getEffectByQualiy().gameObject);
                StartCoroutine(Utils.DelayRun(() => {
                    nextSetp++;
                }, 1.5f));
            }

            else if (step == 2)
            {
                getEffectTextByQualiy().gameObject.SetActive(true);
                StartCoroutine(Utils.DelayRun(() => {
                    getEffectTextByQualiy().gameObject.SetActive(false);
                    nextSetp++;
                }, 1.6f));
            }

            else if (step == 3)
            {
                newQuality.alpha = 1;
                TweenScale ts = TweenScale.Begin(newQuality.gameObject, 0.3f, Vector3.one);
                ts.method = UITweener.Method.EaseIn;
                ts.from   = new Vector3(5, 5, 1);

                EventDelegate.Add(ts.onFinished, () => {
                    iTween.ShakePosition(transform.parent.gameObject, iTween.Hash("amount", new Vector3(0.03f, 0.03f, 0.03f), "time", 0.4f));
                    iTween.ShakePosition(transform.parent.gameObject, iTween.Hash("amount", new Vector3(0.01f, 0.01f, 0.01f), "time", 0.4f));
                    StartCoroutine(Utils.DelayRun(() => {
                        nextSetp++;
                    }, 1.8f));
                }, true);
            }

            else if (step == 4)
            {
                showEvoUI();

                TweenScale ts = TweenScale.Begin(showObj, 0.3f, Vector3.one);
                ts.method = UITweener.Method.EaseIn;
                ts.from   = new Vector3(5, 5, 1);

                EventDelegate.Add(ts.onFinished, () => {
                    iTween.ShakePosition(transform.parent.gameObject, iTween.Hash("amount", new Vector3(0.03f, 0.03f, 0.03f), "time", 0.4f));
                    iTween.ShakePosition(transform.parent.gameObject, iTween.Hash("amount", new Vector3(0.01f, 0.01f, 0.01f), "time", 0.4f));
//					string[] strs = SurmountManagerment.Instance.getAddEffectByString(mainCard);
//
//					if(strs == null)
//						return;
//
//					for (int i = 0; i < strs.Length; i++) {
//						UiManager.Instance.createMessageLintWindow(strs[i]);
//					}
                    StartCoroutine(Utils.DelayRun(() => {
                        nextSetp++;
                        initInfo();                        //初始化下一级突破条件以及界面
                        MaskWindow.UnlockUI();
                    }, 0.5f));
                }, true);
            }

            step++;
        }
    }
예제 #6
0
 // ------------------------------------------------------------------
 void Start()
 {
     NGUITools.AddChild(pObjChr, pData.ObjHuman);
     pLb_Money.text = "" + GameDefine.iPriceLayoff;
 }
    void CreateNewUI()
    {
                #pragma warning disable 0618
        NGUIEditorTools.RegisterUndo("Create New UI");

        // Root for the UI
        GameObject root = null;

        if (camType == CameraType.Simple2D)
        {
            root = new GameObject("UI Root (2D)");
            root.AddComponent <UIRoot>();
        }
        else
        {
            root = new GameObject((camType == CameraType.Advanced3D) ? "UI Root (3D)" : "UI Root");
            root.transform.localScale = new Vector3(0.0025f, 0.0025f, 0.0025f);

            UIRoot uiRoot = root.AddComponent <UIRoot>();
            uiRoot.automatic    = false;
            uiRoot.manualHeight = 800;
        }

        // Assign the layer to be used by everything
        root.layer = layer;

        // Figure out the depth of the highest camera
        if (camType == CameraType.None)
        {
            // No camera requested -- simply add a panel
            UIPanel panel = NGUITools.AddChild <UIPanel>(root.gameObject);
            Selection.activeGameObject = panel.gameObject;
        }
        else
        {
            int   mask          = 1 << layer;
            float depth         = -1f;
            bool  clearColor    = true;
            bool  audioListener = true;

            List <Camera> cameras = NGUIEditorTools.FindInScene <Camera>();

            foreach (Camera c in cameras)
            {
                // Choose the maximum depth
                depth = Mathf.Max(depth, c.depth);

                // Automatically exclude the specified layer mask from the camera if it can see more than that layer
                if (layer != 0 && c.cullingMask != mask)
                {
                    c.cullingMask = (c.cullingMask & (~mask));
                }

                // Only consider this object if it's active
                if (c.enabled && c.gameObject.active)
                {
                    clearColor = false;
                }

                // If this camera has an audio listener, we won't need to add one
                if (c.GetComponent <AudioListener>() != null)
                {
                    audioListener = false;
                }
            }

            // Camera and UICamera for this UI
            Camera cam = NGUITools.AddChild <Camera>(root);
            cam.depth           = depth + 1;
            cam.backgroundColor = Color.grey;
            cam.cullingMask     = mask;

            if (camType == CameraType.Simple2D)
            {
                cam.orthographicSize = 1f;
                cam.orthographic     = true;
                cam.nearClipPlane    = -2f;
                cam.farClipPlane     = 2f;
            }
            else
            {
                cam.nearClipPlane           = 0.1f;
                cam.farClipPlane            = 4f;
                cam.transform.localPosition = new Vector3(0f, 0f, -1.7f);
            }

            // We don't want to clear color if this is not the first camera
            if (cameras.Count > 0)
            {
                cam.clearFlags = clearColor ? CameraClearFlags.Skybox : CameraClearFlags.Depth;
            }

            // Add an audio listener if we need one
            if (audioListener)
            {
                cam.gameObject.AddComponent <AudioListener>();
            }

            // Add a UI Camera for event handling
            cam.gameObject.AddComponent <UICamera>();

            // Anchor is useful to have
            UIAnchor anchor = NGUITools.AddChild <UIAnchor>(cam.gameObject);
            anchor.uiCamera = cam;

            // Since the camera was brought back 700 units above, we should bring the anchor forward to compensate
            if (camType == CameraType.Advanced3D)
            {
                anchor.depthOffset = 1.7f;
            }

            // And finally -- the first UI panel
            UIPanel panel = NGUITools.AddChild <UIPanel>(anchor.gameObject);
            Selection.activeGameObject = panel.gameObject;
        }
                #pragma warning restore 0618
    }
예제 #8
0
    /// <summary>
    /// Create a popup list or a menu.
    /// </summary>

    void CreatePopup(GameObject go, bool isDropDown)
    {
        if (NGUISettings.atlas != null)
        {
            NGUIEditorTools.SpriteField("Foreground", "Foreground sprite (shown on the button)", NGUISettings.atlas, mListFG, OnListFG);
            NGUIEditorTools.SpriteField("Background", "Background sprite (envelops the options)", NGUISettings.atlas, mListBG, OnListBG);
            NGUIEditorTools.SpriteField("Highlight", "Sprite used to highlight the selected option", NGUISettings.atlas, mListHL, OnListHL);
        }

        if (ShouldCreate(go, NGUISettings.atlas != null && NGUISettings.font != null))
        {
            int depth = NGUITools.CalculateNextDepth(go);
            go      = NGUITools.AddChild(go);
            go.name = isDropDown ? "Popup List" : "Popup Menu";

            UIAtlas.Sprite sphl = NGUISettings.atlas.GetSprite(mListHL);
            UIAtlas.Sprite spfg = NGUISettings.atlas.GetSprite(mListFG);

            Vector2 hlPadding = new Vector2(
                Mathf.Max(4f, sphl.inner.xMin - sphl.outer.xMin),
                Mathf.Max(4f, sphl.inner.yMin - sphl.outer.yMin));

            Vector2 fgPadding = new Vector2(
                Mathf.Max(4f, spfg.inner.xMin - spfg.outer.xMin),
                Mathf.Max(4f, spfg.inner.yMin - spfg.outer.yMin));

            // Background sprite
            UISprite sprite = NGUITools.AddSprite(go, NGUISettings.atlas, mListFG);
            sprite.depth = depth;
            sprite.atlas = NGUISettings.atlas;
            sprite.pivot = UIWidget.Pivot.Left;
            sprite.transform.localScale    = new Vector3(150f + fgPadding.x * 2f, NGUISettings.font.size + fgPadding.y * 2f, 1f);
            sprite.transform.localPosition = Vector3.zero;
            sprite.MakePixelPerfect();

            // Text label
            UILabel lbl = NGUITools.AddWidget <UILabel>(go);
            lbl.font  = NGUISettings.font;
            lbl.text  = go.name;
            lbl.pivot = UIWidget.Pivot.Left;
            lbl.cachedTransform.localPosition = new Vector3(fgPadding.x, 0f, 0f);
            lbl.MakePixelPerfect();

            // Add a collider
            NGUITools.AddWidgetCollider(go);

            // Add the popup list
            UIPopupList list = go.AddComponent <UIPopupList>();
            list.atlas            = NGUISettings.atlas;
            list.font             = NGUISettings.font;
            list.backgroundSprite = mListBG;
            list.highlightSprite  = mListHL;
            list.padding          = hlPadding;
            if (isDropDown)
            {
                list.textLabel = lbl;
            }
            for (int i = 0; i < 5; ++i)
            {
                list.items.Add(isDropDown ? ("List Option " + i) : ("Menu Option " + i));
            }

            // Add the scripts
            go.AddComponent <UIButton>().tweenTarget = sprite.gameObject;
            go.AddComponent <UIButtonSound>();

            Selection.activeGameObject = go;
        }
    }
예제 #9
0
        private IEnumerator St_InitListItem()
        {
            //  ItemTable.transform.ClearChild();
            ItemList.ApplyAllItem(c => c.gameObject.SetActive(false));
            InitItemFileinfoList();
            if (ForgeRecipeDataList.Count > 0)
            {
//                if(ForgeRecipeDataList.Count>=4)
//                {

                for (int i = 0; i < ForgeRecipeDataList.Count; i++)
                {
                    if (ItemList.Count > i)
                    {
                        ItemList[i].gameObject.SetActive(true);
                        ItemList[i].InitItemData(ForgeRecipeDataList[i]);
                    }
                    else
                    {
                        Item_go      = NGUITools.AddChild(ItemTable.gameObject, FriendListItemPrefab);
                        Item_go.name = FriendListItemPrefab.name + i;
                        Item_go.RegisterBtnMappingId(ForgeRecipeDataList[i].ForgeID, UI.MainUI.UIType.Forging, BtnMapId_Sub.Forging_ForgingItem);
                        Item_go.AddComponent <UIDragPanelContents>();
                        ForgingListItem Sc_item = Item_go.GetComponent <ForgingListItem>();
                        Sc_item.InitItemData(ForgeRecipeDataList[i]);
                        Sc_item.OnClickCallBack = ItemSelectedEventHandle;
                        ItemList.Add(Sc_item);
                    }
                }
                if (ForgingPanelManager.GetInstance().CurrentForingType == CurrentListType)
                {
                    if (SelectedItem != null)
                    {
                        SelectedItem.BeSelected();
                    }
                    else
                    {
                        ItemList[0].BeSelected();
                    }
                }
                else
                {
                    ItemList[0].BeSelected();
                }
                CurrentListType = ForgingPanelManager.GetInstance().CurrentForingType;
                yield return(null);

                ItemTable.Reposition();
                m_dragPanelComp.ResetPosition();
                //  yield return null;
                //如果有引导箭头,不允许拖动
                if (HasGuideArrow)
                {
                    m_dragPanelComp.LockDraggable = true;
                }
                else
                {
                    m_dragPanelComp.LockDraggable = false;
                }
            }
            else
            {
            }
        }
예제 #10
0
    void updateEvent(int year, int month, int day)
    {
        Transform trans = list_container.FindChild("events");

        MyUtilTools.clearChild(trans);
        GameObject events = trans.gameObject;
        Dictionary <byte, List <TimeLine> > maps = search(year, month, day);

        if (maps.Count > 0)
        {
            if (timeEvent == null)
            {
                timeEvent = Resources.Load <GameObject>("prefabs/time-list");
            }
            int   count = 0;
            float staty = 0;
            for (byte i = 1; i < 5; i++)
            {
                if (maps.ContainsKey(i))
                {
                    List <TimeLine> lis = maps[i];
                    foreach (TimeLine timeLine in lis)
                    {
                        GameObject time_event = NGUITools.AddChild(events, timeEvent);
                        GameObject time_obj   = time_event.transform.FindChild("time").gameObject;
                        if (count == 0)
                        {
                            time_obj.GetComponent <UILabel>().text = timeLine.time;
                        }
                        else
                        {
                            time_obj.SetActive(false);
                        }
                        UILabel label_value = time_event.transform.FindChild("value").GetComponent <UILabel>();
                        MyUtilTools.insertStr(label_value, timeLine.title, 400);
                        string title_str = "";
                        Color  color     = Color.black;
                        if (timeLine.type == 1)
                        {
                            title_str = "【申购】";
                            color     = Color.red;
                            label_value.transform.localPosition = new Vector3(50, 50, 0);
                        }
                        else if (timeLine.type == 2)
                        {
                            title_str = "【托管预约】";
                            color     = new Color(32f / 255f, 172f / 255f, 131f / 255f);
                            label_value.transform.localPosition = new Vector3(100, 50, 0);
                        }
                        else if (timeLine.type == 3)
                        {
                            title_str = "【托管入库】";
                            color     = new Color(121f / 255f, 170f / 255f, 217f / 255f);
                            label_value.transform.localPosition = new Vector3(100, 50, 0);
                        }
                        else if (timeLine.type == 4)
                        {
                            title_str = "【重要提示】";
                            color     = new Color(1f, 96f / 255f, 0);
                            label_value.transform.localPosition = new Vector3(100, 50, 0);
                        }
                        UILabel label_title = time_event.transform.FindChild("title").GetComponent <UILabel>();
                        label_title.text  = title_str;
                        label_title.color = color;
                        UIButton      detail_button = label_value.transform.GetComponent <UIButton>();
                        EventDelegate detail_event  = new EventDelegate(this, "goToDetail");
                        detail_event.parameters[0]     = new EventDelegate.Parameter();
                        detail_event.parameters[0].obj = timeLine;
                        detail_button.onClick.Add(detail_event);
                        UIButton      notify_button = time_event.transform.FindChild("locker").GetComponent <UIButton>();
                        EventDelegate notify_event  = new EventDelegate(this, "doNotify");
                        notify_event.parameters[0]     = new EventDelegate.Parameter();
                        notify_event.parameters[0].obj = timeLine;
                        notify_button.onClick.Add(notify_event);
                        time_event.transform.localPosition = new Vector3(0, staty, 0);
                        staty -= 280;
                        count++;
                    }
                }
            }
        }
    }
예제 #11
0
    /// <summary>
    /// Progress bar creation function.
    /// </summary>

    void CreateSlider(GameObject go, bool slider)
    {
        if (NGUISettings.atlas != null)
        {
            NGUIEditorTools.SpriteField("Empty", "Sprite for the background (empty bar)", NGUISettings.atlas, mSliderBG, OnSliderBG);
            NGUIEditorTools.SpriteField("Full", "Sprite for the foreground (full bar)", NGUISettings.atlas, mSliderFG, OnSliderFG);

            if (slider)
            {
                NGUIEditorTools.SpriteField("Thumb", "Sprite for the thumb indicator", NGUISettings.atlas, mSliderTB, OnSliderTB);
            }
        }

        if (ShouldCreate(go, NGUISettings.atlas != null))
        {
            int depth = NGUITools.CalculateNextDepth(go);
            go      = NGUITools.AddChild(go);
            go.name = slider ? "Slider" : "Progress Bar";

            // Background sprite
            UIAtlas.Sprite bgs  = NGUISettings.atlas.GetSprite(mSliderBG);
            UISprite       back = (UISprite)NGUITools.AddWidget <UISprite>(go);

            back.type                    = (bgs.inner == bgs.outer) ? UISprite.Type.Simple : UISprite.Type.Sliced;
            back.name                    = "Background";
            back.depth                   = depth;
            back.pivot                   = UIWidget.Pivot.Left;
            back.atlas                   = NGUISettings.atlas;
            back.spriteName              = mSliderBG;
            back.transform.localScale    = new Vector3(200f, 30f, 1f);
            back.transform.localPosition = Vector3.zero;
            back.MakePixelPerfect();

            // Foreground sprite
            UIAtlas.Sprite fgs   = NGUISettings.atlas.GetSprite(mSliderFG);
            UISprite       front = NGUITools.AddWidget <UISprite>(go);
            front.type                    = (fgs.inner == fgs.outer) ? UISprite.Type.Filled : UISprite.Type.Sliced;
            front.name                    = "Foreground";
            front.pivot                   = UIWidget.Pivot.Left;
            front.atlas                   = NGUISettings.atlas;
            front.spriteName              = mSliderFG;
            front.transform.localScale    = new Vector3(200f, 30f, 1f);
            front.transform.localPosition = Vector3.zero;
            front.MakePixelPerfect();

            // Add a collider
            if (slider)
            {
                NGUITools.AddWidgetCollider(go);
            }

            // Add the slider script
            UISlider uiSlider = go.AddComponent <UISlider>();
            uiSlider.foreground = front.transform;

            // Thumb sprite
            if (slider)
            {
                UIAtlas.Sprite tbs = NGUISettings.atlas.GetSprite(mSliderTB);
                UISprite       thb = NGUITools.AddWidget <UISprite>(go);

                thb.type       = (tbs.inner == tbs.outer) ? UISprite.Type.Simple : UISprite.Type.Sliced;
                thb.name       = "Thumb";
                thb.atlas      = NGUISettings.atlas;
                thb.spriteName = mSliderTB;
                thb.transform.localPosition = new Vector3(200f, 0f, 0f);
                thb.transform.localScale    = new Vector3(20f, 40f, 1f);
                thb.MakePixelPerfect();

                NGUITools.AddWidgetCollider(thb.gameObject);
                thb.gameObject.AddComponent <UIButtonColor>();
                thb.gameObject.AddComponent <UIButtonScale>();

                uiSlider.thumb = thb.transform;
            }
            uiSlider.sliderValue = 1f;

            // Select the slider
            Selection.activeGameObject = go;
        }
    }
예제 #12
0
    void goToDetail(TimeLine timeLine)
    {
        needshow[0].transform.FindChild("list").gameObject.SetActive(false);
        Transform detail_trans = needshow[0].transform.FindChild("detail");

        detail_trans.gameObject.SetActive(true);
        callback = new EventDelegate(backFromDetail);
        if (detail_container == null)
        {
            detail_container = detail_trans.FindChild("body").FindChild("container");
        }
        MyUtilTools.clearChild(detail_container);
        detail_container.parent.GetComponent <UIPanel>().clipOffset = Vector2.zero;
        detail_container.parent.localPosition = new Vector3(0, 0, 0);
        GameObject newObj    = new GameObject();
        GameObject title_obj = NGUITools.AddChild(detail_container.gameObject, newObj);

        title_obj.transform.localPosition = new Vector3(0, 520, 0);
        title_obj.name = "title";
        UILabel title_label = title_obj.AddComponent <UILabel>();

        title_label.trueTypeFont = labelFont;
        title_label.fontSize     = 50;
        title_label.text         = timeLine.title;
        title_label.width        = 800;
        title_label.height       = 60;
        title_label.spacingX     = 5;
        title_label.spacingY     = 5;
        title_label.maxLineCount = 100;
        title_label.color        = Color.black;
        title_label.depth        = 2;
        float starty = 450;

        for (int i = 0; i < timeLine.contents.Count; i++)
        {
            GameObject  sun     = null;
            TimeContent content = timeLine.contents[i];
            int         height  = 0;
            float       offset  = 0;
            if (content.type == 0)
            {
                sun      = NGUITools.AddChild(detail_container.gameObject, title_obj);
                sun.name = "content" + i;
                UILabel sun_label = sun.GetComponent <UILabel>();
                sun_label.fontSize = 40;
                sun_label.width    = 750;
                sun_label.height   = 10000;
                sun_label.text     = content.str_value;
                int row   = MyUtilTools.computeRow(sun_label);
                int total = row * (sun_label.fontSize + title_label.spacingY);
                sun_label.height = total;
                height           = total;
                offset           = total / 2;
            }
            else
            {
                sun      = NGUITools.AddChild(detail_container.gameObject, newObj);
                sun.name = "content" + i;
                UITexture texture = sun.AddComponent <UITexture>();
                texture.width  = 512;
                texture.height = 512;
                JustRun.Instance.loadPic(content.str_value, texture);
                height = texture.height + 20;
                offset = texture.height / 2;
            }
            starty -= height;
            sun.transform.localPosition = new Vector3(0, starty + offset, 0);
        }
        Destroy(newObj);
    }
예제 #13
0
        internal void AddPaddingHeader()
        {
            GameObject padding = NGUITools.AddChild(uiGrid.gameObject);

            lastHeader = new Header(padding);
        }
예제 #14
0
    private void InitWidgets()
    {
        dic = DataManager.Manager <Mall_NpcShopManager>().Tabs;
        RegisterGlobalUIEvent(true);
        GameObject preObj = m_trans_UIItemInfoGrid.gameObject;

        if (null != preObj && null != m_trans_MallBaseGridRoot && null == m_mallItemBaseGrid)
        {
            GameObject cloneObj = NGUITools.AddChild(m_trans_MallBaseGridRoot.gameObject, preObj);
            if (null != cloneObj)
            {
                m_mallItemBaseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
                if (null == m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid = cloneObj.AddComponent <UIItemInfoGrid>();
                }
                if (null != m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid.RegisterUIEventDelegate((eventType, data, param) =>
                    {
                        if (eventType == UIEventType.Click)
                        {
                            if (null != CurrentMallData && null != CurrentMallData.LocalItem)
                            {
                                TipsManager.Instance.ShowItemTips(CurrentMallData.LocalItem);
                            }
                        }
                    });
                }
            }
            m_trans_MallBaseGridRoot.localScale = new Vector3(0.9f, 0.9f, 0.9f);
        }
        if (null != m_trans_PurchaseCostGrid)
        {
            if (null == m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_PurchaseCostGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }
        if (null != m_trans_OwnMoneyGrid)
        {
            if (null == m_trans_OwnMoneyGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_OwnMoneyGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }

        if (null != m_ctor_MallScrollView)
        {
            if (null == m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_PurchaseCostGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
            if (null == m_trans_OwnMoneyGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_OwnMoneyGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }

        if (null != m_ctor_CategoryTagContent)
        {
            m_ctor_CategoryTagContent.RefreshCheck();
            m_ctor_CategoryTagContent.Initialize <UITabGrid>(m_trans_UITabGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }

        if (null != m_ctor_RightTabRoot)
        {
            List <string> m_lstDepende = new List <string>();
            m_ctor_RightTabRoot.RefreshCheck();
            m_ctor_RightTabRoot.Initialize <UIToggleGrid>(m_trans_TogglePanel.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }

        if (null != m_ctor_MallScrollView)
        {
            m_ctor_MallScrollView.RefreshCheck();
            m_ctor_MallScrollView.Initialize <UIMallGrid>(m_trans_UIMallGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }
    }
    IEnumerator LoadDataCo()
    {
        yield return(new WaitForSeconds(.1f));

        if (listGridRoot != null)
        {
            foreach (Transform item in listGridRoot.transform)
            {
                Destroy(item.gameObject);
            }

            List <AppContentAsset> assets = AppContentAssets.Instance.GetAll();

            LogUtil.Log("Load AppContentAsset: assets.Count: " + assets.Count);

            int i = 0;

            //int totalPoints = 0;

            foreach (AppContentAsset asset in assets)
            {
                if (filterType != UIPanelDialogEditItemsFilter.all)
                {
                    if (asset.key != filterType)
                    {
                        continue;
                    }
                }

                GameObject item = NGUITools.AddChild(listGridRoot, listItemPrefab);
                item.name = "AssetItem" + i;
                item.transform.FindChild("LabelName").GetComponent <UILabel>().text = asset.display_name;
                //item.transform.FindChild("LabelDescription").GetComponent<UILabel>().text = achievement.description;

                GameObject gameLevelItemObject = item.transform.FindChild("GameLevelItemObject").gameObject;

                // clear current items

                foreach (Transform t in gameLevelItemObject.transform)
                {
                    Destroy(t.gameObject);
                }

                //LogUtil.Log("Load AppContentAsset: gameLevelItemObject.transform: " + gameLevelItemObject.transform.childCount);

                if (GameDraggableEditor.Instance == null)
                {
                    yield break;
                }
                //
                //LogUtil.Log("Load AppContentAsset: GameDraggableEditor: " + true);

                string assetCode = asset.code;
                if (assetCode.Contains("portal-"))
                {
                    assetCode = assetCode + "-sm";
                }

                GameObject go = GameDraggableEditor.LoadSpriteUI(
                    gameLevelItemObject, assetCode, Vector3.one);

                gameLevelItemObject.ChangeLayersRecursively("UIEditor");

                //LogUtil.Log("Load AppContentAsset: go: " + go);

                float maxSize = .8f;

                if (go != null)
                {
                    PackedSprite sprite = go.GetComponent <PackedSprite>();
                    if (sprite != null)
                    {
                        float adjust = 1;

                        if (sprite.height > sprite.width)
                        {
                            if (sprite.height > maxSize)
                            {
                                adjust = maxSize / sprite.height;
                            }
                        }
                        else
                        {
                            if (sprite.width > maxSize)
                            {
                                adjust = maxSize / sprite.width;
                            }
                        }

                        go.transform.localScale = go.transform.localScale.WithX(adjust).WithY(adjust).WithZ(adjust);
                    }
                    else
                    {
                        float adjust = 1;

                        Collider col = go.GetComponent <Collider>();
                        if (col != null)
                        {
                            Bounds bounds = col.bounds;

                            if (bounds.size.x > bounds.size.y)
                            {
                                if (bounds.size.y > maxSize)
                                {
                                    adjust = maxSize / bounds.size.x;
                                }
                            }
                            else
                            {
                                if (bounds.size.x > maxSize)
                                {
                                    adjust = maxSize / bounds.size.y;
                                }
                            }
                        }
                        adjust = adjust / 2;
                        go.transform.localScale = go.transform.localScale.WithX(adjust).WithY(adjust).WithZ(adjust);
                    }
                }

                item.transform.FindChild("ButtonGameLevelItemObject").GetComponent <UIButton>().name
                    = "ButtonGameLevelItemObject$" + asset.code;                             ///levels[y].name;

                if (filterType == UIPanelDialogEditItemsFilter.all)
                {
                }

                i++;
            }

            yield return(new WaitForEndOfFrame());

            listGridRoot.GetComponent <UIGrid>().Reposition();
            yield return(new WaitForEndOfFrame());
        }
    }
예제 #16
0
    /// <summary>
    /// Find the UIPanel responsible for handling the specified transform.
    /// </summary>

    static public UIPanel Find(Transform trans, bool createIfMissing)
    {
        Transform origin = trans;
        UIPanel   panel  = null;

        while (panel == null && trans != null)
        {
            panel = trans.GetComponent <UIPanel>();
            if (panel != null)
            {
                break;
            }
            if (trans.parent == null)
            {
                break;
            }
            trans = trans.parent;
        }

        if (createIfMissing && panel == null)
        {
            mRebuild = true;

            UIRoot root = NGUITools.FindInParents <UIRoot>(origin.gameObject);

            if (root == null && UIRoot.list.Count > 0)
            {
                root = UIRoot.list[0];
            }

            if (root == null)
            {
                GameObject go = NGUITools.AddChild(null, false);
                go.name  = "UI Root";
                go.layer = origin.gameObject.layer;
                root     = go.AddComponent <UIRoot>();
            }

            panel = root.GetComponentInChildren <UIPanel>();

            if (panel == null)
            {
                Camera cam = NGUITools.AddChild <Camera>(root.gameObject, false);
                cam.gameObject.AddComponent <UICamera>();
                cam.orthographic     = true;
                cam.orthographicSize = 1;
                cam.nearClipPlane    = -10;
                cam.farClipPlane     = 10;
                cam.clearFlags       = (Camera.main != null) ? CameraClearFlags.Depth : CameraClearFlags.Color;
                cam.cullingMask      = (1 << root.gameObject.layer);

                if (Camera.main != null)
                {
                    Camera.main.cullingMask = (Camera.main.cullingMask & (~cam.cullingMask));
                }

                UIAnchor anch = NGUITools.AddChild <UIAnchor>(cam.gameObject, false);
                panel = NGUITools.AddChild <UIPanel>(anch.gameObject, false);
#if UNITY_EDITOR
                UnityEditor.Selection.activeGameObject = panel.gameObject;
#endif
            }

            trans.parent        = panel.transform;
            trans.localScale    = Vector3.one;
            trans.localPosition = Vector3.zero;
            SetChildLayer(panel.cachedTransform, panel.cachedGameObject.layer);
        }
        return(panel);
    }
예제 #17
0
    public void SceneChange(int num)
    {
        GameObject obj = NGUITools.AddChild(_Parent, _FadeIn);

        StartCoroutine(SceneChangeDelay(1.5f, num));
    }
예제 #18
0
        private void mod_Start()
        {
            //NEW CODE HERE
            var exampleCheckbox =
                this.ComponentsInDescendants <UIOptionsTag>(true).Single(
                    opt => opt.Checkbox && opt.BoolSuboption == GameOption.BoolOption.SCREEN_EDGE_SCROLLING)
                .transform;

            Prefabs.QuickCheckbox = exampleCheckbox.Component <UIOptionsTag>();
            Prefabs.QuickDropdown = ResolutionDropdown.transform.parent.gameObject;
            Prefabs.QuickButton   = UIOptionsManager.Instance.PageButtonPrefab.gameObject;
            Prefabs.QuickPage     = Pages[5];

            var pageParent = Pages[5].transform.parent;

            var ieModOptions     = new QuickPage(pageParent, "IEModOptions_Settings_Page");
            var ieModDisposition = new QuickPage(pageParent, "IEModOptions_Disposition_Page");

            Pages = Pages.Concat(new[] {
                ieModOptions.GameObject,
                ieModDisposition.GameObject
            }).ToArray();

            //ORIGINAL CODE
            this.SetMenuLayout(OptionsMenuLayout.InGame);
            this.QuitButton.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(this.QuitButton.onClick, new UIEventListener.VoidDelegate(this.OnQuitClicked));
            this.SaveButton.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(this.SaveButton.onClick, new UIEventListener.VoidDelegate(this.OnSaveClicked));
            this.LoadButton.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(this.LoadButton.onClick, new UIEventListener.VoidDelegate(this.OnLoadClicked));

            this.m_Options = this.ComponentsInDescendants <UIOptionsTag>(true);

            //NEW CODE
            var quickFactory = new QuickFactory()
            {
                CurrentParent = Pages[7].transform
            };

            //File.WriteAllText("ComboboxDump.txt", UnityObjectDumper.PrintUnityGameObject(exampleDropdown.gameObject, null, x => false));
            quickFactory.CurrentParent = Pages[7].transform;

            var column1Top = new Vector3(-210, 330, 0);

            //The following are the controls that appear in the GUI of the mod.
            _oneTooltip = quickFactory.Checkbox(() => IEModOptions.OneTooltip);
            _oneTooltip.Transform.localPosition = column1Top;

            _disableEngagement = quickFactory.Checkbox(() => IEModOptions.DisableEngagement);
            _disableEngagement.LocalPosition = column1Top.Plus(y: -30);

            _blueCircles = quickFactory.Checkbox(() => IEModOptions.BlueCircles);
            _blueCircles.Transform.localPosition = column1Top.Plus(y: -60);

            _blueCirclesBg = quickFactory.Checkbox(() => IEModOptions.BlueCirclesBG);
            _blueCirclesBg.Transform.localPosition = column1Top.Plus(x: +30, y: -90);

            _blueCircles.IsChecked.HasChanged += x => {
                if (x.Value)
                {
                    _blueCirclesBg.OptionsTagComponent.Enable();
                }
                else
                {
                    _blueCirclesBg.IsChecked.Value = false;
                    _blueCirclesBg.OptionsTagComponent.Disable();
                }
            };
            _blueCircles.IsChecked.NotifyChange();

            _alwaysShowCircles = quickFactory.Checkbox(() => IEModOptions.AlwaysShowCircles);
            _alwaysShowCircles.Transform.localPosition = column1Top.Plus(y: -120);

            _unlockCombatInv = quickFactory.Checkbox(() => IEModOptions.UnlockCombatInv);
            _unlockCombatInv.Transform.localPosition = column1Top.Plus(y: -150);

            _npcDispositionFix = quickFactory.Checkbox(() => IEModOptions.NPCDispositionFix);
            _npcDispositionFix.Transform.localPosition = column1Top.Plus(y: -180);

            _removeMovingRecovery = quickFactory.Checkbox(() => IEModOptions.RemoveMovingRecovery);
            _removeMovingRecovery.Transform.localPosition = column1Top.Plus(y: -210);

            //_fastSneak = quickFactory.Checkbox(() => IEModOptions.FastSneak);
            //_fastSneak.Transform.localPosition = column1Top.Plus(y:-240);

            /* * * TJH 8/28/2015. Improved AI Excluded from v2.0
             *          _improvedAi = quickFactory.Checkbox(() => IEModOptions.ImprovedAI);
             *          _improvedAi.Transform.localPosition = column1Top.Plus(y: -270);
             * * */


            _disableFriendlyFire = quickFactory.Checkbox(() => IEModOptions.DisableFriendlyFire);
            /* * * TJH 8/28/2015. Moved up since Improved AI and Fast Sneak are no longer present here * * */
            _disableFriendlyFire.Transform.localPosition = column1Top.Plus(y: -240);



            var column2Top = column1Top.Plus(x: +420);

            _lootShuffler = quickFactory.Checkbox(() => IEModOptions.LootShuffler);
            _lootShuffler.Transform.localPosition = column2Top;

            _gameSpeed = quickFactory.Checkbox(() => IEModOptions.GameSpeedMod);
            _gameSpeed.Transform.localPosition = column2Top.Plus(y: -30);

            _combatOnly = quickFactory.Checkbox(() => IEModOptions.CombatOnlyMod);
            _combatOnly.Transform.localPosition = column2Top.Plus(y: -60);

            _bonusSpellsPerDay = quickFactory.Checkbox(() => IEModOptions.BonusSpellsPerDay);
            _bonusSpellsPerDay.Transform.localPosition = column2Top.Plus(y: -90);

            _targetTurnedEnemies = quickFactory.Checkbox(() => IEModOptions.TargetTurnedEnemies);
            _targetTurnedEnemies.Transform.localPosition = column2Top.Plus(y: -120);

            _fixBackerNames = quickFactory.Checkbox(() => IEModOptions.FixBackerNames);
            _fixBackerNames.Transform.localPosition = column2Top.Plus(y: -150);

            _disableBackerDialog = quickFactory.Checkbox(() => IEModOptions.DisableBackerDialogs);
            _disableBackerDialog.Transform.localPosition = column2Top.Plus(x: +30, y: -180);

            _fixBackerNames.IsChecked.OnChange(v => {
                if (v.Value)
                {
                    _disableBackerDialog.OptionsTagComponent.Enable();
                }
                else
                {
                    _disableBackerDialog.IsChecked.Value = false;
                    _disableBackerDialog.OptionsTagComponent.Disable();
                }
            });
            _fixBackerNames.IsChecked.NotifyChange();

            _enableCustomUI = quickFactory.Checkbox(() => IEModOptions.EnableCustomUi);
            _enableCustomUI.LocalPosition = column2Top.Plus(y: -210);

            _hideAntiClassSpells = quickFactory.Checkbox(() => IEModOptions.HideAnticlassSpells);
            _hideAntiClassSpells.LocalPosition = column2Top.Plus(y: -240);

            _hideWeaponEffects = quickFactory.Checkbox(() => IEModOptions.HideWeaponEffects);
            _hideWeaponEffects.LocalPosition = column2Top.Plus(y: -270);

            _autoLoadCustomStats = quickFactory.Checkbox(() => IEModOptions.AutoLoadCustomStats);
            _autoLoadCustomStats.LocalPosition = column1Top.Plus(y: -270);

            _enableCheatKeys = quickFactory.Checkbox(() => IEModOptions.EnableCheatKeys);
            _enableCheatKeys.LocalPosition = column1Top.Plus(y: -300);

            _chanterPhraseCount = quickFactory.Checkbox(() => IEModOptions.ChanterPhraseCount);
            _chanterPhraseCount.LocalPosition = column2Top.Plus(y: -300);

            var       centerCmbTop  = new Vector3(-80, -40, 0);
            const int cmbLabelWidth = 300;
            const int cmbWidth      = 515;

            _nerfedXpCmb = quickFactory.EnumDropdown(() => IEModOptions.NerfedXPTableSetting);

            _nerfedXpCmb.Width         = cmbWidth;
            _nerfedXpCmb.LabelWidth    = cmbLabelWidth;
            _nerfedXpCmb.LocalPosition = centerCmbTop;

            _perEncounterSpellsCmb               = quickFactory.EnumDropdown(() => IEModOptions.PerEncounterSpellsSetting);
            _perEncounterSpellsCmb.LabelWidth    = cmbLabelWidth;
            _perEncounterSpellsCmb.Width         = cmbWidth;
            _perEncounterSpellsCmb.LocalPosition = centerCmbTop.Plus(y: -30);

            _extraGrimoireSpellsCmb            = quickFactory.EnumDropdown(() => IEModOptions.ExtraWizardSpells);
            _extraGrimoireSpellsCmb.Width      = cmbWidth;
            _extraGrimoireSpellsCmb.LabelWidth = cmbLabelWidth;
            _extraGrimoireSpellsCmb.Transform.localPosition = centerCmbTop.Plus(y: -60);

            _cipherStartingFocusCmb               = quickFactory.EnumDropdown(() => IEModOptions.CipherStartingFocusSetting);
            _cipherStartingFocusCmb.LabelWidth    = cmbLabelWidth;
            _cipherStartingFocusCmb.Width         = cmbWidth;
            _cipherStartingFocusCmb.LocalPosition = centerCmbTop.Plus(y: -90);

            _autosaveCmb            = quickFactory.EnumDropdown(() => IEModOptions.AutosaveSetting);
            _autosaveCmb.Width      = cmbWidth;
            _autosaveCmb.LabelWidth = cmbLabelWidth;
            _autosaveCmb.Transform.localPosition = centerCmbTop.Plus(y: -120);

            _fastSneak            = quickFactory.EnumDropdown(() => IEModOptions.FastSneak);
            _fastSneak.Width      = cmbWidth;
            _fastSneak.LabelWidth = cmbLabelWidth;
            _fastSneak.Transform.localPosition = centerCmbTop.Plus(y: -150);

            _maxAdventurersCmb            = quickFactory.EnumDropdown(() => IEModOptions.MaxAdventurersCount);
            _maxAdventurersCmb.Width      = cmbWidth;
            _maxAdventurersCmb.LabelWidth = cmbLabelWidth;
            _maxAdventurersCmb.Transform.localPosition = centerCmbTop.Plus(y: -180);

            _capesHidden = quickFactory.Checkbox(() => IEModOptions.CapesHidden);
            _capesHidden.LocalPosition = column1Top.Plus(y: -327);

            _allInventorySlots = quickFactory.Checkbox(() => IEModOptions.AllInventorySlots);
            _allInventorySlots.LocalPosition = column2Top.Plus(y: -327);

            // Pallegina dispositions mod page
            quickFactory.CurrentParent = ieModDisposition.Transform;

            var favoredDisposition1 = quickFactory.EnumDropdown(() => IEModOptions.PalleginaFavored1);

            favoredDisposition1.Width         = 150;
            favoredDisposition1.LabelWidth    = cmbLabelWidth;
            favoredDisposition1.LocalPosition = new Vector3(-60, cmbLabelWidth, 0);

            var favoredDisposition2 = quickFactory.EnumDropdown(() => IEModOptions.PalleginaFavored2);

            favoredDisposition2.LabelWidth    = 0;
            favoredDisposition2.Width         = 150;
            favoredDisposition2.LocalPosition = new Vector3(100, cmbLabelWidth, 0);

            var disDisposition1 = quickFactory.EnumDropdown(() => IEModOptions.PalleginaDisfavored1);

            disDisposition1.Width         = 150;
            disDisposition1.LabelWidth    = cmbLabelWidth;
            disDisposition1.LocalPosition = new Vector3(-60, 250, 0);

            var disDisposition2 = quickFactory.EnumDropdown(() => IEModOptions.PalleginaDisfavored2);

            disDisposition2.LocalPosition = new Vector3(100, 250, 0);
            disDisposition2.LabelWidth    = 0;
            disDisposition2.Width         = 150;

            //REPLACES ORIGINAL CODE WITH SOME TWEAKED LINES (mostly due to changed number of tabs)
            this.PageButtonGroup.OnRadioSelectionChangedEvent += new UIRadioButtonGroup.RadioSelectionChanged(this.OnChangePage); // changed to Event
            this.m_PageButtonGrid = this.PageButtonGroup.GetComponent <UIGrid>();
            this.m_PageButtons    = new UIMultiSpriteImageButton[9];
            this.m_PageButtons[0] = this.PageButtonPrefab;
            for (int i = 0; i < 9; i++)
            {
                if (i > 0)
                {
                    this.m_PageButtons[i] = NGUITools.AddChild(this.PageButtonPrefab.transform.parent.gameObject, this.PageButtonPrefab.gameObject).GetComponent <UIMultiSpriteImageButton>();
                }
                if (i < this.PageTitleStringIds.Length)
                {
                    GUIStringLabel.Get(this.m_PageButtons[i].Label).SetString(this.PageTitleStringIds[i]);
                }
                else if (i == this.PageTitleStringIds.Length)                                 // added this line
                {
                    GUIStringLabel.Get(this.m_PageButtons [i].Label).FormatString = "IE Mod"; // added this line
                    //Debug.LogWarning("Not enough strings provided for every options tab in OptionsManager.");
                }
                else if (i == this.PageTitleStringIds.Length + 1)
                {
                    GUIStringLabel.Get(this.m_PageButtons[i].Label).FormatString = "Dispositions";                     // added this line
                    //Debug.LogWarning("Not enough strings provided for every options tab in OptionsManager.");
                }
                this.m_PageButtons[i].name = this.PageOrder[i] + "." + this.m_PageButtons[i].name;
            }
            //PURE ORIGINAL CODE NOW
            this.m_PageButtonGrid.Reposition();
            UIOptionsTag[] mOptions = this.m_Options;
            for (int j = 0; j < (int)mOptions.Length; j++)
            {
                UIOptionsTag uIOptionsTag = mOptions[j];
                if (uIOptionsTag.Checkbox)
                {
                    uIOptionsTag.Checkbox.onStateChange += new UICheckbox.OnStateChange(this.OnCheckChanged);
                }
            }

            this.CombatTimerSlider.Slider.OnChanged       = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.CombatTimerSlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnCombatTimerChanged));
            this.AutoslowThresholdSlider.Slider.OnChanged = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.AutoslowThresholdSlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnAutoslowThresholdChanged));
            this.TooltipDelay.Slider.OnChanged            = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.TooltipDelay.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnTooltipDelayChanged));
            this.FontSize.Slider.OnChanged            = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.FontSize.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnFontSizeChanged));
            this.GammaSlider.Slider.OnChanged         = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.GammaSlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnGammaSliderChanged));
            this.AreaLootRangeSlider.Slider.OnChanged = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.AreaLootRangeSlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnAreaLootSliderChanged));
            this.VoiceFrequency.Slider.OnChanged      = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.VoiceFrequency.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnVoiceFrequencyChanged));
            this.ScrollSpeed.Slider.OnChanged         = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.ScrollSpeed.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnScrollSpeedChanged));

            this.LanguageDropdown.OnDropdownOptionChangedEvent   += new UIDropdownMenu.DropdownOptionChanged(this.OnLanguageChanged);           // changed to Event
            this.ResolutionDropdown.OnDropdownOptionChangedEvent += new UIDropdownMenu.DropdownOptionChanged(this.OnResolutionChanged);         // changed to Event
            this.QualitySlider.Slider.OnChanged      = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.QualitySlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnQualityChanged));
            this.FrameRateMaxSlider.Slider.OnChanged = (UIOptionsSlider.OnSettingChanged)Delegate.Combine(this.FrameRateMaxSlider.Slider.OnChanged, new UIOptionsSlider.OnSettingChanged(this.OnMaxFPSChanged));

            this.m_VolumeSliders = new UIOptionsSliderGroup[4];
            UIOptionsVolumeSlider[] componentsInChildren = base.GetComponentsInChildren <UIOptionsVolumeSlider>(true);
            for (int k = 0; k < (int)componentsInChildren.Length; k++)
            {
                UIOptionsVolumeSlider uIOptionsVolumeSlider = componentsInChildren[k];
                if (this.m_VolumeSliders[(int)uIOptionsVolumeSlider.Category] == null)
                {
                    UIOptionsSliderGroup component = uIOptionsVolumeSlider.GetComponent <UIOptionsSliderGroup>();
                    this.m_VolumeSliders[(int)uIOptionsVolumeSlider.Category] = component;
                    component.Slider.OnChanged += new UIOptionsSlider.OnSettingChanged(this.OnVolumeChanged);
                }
            }
            this.AcceptButton.onClick          = (UIEventListener.VoidDelegate)Delegate.Combine(this.AcceptButton.onClick, new UIEventListener.VoidDelegate(this.OnAcceptClick));
            this.DefControlsButton.onClick     = (UIEventListener.VoidDelegate)Delegate.Combine(this.DefControlsButton.onClick, new UIEventListener.VoidDelegate(this.OnRestoreDefaultControls));
            this.ApplyResolutionButton.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(this.ApplyResolutionButton.onClick, new UIEventListener.VoidDelegate(this.OnApplyResolution));
        }
예제 #19
0
    /*void OnDestroy()
     * {
     *
     * }*/

    /*void Update()
     * {
     *  if (Input.GetKeyUp(KeyCode.A))
     *  {
     *
     *  }
     * }*/

    public void Show(bool isShow)
    {
        if (isShow)
        {
            gameObject.SetActive(true);

            AppearEffect.transform.localScale = Vector3.one * 0.01f;
            AppearEffect.Open(AppearType.Popup, AppearEffect.gameObject);

            GameApp.Instance.UICurrency.OnlyShowState();

            MyTools.DestroyImmediateChildNodes(LstGrid.transform);
            if (LstGrid.transform.childCount == 0)
            {
                foreach (KeyValuePair <int, AchievementConfig> pair in CsvConfigTables.Instance.AchievementCsvDic)
                {
                    if (pair.Value.Predecessors == -1)
                    {
                        GameObject newUnit = NGUITools.AddChild(LstGrid, AchievementUnitPrefab);
                        newUnit.SetActive(true);
                        newUnit.name = "AchievementUnit_" + pair.Key;

                        newUnit.GetComponent <UI_AchievementUnit>().Set(pair.Key);
                    }
                }

                List <UI_AchievementUnit> tempEnableGetAwardTULst = new List <UI_AchievementUnit>();
                List <UI_AchievementUnit> tempPutThroughTULst     = new List <UI_AchievementUnit>();
                List <UI_AchievementUnit> tempInProgressTULst     = new List <UI_AchievementUnit>();

                for (int i = 0; i < LstGrid.transform.childCount; i++)
                {
                    Transform          child = LstGrid.transform.GetChild(i);
                    UI_AchievementUnit tu    = child.GetComponent <UI_AchievementUnit>();

                    if (tu.IsHasAwardEnableGet)
                    {
                        tempEnableGetAwardTULst.Add(tu);
                    }
                    else if (tu.IsPutThrough)
                    {
                        tempPutThroughTULst.Add(tu);
                    }
                    else
                    {
                        tempInProgressTULst.Add(tu);
                    }
                }
                foreach (UI_AchievementUnit tu in tempEnableGetAwardTULst)
                {
                    tu.transform.parent = null;
                }
                foreach (UI_AchievementUnit tu in tempInProgressTULst)
                {
                    tu.transform.parent = null;
                }
                foreach (UI_AchievementUnit tu in tempPutThroughTULst)
                {
                    tu.transform.parent = null;
                }

                foreach (UI_AchievementUnit tu in tempEnableGetAwardTULst)
                {
                    tu.transform.parent = LstGrid.transform;
                }
                foreach (UI_AchievementUnit tu in tempInProgressTULst)
                {
                    tu.transform.parent = LstGrid.transform;
                }
                foreach (UI_AchievementUnit tu in tempPutThroughTULst)
                {
                    tu.transform.parent = LstGrid.transform;
                }

                LstGrid.transform.GetComponent <UIGrid>().repositionNow = true;
                LstGrid.transform.parent.GetComponent <UIScrollView>().ResetPosition();
            }
        }
        else
        {
            GameApp.Instance.UICurrency.Show(false);

            AppearEffect.Close(AppearType.Popup, () =>
            {
                gameObject.SetActive(false);
            });
        }
    }
예제 #20
0
    public void Achieve(PlayerCounter playercounter)
    {
        while (this.Grid.childCount > 0)
        {
            UnityEngine.Object.DestroyImmediate(this.Grid.GetChild(0).gameObject);
        }
        bool flag = false;
        Dictionary <int, int> dictionary = new Dictionary <int, int>();

        dictionary = playercounter.extKillCount;
        if (dictionary != null)
        {
            List <KeyValuePair <int, int> > list = new List <KeyValuePair <int, int> >(dictionary);
            if (dictionary.Count > 0)
            {
                list.Sort((KeyValuePair <int, int> s1, KeyValuePair <int, int> s2) => s2.Key.CompareTo(s1.Key));
            }
            for (int i = 0; i < list.Count; i++)
            {
                int key = list[i].Key;
                switch (key)
                {
                case 3:
                    if (!flag)
                    {
                        if (this.Grid.childCount < i + 1)
                        {
                            NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                        }
                        this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_3";
                        this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                    }
                    break;

                case 4:
                    if (!flag)
                    {
                        if (this.Grid.childCount < i + 1)
                        {
                            NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                        }
                        this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_4";
                        this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                        flag = true;
                    }
                    break;

                case 5:
                    if (this.Grid.childCount < i + 1)
                    {
                        NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                    }
                    this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_5";
                    this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                    flag = true;
                    break;

                default:
                    if (key == 104)
                    {
                        if (this.Grid.childCount < i + 1)
                        {
                            NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                        }
                        this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_shen";
                        this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                    }
                    break;
                }
            }
        }
        List <KeyValuePair <int, int> > list2 = new List <KeyValuePair <int, int> >(this.achi);

        if (this.achi.Count > 0)
        {
            list2.Sort((KeyValuePair <int, int> s1, KeyValuePair <int, int> s2) => s1.Key.CompareTo(s2.Key));
        }
        for (int j = 0; j < this.achi.Count; j++)
        {
            switch (list2[j].Key)
            {
            case 7:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_kills";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 8:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_fist";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 9:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_money";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 10:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_batman";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 11:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_tower";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 12:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_tank";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;

            case 13:
                if (this.Grid.childCount < this.Grid.childCount + j + 1)
                {
                    NGUITools.AddChild(this.Grid.gameObject, this.AchiSprite);
                }
                this.Grid.GetChild(this.Grid.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_icons_injure";
                this.Grid.GetChild(this.Grid.childCount - 1).gameObject.SetActive(true);
                break;
            }
        }
        this.Grid.GetComponent <UIGrid>().repositionNow = true;
        this.achi.Clear();
    }
예제 #21
0
    /// <summary>
    /// Generate an item preview for the specified item.
    /// </summary>

    void GeneratePreview(Item item, UISnapshotPoint point)
    {
        if (item == null || item.prefab == null)
        {
            return;
        }

        int           dim = (cellSize - 4) * 2;
        RenderTexture rt  = (item.tex as RenderTexture);

        // If the dimensions have changed, we will need to create a new render texture
        if (rt != null && item.dynamicTex && (item.tex.width != dim || item.tex.height != dim))
        {
            DestroyImmediate(item.tex);
        }

#if UNITY_3_5
        // Unfortunately Unity 3.5 doesn't seem to support a proper way of doing any of this
        item.tex        = null;
        item.dynamicTex = false;
#else
        // Asset Preview-based approach is unreliable, and most of the time fails to provide a texture.
        // Sometimes it even throws null exceptions.
        //item.tex = AssetPreview.GetAssetPreview(item.prefab);
        //item.dynamicTex = false;
        //if (item.tex != null) return;

        // Let's create a basic scene
        GameObject root = EditorUtility.CreateGameObjectWithHideFlags(
            "Preview Root", HideFlags.HideAndDontSave);

        GameObject camGO = EditorUtility.CreateGameObjectWithHideFlags(
            "Preview Camera", HideFlags.HideAndDontSave, typeof(Camera));

        // Position it far away so that it doesn't interfere with existing objects
        root.transform.position = new Vector3(0f, 0f, 10000f);
        root.layer = item.prefab.layer;

        // Set up the camera
        Camera cam = camGO.GetComponent <Camera>();
        cam.renderingPath   = RenderingPath.Forward;
        cam.clearFlags      = CameraClearFlags.Skybox;
        cam.orthographic    = true;
        cam.backgroundColor = new Color(0f, 0f, 0f, 0f);

        // Set up the render texture for the camera
        if (rt == null)
        {
            rt              = new RenderTexture(dim, dim, 1);
            rt.hideFlags    = HideFlags.HideAndDontSave;
            rt.generateMips = false;
            rt.format       = RenderTextureFormat.ARGB32;
            rt.filterMode   = FilterMode.Trilinear;
            rt.anisoLevel   = 4;

            item.tex        = rt;
            item.dynamicTex = true;
        }
        cam.targetTexture = rt;

        // Finally instantiate the prefab as a child of the root
        GameObject child = NGUITools.AddChild(root, item.prefab);

        // Try to find the snapshot point script
        if (point == null)
        {
            point = child.GetComponentInChildren <UISnapshotPoint>();
        }

        // If there is a UIRect present (widgets or panels) then it's an NGUI object
        if (SetupPreviewForUI(cam, root, child, point) ||
            SetupPreviewFor3D(cam, root, child, point))
        {
            cam.Render();
        }

        // Clean up everything
        DestroyImmediate(camGO);
        DestroyImmediate(root);
#endif
    }
예제 #22
0
파일: FBPanel.cs 프로젝트: zuojiashun/src
    void InitFbScroll()
    {
        UpdateExchangeBtnVisbile();
        if (ShowSingleCard())
        {
            return;
        }
        m_grid_FbGrid.transform.DestroyChildren();
        m_scrollview_FbScrollView.gameObject.SetActive(true);
        float y = m_scrollview_FbScrollView.transform.localPosition.y;

        m_scrollview_FbScrollView.transform.localPosition = new Vector3(m_fScrollInitX, y, 0);
        m_scrollview_FbScrollView.panel.clipOffset        = Vector2.zero;

        List <CopyDataBase> copyList = dataManager.GetCopyListByCopyByCopyID(m_uGotoCopyID);

        if (copyList == null)
        {
            return;
        }
        int chidlCount = m_grid_FbGrid.transform.childCount;

        if (chidlCount > copyList.Count)
        {
            for (int i = copyList.Count; i < chidlCount; i++)
            {
                string name = string.Format("{0:D2}", i);

                Transform itemTrans = m_grid_FbGrid.transform.Find(name);
                if (itemTrans != null)
                {
                    itemTrans.gameObject.SetActive(false);
                }
            }
        }
        for (int i = 0; i < copyList.Count; i++)
        {
            string     name = string.Format("{0:D2}", i);
            GameObject item = null;

            Transform itemTrans = m_grid_FbGrid.transform.Find(name);
            if (itemTrans == null)
            {
                item = NGUITools.AddChild(m_grid_FbGrid.gameObject, m_widget_FBCard.gameObject);
                item.SetActive(true);
                item.name = name;
                Vector3 localPos = new Vector3(i * itemWidth, 0, 0);
                item.transform.localPosition = localPos;
            }
            else
            {
                item = itemTrans.gameObject;
            }
            item.gameObject.SetActive(true);
            Transform subPanel = item.transform.Find("Panel");
            if (subPanel != null)
            {
                subPanel.gameObject.SetActive(true);
                subPanel.DOScaleX(0, 0);
            }
            CopyDataBase cdb = copyList[i];
            FBCard       fb  = item.GetComponent <FBCard>();
            if (fb == null)
            {
                fb = item.AddComponent <FBCard>();
            }
            fb.DestroyScrollChild();
            fb.InitByCopyData(cdb);

            UIEventListener.Get(item).onClick = OnItemClick;
        }

        m_grid_FbGrid.Reposition();
    }
예제 #23
0
 public void showSettings()
 {
     GameObject    parent = UICamera.first.transform.parent.gameObject;
     GameObject    obj    = NGUITools.AddChild(parent, settingsPrefab);
     SettingsPopUp popup  = obj.GetComponent <SettingsPopUp>();
 }
예제 #24
0
    private void showDetail(NoticeTopButton button)
    {
        Notice notice = button.getNotice();
        int    type   = notice.getSample().type;

        doSwitchBackGround(type);
        if (type == NoticeType.TOPUPNOTICE || type == NoticeType.COSTNOTICE || type == NoticeType.TIME_RECHARGE ||
            type == NoticeType.NEW_RECHARGE || type == NoticeType.NEW_CONSUME)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, rechargeShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivityRechargeContent> ().initContent(notice, this);
        }
        else if (type == NoticeType.EXCHANGENOTICE || type == NoticeType.NEW_EXCHANGE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, exchangeShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivityExchangeContent> ().initContent(notice, this);
        }
        else if (type == NoticeType.HEROEAT)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, heroEatShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <HeroEatContent> ().initContent(this);
        }
        else if (type == NoticeType.ALCHEMY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, alchemyShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <AlchemyContent> ().initContent(this);
        }
        else if (type == NoticeType.CDKEY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, inviteShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <InviteContent> ().initWindow(0, this);
        }
        else if (type == NoticeType.MONTHCARD)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, monthCardShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <MonthCardContent> ().initContent(this);
        }
        else if (type == NoticeType.HAPPY_TURN_SPRITE || type == NoticeType.XIANSHI_HAPPY_TURN)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, happyTurnSpriteShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <HappyTurnSpriteContent> ().initContent(notice, this);
        }
        else if (type == NoticeType.ONERMB)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, oneRmbShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <OneRmbContent> ().initContent(this);
        }
        else if (type == NoticeType.QUIZ_EXAM)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, quizShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeQuizContent> ().initData(this, notice);
        }
        else if (type == NoticeType.QUIZ_SURVEY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, quizShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeQuizContent> ().initData(this, notice);
        }
        else if (type == NoticeType.HAPPY_SUNDAY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, happySunday);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <HappySundayContent> ().initContent(this, notice);
        }
        else if (type == NoticeType.CONSUME_REBATE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, consumeRebateShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeConsumeRebateContent> ().initContent(notice, this);
        }
        else if (type == NoticeType.LUCKY_CARD)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, luckyCardShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <LuckyCardContent> ().initContent(this, notice);
        }
        else if (type == NoticeType.LUCKY_EQUIP || type == NoticeType.XIANSHI_HUODONG)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, luckyEquipShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <LuckyEquipContent> ().initContent(this, notice);
        }
        else if (type == NoticeType.DOUBLE_RMB)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, doubleRMB);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <DoubleRMBContent> ().initContent(this, notice);
        }
        else if (type == NoticeType.REMAKE_EQUIP)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, equipRemakeShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <EquipRemakeContent> ().initContent(this, notice);
        }
        else if (type == NoticeType.DAILY_REBATE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, dailyReateShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            //(FPortManager.Instance.getFPort ("InitLuckyDrawFPort") as InitLuckyDrawFPort).init (null);
            dailyRateList = TaskManagerment.Instance.getDailyRebateTask();
            show.GetComponent <NoticeActivityDailyRebateContent> ().initContent(notice, this, dailyRateList);
        }
        else if (type == NoticeType.LADDER_HEGEMONY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, ladderHegemoney);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            NoticeSample sample       = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);
            Notice       activenotice = NoticeManagerment.Instance.getNoticeListByType(NoticeType.LADDER_ACTION_TIME, notice.sid, sample.entranceId);
            show.GetComponent <NoticeLadderHegeMoneyContent> ().initContent(notice, this);
            show.GetComponent <NoticeLadderHegeMoneyContent> ().initActiveNotice(activenotice);
        }
        else if (type == NoticeType.LIMIT_COLLECT)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, limitCollect);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivityLimitCollectContent> ().initContent(notice, this);
        }
        else if (type == NoticeType.ONE_MANY_RECHARGE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, oneManyShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeOneManyRechargeContent>().initContent(notice, this);
        }
        else if (type == NoticeType.FESTIVAL_WISH)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, festivalShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivityFestivalWishContent>().initContent(notice, this);
        }
        else if (type == NoticeType.FESTIVAL_FIREWORKS)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, fireworksShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivityFestivalFireworksContent>().initContent(notice, this);
        }
        else if (type == NoticeType.SUPERDRAW)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, superDrawShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivitySuperDrawContent>().initContent(notice, this);
        }
        else if (type == NoticeType.XIANSHI_FANLI)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, rebateShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <RebateContent>().initContent(notice, this);
        }
        else if (type == NoticeType.SIGNIN)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, signInShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <NoticeActivitySignInContent>().initContent(notice, this);
        }
        else if (type == NoticeType.SHAREDRAW)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, shareContent);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <ShareDrawContent>().initContent(notice, this);
        }
        else if (type == NoticeType.BACK_PRIZE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, backPrizeShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <OldPlayerBackContent>().initContent(notice, this, button);
        }
        else if (type == NoticeType.BACK_RECHARGE)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, backRechargeShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <BackRechargeContent>().initContent(notice, this);
        }
        else if (type == NoticeType.WEEKCARD)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, weekCardShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            show.GetComponent <WeekCardContent>().initContent(this);
        }
        else if (type == NoticeType.LOTTERY)
        {
            Destroy(show);
            show = NGUITools.AddChild(showPos.gameObject, lotteryShow);
            show.transform.localPosition = Vector3.zero;
            show.transform.localScale    = Vector3.one;
            LotteryInfoFPort fPort = FPortManager.Instance.getFPort("LotteryInfoFPort") as LotteryInfoFPort;
            fPort.lotteryInfoAccess(() => {
                LotteryManagement.Instance.canGetInitFPort = false;
                show.GetComponent <LotteryContent>().initContent(this, notice);
            });
        }
        else
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0358"));
            return;
        }
        if (lastSelect != null)
        {
            lastSelect.selelct.gameObject.SetActive(false);
        }
        button.selelct.gameObject.SetActive(true);

        lastSelect = button;
    }
 private void DoExplosionSpecificStuff()
 {
     NGUITools.AddChild(gameObject, additionalDynamiteEffect);
 }
예제 #26
0
    /// <summary>
    /// Create a new UI.
    /// </summary>

    static public UIPanel CreateUI(Transform trans, bool advanced3D, int layer)
    {
        // Find the existing UI Root
        UIRoot root = (trans != null) ? NGUITools.FindInParents <UIRoot>(trans.gameObject) : null;

        if (root == null && UIRoot.list.Count > 0)
        {
            foreach (UIRoot r in UIRoot.list)
            {
                if (r.gameObject.layer == layer)
                {
                    root = r;
                    break;
                }
            }
        }

        // Try to find an existing panel
        if (root == null)
        {
            for (int i = 0, imax = UIPanel.list.Count; i < imax; ++i)
            {
                UIPanel    p  = UIPanel.list[i];
                GameObject go = p.gameObject;

                if (go.hideFlags == HideFlags.None && go.layer == layer)
                {
                    trans.parent     = p.transform;
                    trans.localScale = Vector3.one;
                    return(p);
                }
            }
        }

        // If we are working with a different UI type, we need to treat it as a brand-new one instead
        if (root != null)
        {
            UICamera cam = root.GetComponentInChildren <UICamera>();

#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6
            if (cam != null && cam.camera.isOrthoGraphic == advanced3D)
#else
            if (cam != null && cam.GetComponent <Camera>().orthographic == advanced3D)
#endif
            {
                trans = null;
                root  = null;
            }
        }

        // If no root found, create one
        if (root == null)
        {
            GameObject go = NGUITools.AddChild(null, false);
            root = go.AddComponent <UIRoot>();

            // Automatically find the layers if none were specified
            if (layer == -1)
            {
                layer = LayerMask.NameToLayer("UI");
            }
            if (layer == -1)
            {
                layer = LayerMask.NameToLayer("2D UI");
            }
            go.layer = layer;

            if (advanced3D)
            {
                go.name           = "UI Root (3D)";
                root.scalingStyle = UIRoot.Scaling.Constrained;
            }
            else
            {
                go.name           = "UI Root";
                root.scalingStyle = UIRoot.Scaling.Flexible;
            }
        }

        // Find the first panel
        UIPanel panel = root.GetComponentInChildren <UIPanel>();

        if (panel == null)
        {
            // Find other active cameras in the scene
            Camera[] cameras = NGUITools.FindActive <Camera>();

            float depth        = -1f;
            bool  colorCleared = false;
            int   mask         = (1 << root.gameObject.layer);

            for (int i = 0; i < cameras.Length; ++i)
            {
                Camera c = cameras[i];

                // If the color is being cleared, we won't need to
                if (c.clearFlags == CameraClearFlags.Color ||
                    c.clearFlags == CameraClearFlags.Skybox)
                {
                    colorCleared = true;
                }

                // Choose the maximum depth
                depth = Mathf.Max(depth, c.depth);

                // Make sure this camera can't see the UI
                c.cullingMask = (c.cullingMask & (~mask));
            }

            // Create a camera that will draw the UI
            Camera cam = NGUITools.AddChild <Camera>(root.gameObject, false);
            cam.gameObject.AddComponent <UICamera>();
            cam.clearFlags      = colorCleared ? CameraClearFlags.Depth : CameraClearFlags.Color;
            cam.backgroundColor = Color.grey;
            cam.cullingMask     = mask;
            cam.depth           = depth + 1f;

            if (advanced3D)
            {
                cam.nearClipPlane           = 0.1f;
                cam.farClipPlane            = 4f;
                cam.transform.localPosition = new Vector3(0f, 0f, -700f);
            }
            else
            {
                cam.orthographic     = true;
                cam.orthographicSize = 1;
                cam.nearClipPlane    = -10;
                cam.farClipPlane     = 10;
            }

            // Make sure there is an audio listener present
            AudioListener[] listeners = NGUITools.FindActive <AudioListener>();
            if (listeners == null || listeners.Length == 0)
            {
                cam.gameObject.AddComponent <AudioListener>();
            }

            // Add a panel to the root
            panel = root.gameObject.AddComponent <UIPanel>();
#if UNITY_EDITOR
            UnityEditor.Selection.activeGameObject = panel.gameObject;
#endif
        }

        if (trans != null)
        {
            // Find the root object
            while (trans.parent != null)
            {
                trans = trans.parent;
            }

            if (NGUITools.IsChild(trans, panel.transform))
            {
                // Odd hierarchy -- can't reparent
                panel = trans.gameObject.AddComponent <UIPanel>();
            }
            else
            {
                // Reparent this root object to be a child of the panel
                trans.parent        = panel.transform;
                trans.localScale    = Vector3.one;
                trans.localPosition = Vector3.zero;
                SetChildLayer(panel.cachedTransform, panel.cachedGameObject.layer);
            }
        }
        return(panel);
    }
예제 #27
0
 public void PlusScore()
 {
     if (_delayTime <= 0.0f)
     {
         if (_nowNodeNum[0] == _MainPolygon.GetComponent <MainPolygon>()._nowVertexNum)
         {
             _nowNodeNum.RemoveAt(0);
             _delayTime = 0.3f;
             _Score++;
             _PassNode++;
             if (!_Nanido)
             {
                 _HP += 5;
             }
         }
         else
         {
             if (_Nanido)
             {
                 Destroy(_MainPolygon.transform.parent.gameObject);
                 _GameOver  = true;
                 _NodeStart = false;
                 GetComponent <AudioSource>().Stop();
                 AudioSource.PlayClipAtPoint(_TurnOff, Vector2.zero);
                 GameObject obj = NGUITools.AddChild(_Root, _GameOverEffect);
                 for (int i = 0; i < _MainPolygon.transform.childCount; i++)
                 {
                     if (_MainPolygon.transform.GetChild(i).name == "Shild_Node(Clone)")
                     {
                         Destroy(_MainPolygon.transform.GetChild(i).gameObject);
                     }
                 }
                 StartCoroutine(GameOver());
             }
             else
             {
                 _HP -= 70;
                 _nowNodeNum.RemoveAt(0);
                 _delayTime = 0.3f;
                 if (_HP <= 0)
                 {
                     Destroy(_MainPolygon.transform.parent.gameObject);
                     _GameOver  = true;
                     _NodeStart = false;
                     GetComponent <AudioSource>().Stop();
                     AudioSource.PlayClipAtPoint(_TurnOff, Vector2.zero);
                     GameObject obj = NGUITools.AddChild(_Root, _GameOverEffect);
                     for (int i = 0; i < _MainPolygon.transform.childCount; i++)
                     {
                         if (_MainPolygon.transform.GetChild(i).name == "Shild_Node(Clone)")
                         {
                             Destroy(_MainPolygon.transform.GetChild(i).gameObject);
                         }
                     }
                     StartCoroutine(GameOver());
                 }
                 else
                 {
                     _MainPolygon.GetComponent <MainPolygon>().HitAnimation();
                 }
             }
         }
     }
 }
예제 #28
0
    void playLevelup()
    {
        GameObject go = NGUITools.AddChild(transform.parent.gameObject, levelupPanelPrefab);

        effectLevelup(go);
    }
예제 #29
0
    public void ShowDialog(string dialogName, float duration = 0.4f, string[] agruments = null, System.Action onComplete = null, System.Action onCloseComplete = null, DialogController.ShowDialogType showDialogType = DialogController.ShowDialogType.FromTop, bool isBlockTouch = true, bool isTouchAnywhereToCloseDialog = false, bool isHightlight = true)
    {
        Master.WaitAndDo(0.7f, () =>
        {
            AdController.CheckAndShowAd();
        }, this, true);

        AdController.ShowBanner();
        Dialog.root.SetActive(true);

        Dialog.blockTouch.SetActive(isBlockTouch);
        Dialog.blackPanel.SetActive(isHightlight);

        if (Dialog.listDialogShowing.Count > 0)
        {
            for (int i = 0; i < Dialog.listDialogShowing.Count; i++)
            {
                Dialog.listDialogShowing[i].GetComponent <UIPanel>().depth = 48 - i;
            }
        }

        GameObject pf_dialog = Master.GetGameObjectInPrefabs("UI/Dialogs/" + dialogName);
        GameObject dialog    = NGUITools.AddChild(Dialog.root, pf_dialog);

        dialog.GetComponent <DialogController>().OnOpen(agruments, onCloseComplete);
        //dialog.SendMessage("OnOpen", agruments, SendMessageOptions.DontRequireReceiver);

        dialog.GetComponent <UIPanel>().alpha = 0;
        TweenAlpha.Begin(dialog, duration, 1);
        Dialog.listDialogShowing.Add(dialog);

        switch (showDialogType)
        {
        case DialogController.ShowDialogType.FromLeft:
            dialog.transform.position = pos[0].position;
            break;

        case DialogController.ShowDialogType.FromTop:
            dialog.transform.position = pos[1].position;
            break;

        case DialogController.ShowDialogType.FromRight:
            dialog.transform.position = pos[2].position;
            break;

        case DialogController.ShowDialogType.FromBottom:
            dialog.transform.position = pos[3].position;
            break;

        case DialogController.ShowDialogType.Center:
            dialog.transform.position = pos[4].position;
            break;
        }
        // dialog.transform.setUp
        dialog.transform.DOMove(pos[4].position, duration).SetUpdate(true).OnComplete(() =>
        {
            //dialog.SendMessage("OnShowComplete", SendMessageOptions.DontRequireReceiver);
            dialog.GetComponent <DialogController>().OnShowComplete();
            if (onComplete != null)
            {
                onComplete();
            }
        });
    }
예제 #30
0
    //点击按钮显示远征二级界面信息 或者领取奖励
    public void ShowLevelInfo(int index)
    {
        RoleInfo role_info = LobbyClient.Instance.CurrentRole;

        if (role_info != null)
        {
            m_CurrentClickIndex = index;
            ExpeditionPlayerInfo ep_info = role_info.GetExpeditionInfo();
            if (ep_info != null)
            {
                //角色已经死亡、且点击的不是宝箱则弹出提示对话框
                if (ep_info.Hp <= 0 && index == ep_info.Schedule)
                {
                    string CHN_DESC = StrDictionaryProvider.Instance.GetDictString(453);
                    string CHN_CON  = StrDictionaryProvider.Instance.GetDictString(4);
                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui", CHN_DESC, CHN_CON, null, null, null, false);
                    return;
                }
                int currentSchedule = ep_info.Schedule;
                if (index < currentSchedule)
                {
                    LogicSystem.EventChannelForGfx.Publish("ge_ui_connect_hint", "ui", false, true);
                    GfxSystem.EventChannelForLogic.Publish("ge_expedition_award", "lobby", index);
                    return;
                }
            }
        }
        m_LevelIndex = index;
        DestroyChildrenInGrid();
        if (goLevelInfo != null)
        {
            NGUITools.SetActive(goLevelInfo, true);
        }
        if (role_info != null)
        {
            //获取远征信息
            ExpeditionPlayerInfo exPlayInfo = role_info.GetExpeditionInfo();
            if (exPlayInfo != null)
            {
                WorldSystem.Instance.ExpeditionErrorCheck();
                if (index < exPlayInfo.Tollgates.Length || exPlayInfo.Tollgates[index] != null)
                {
                    ExpeditionPlayerInfo.TollgateData levelData = exPlayInfo.Tollgates[index];
                    //NPC
                    if (levelData.Type == EnemyType.ET_Boss || levelData.Type == EnemyType.ET_Monster)
                    {
                        int numLimit = 0;
                        for (int i = 0; i < levelData.EnemyList.Count; ++i)
                        {
                            int monsterId = levelData.EnemyList[i];
                            int attrId    = -1;
                            if (i < levelData.EnemyAttrList.Count)
                            {
                                attrId = levelData.EnemyAttrList[i];
                            }
                            if (goSlot == null && uiGrid == null)
                            {
                                break;
                            }
                            UnityEngine.GameObject go = NGUITools.AddChild(uiGrid.gameObject, goSlot);
                            if (go == null)
                            {
                                continue;
                            }
                            UITreasureSlot uiTsSlot = go.GetComponent <UITreasureSlot>();
                            if (uiTsSlot != null)
                            {
                                uiTsSlot.SetLevelInfo(monsterId, attrId);
                            }
                            if (++numLimit >= 4)
                            {
                                break;
                            }
                        }
                    }
                    else
                    {
                        //Player
                        foreach (ExpeditionImageInfo enemy_info in levelData.UserImageList)
                        {
                            if (goSlot == null && uiGrid == null)
                            {
                                break;
                            }
                            UnityEngine.GameObject go = NGUITools.AddChild(uiGrid.gameObject, goSlot);
                            if (go == null)
                            {
                                continue;
                            }
                            UITreasureSlot uiTsSlot = go.GetComponent <UITreasureSlot>();
                            if (uiTsSlot != null)
                            {
                                if (enemy_info.FightingScore <= 0)
                                {
                                    int min = (int)(role_info.FightingScore - role_info.FightingScore * 0.2f);
                                    int max = (int)(role_info.FightingScore + role_info.FightingScore * 0.2f);
                                    int rnd = CrossEngineHelper.Random.Next(min, max);
                                    enemy_info.FightingScore = rnd;
                                }
                                uiTsSlot.SetLevelInfo(enemy_info);
                            }
                        }
                    }
                }
                if (uiGrid != null)
                {
                    uiGrid.Reposition();
                }
            }
        }
    }