예제 #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (transform.localPosition.y < InvisiblePosition - 10)
        {
            try{
                mDispearTimer += Time.deltaTime;
                if (mDispearTimer >= 6.0f)
                {
                    Hide();
                    return;
                }

                if (mAttachSprite.IsHidden() || !mAttachSprite.gameObject.active)
                {
                    Hide();
                }

                if (HelpUtil.GetButtonState(true))
                {
                    Hide();
                }
            }catch {
                Hide();
            }
        }
    }
예제 #2
0
    //! send data to the server
    private void SendData()
    {
        if (m_statDateList.Count <= 0)
        {
            return;
        }

        sg.C2GS_Statistics_Client_Req req = new sg.C2GS_Statistics_Client_Req();
        req.requestTime = HelpUtil.CurrTimeStamp();

        foreach (StatData data in m_statDateList)
        {
            req.clientAction.Add(data.ToString());

            //m_statDateListResend.Add(data);
        }

        m_statDateList.Clear();

        Packet pak = new Packet();

        pak.m_object     = req;
        pak.m_packetType = PacketOpcode.C2GS_STATISTICS_CLIENT_REQ;

        //Globals.Instance.MGSNetManager.Send(pak);
    }
예제 #3
0
    public static void PayForCommodity(CommodityData data)
    {
        string roleName = Globals.Instance.MGameDataManager.MActorData.BasicData.Name;
        int    level    = Globals.Instance.MGameDataManager.MActorData.BasicData.Level;

        float exchangeRatio = RmbYuan2Mibi;

        if (data.currency == CurrencyType.RmbYuan)
        {
            exchangeRatio = RmbYuan2Mibi;
        }
        else if (data.currency == CurrencyType.RmbJiao)
        {
            exchangeRatio = 0.1f * RmbYuan2Mibi;
        }
        else if (data.currency == CurrencyType.RmbFen)
        {
            exchangeRatio = 0.01f * RmbYuan2Mibi;
        }
        float productPrice         = exchangeRatio * data.currPrice;
        float productOriginalPrice = exchangeRatio * data.originalPrice;
        int   productCnt           = data.BasicData.Count;

        productPrice         *= productCnt;
        productOriginalPrice *= productCnt;

        int mibi = (int)Mathf.CeilToInt(productPrice);

        HelpUtil.AndroidNativeCallStatic(JavaClassUnity2MiSDK, "miUniPayOnline", data.orderId, mibi);
    }
예제 #4
0
    public static void PayForCommodity(CommodityData data)
    {
        string orderId        = data.orderId;
        string productId      = data.ItemID.ToString();
        string productName    = data.BasicData.Name;
        string payDescription = data.BasicData.Description;

        float exchangeRatio = RmbYuan2NdBean;

        if (data.currency == CurrencyType.RmbYuan)
        {
            exchangeRatio = RmbYuan2NdBean;
        }
        else if (data.currency == CurrencyType.RmbJiao)
        {
            exchangeRatio = 0.1f * RmbYuan2NdBean;
        }
        else if (data.currency == CurrencyType.RmbFen)
        {
            exchangeRatio = 0.01f * RmbYuan2NdBean;
        }
        float productPrice         = exchangeRatio * data.currPrice;
        float productOriginalPrice = exchangeRatio * data.originalPrice;

        int productCnt = data.BasicData.Count;

        productPrice         *= productCnt;
        productOriginalPrice *= productCnt;


        HelpUtil.AndroidNativeCallStatic(JavaClassUnity2NdSDK, "ndUniPayAysn", orderId, productId, productName, productPrice, productOriginalPrice, productCnt, payDescription);
    }
예제 #5
0
    void DisplayBranchHua()
    {
        NGUITools.SetActive(ButtonBack.gameObject, true);
        HelpUtil.DelListInfo(uiGrid.transform);
        foreach (int Chapter in mBranchChapter)
        {
            GameObject CGObj = GameObject.Instantiate(CGItemPrefab) as GameObject;
            CGObj.transform.parent        = uiGrid.transform;
            CGObj.transform.localScale    = Vector3.one;
            CGObj.transform.localPosition = new Vector3(0, 0, -5);
            UIToggle checbox = CGObj.GetComponent <UIToggle>();

            UILabel TitleLabel = CGObj.transform.Find("TitleLabel").GetComponent <UILabel>();
            TitleLabel.text = mTaskConfig.GetNameByChapter(Chapter);


            checbox.Data = Chapter;
            UIEventListener.Get(checbox.gameObject).onClick += delegate(GameObject Obj)
            {
//				UIToggle check = CGObj.GetComponent<UIToggle>();
//				int data = (int)check.Data;
//				DisplayHua(data);
            };
        }
        uiGrid.repositionNow = true;
    }
    void Update()
    {
        if (!Application.isPlaying)
        {
            // editor
            if (AttributeNameMirror != AttributeName)
            {
                AttributeNameMirror = AttributeName;
                UpdateAttributeName();
            }

            if (mMirrorAttrType != AttriType)
            {
                mMirrorAttrType = AttriType;
                UpdateAttributeTypeIcon();
            }
        }

        if (!IsHidden() && HelpUtil.GetButtonState(false))
        {
            // show the attribute tip
            //
            Vector3 tTouchPos = HelpUtil.GetButtonPosition();

            Ray        tRay = Globals.Instance.MGUIManager.MGUICamera.ScreenPointToRay(tTouchPos);
            RaycastHit tHit;
            if (mBoxCollider.Raycast(tRay, out tHit, 1000))
            {
                Globals.Instance.MGUIManager.ShowAttributeTips(this);
            }
        }
    }
예제 #7
0
    void OnApplicationFocus(bool focus)
    {
#if UNITY_ANDROID || UNITY_IPHONE
        if (!Application.isEditor)
        {
            long timeSpan = 0;
            if (!focus)
            {
                lt = System.DateTime.Now;
            }
            else
            {
                if (lt == null)
                {
                    lt = System.DateTime.Now;
                }
                timeSpan = HelpUtil.GetTimeSpan(lt);
                if (timeSpan < 0)
                {
                    timeSpan = 0;
                }

                //Debug.Log("OnApplicationFocus timeSpan " + timeSpan.ToString());
            }

            publisher.NotifyMonoFocus(focus, timeSpan);
        }
#endif
    }
예제 #8
0
 public void DestroyAllmonsterObjs()
 {
     foreach (GameObject go in monsterObjs)
     {
         HelpUtil.DestroyObject(go);
     }
     monsterObjs.Clear();
 }
예제 #9
0
 public void DestroyAllChests()
 {
     foreach (GameObject go in chestObjs)
     {
         HelpUtil.DestroyObject(go);
     }
     chestObjs.Clear();
 }
예제 #10
0
    // refresh the package item
    public void UpdatePackageItem(ItemSlotType _type)
    {
        mCurrPackageType = _type;

        // clear the former selected item
        if (mCurrSelectedIconData != null)
        {
            mCurrSelectedIconData.checkButton.isChecked = false;
        }
        mCurrSelectedIconData = null;

        ItemTipsName.transform.localScale  = Vector3.one;
        ItemTipsMoney.transform.localScale = Vector3.one;
        ItemTipsDesc.transform.localScale  = Vector3.one;

        // foreach(AttributeIcon icon in ItemAttributeIcon){
        //  icon.transform.localScale = Vector3.one;
        // }

        // hide the operation button
        ShowOpBtn(null);

        List <ItemSlotData> tDataList = ItemDataManager.Instance.GetItemDataList(_type);

        for (int i = 0; i < mCurrIconItemList.Count; i++)
        {
            IconData t_iconData = mCurrIconItemList[i];

            t_iconData.checkButton.isChecked = false;

            bool t_setIcon = false;

            // add Dictionary.Values to List for iterating
            foreach (ItemSlotData data in tDataList)
            {
                if (data.LocationID == i)
                {
                    t_setIcon           = true;
                    t_iconData.itemData = data;
                    HelpUtil.SetItemIcon(t_iconData.checkButton.transform, t_iconData.itemData, !ShopSellItemPackage);
                    break;
                }
            }

            if (!t_setIcon)
            {
                t_iconData.itemData            = new ItemSlotData();
                t_iconData.itemData.LocationID = i;
                t_iconData.itemData.SlotType   = _type;
                t_iconData.itemData.SlotState  = ItemSlotState.LOCK;
                HelpUtil.SetItemIcon(t_iconData.checkButton.transform, null, !ShopSellItemPackage);
            }
        }

        mCurrSelPageIndicatorIdx = 0;

        // SetPackageHighLight(HighLightRule.HIGHLIGHT_NONE);
    }
예제 #11
0
    public void DisplayChapterList()
    {
        HelpUtil.DelListInfo(uiGrid.transform);

        int i = 0;

        foreach (var Chapter in mChapterDic)
        {
            GameObject CGObj = GameObject.Instantiate(CGItemPrefab) as GameObject;
            CGObj.transform.parent        = uiGrid.transform;
            CGObj.transform.localScale    = Vector3.one;
            CGObj.transform.localPosition = new Vector3(0, 0, -5);
            UIToggle checbox = CGObj.GetComponent <UIToggle>();

            UILabel TitleLabel = CGObj.transform.Find("TitleLabel").GetComponent <UILabel>();
            int     numHua     = 0;
            if (mChapterDic[Chapter.Key].Contains(mNoteHua))
            {
                numHua = mChapterDic[Chapter.Key].Count - 1;
            }
            else
            {
                numHua = mChapterDic[Chapter.Key].Count;
            }
            TitleLabel.text = mTaskConfig.GetNameByChapter(Chapter.Key) + "(" + numHua.ToString() + Globals.Instance.MDataTableManager.GetWordText(6013) + ")";


            checbox.Data = Chapter.Key;
            UIEventListener.Get(checbox.gameObject).onClick += delegate(GameObject Obj)
            {
                UIToggle check = CGObj.GetComponent <UIToggle>();
                int      data  = (int)check.Data;
                DisplayHua(data);
            };
            ++i;
        }

        if (0 != mBranchChapter.Count)
        {
            GameObject CGObj = GameObject.Instantiate(CGItemPrefab) as GameObject;
            CGObj.transform.parent        = uiGrid.transform;
            CGObj.transform.localScale    = Vector3.one;
            CGObj.transform.localPosition = new Vector3(0, 0, -5);
            UIToggle checbox = CGObj.GetComponent <UIToggle>();

            UILabel TitleLabel = CGObj.transform.Find("TitleLabel").GetComponent <UILabel>();
            TitleLabel.text = "Branch";


            UIEventListener.Get(checbox.gameObject).onClick += delegate(GameObject Obj)
            {
                DisplayBranchHua();
            };
        }
        uiGrid.repositionNow = true;
        //uiDraggablePanel.ResetPosition();
    }
예제 #12
0
        protected override ScriptControlDescriptor GetScriptDescriptor()
        {
            ScriptControlDescriptor scriptDescriptor = base.GetScriptDescriptor();

            scriptDescriptor.Type = "SubscriptionResultWizardStep";
            scriptDescriptor.AddProperty("FailedHelpLink", HelpUtil.BuildEhcHref(OptionsHelpId.AutoProvisionFailed.ToString()));
            scriptDescriptor.AddProperty("NewPopAccessible", LoginUtil.CheckUrlAccess("NewPopSubscription.aspx"));
            scriptDescriptor.AddProperty("NewImapAccessible", LoginUtil.CheckUrlAccess("NewImapSubscription.aspx"));
            return(scriptDescriptor);
        }
예제 #13
0
 /**
  *
  * @param allowContinuousPay
  * @param amount
  * @param serverId
  * @param roleId
  * @param roleName
  * @param grade
  * @param customInfo 充值自定义信息,此信息作为充值订单的附加信息,充值过程中不作任何处理,仅用于游戏设置自助信息,比如游戏自身产生的订单号、玩家角色、游戏模式等。
  *    如果设置了自定义信息,UC在完成充值后,调用充值结果回调接口向游戏服务器发送充值结果时将会附带此信息,游戏服务器需自行解析自定义信息。
  *    如果不需设置自定义信息,将此参数置为空字符串即可。
  * @return
  *
  */
 //
 /// <summary>
 /// 执行充值下单操作,此操作会调出充值界面。
 /// </summary>
 /// <param name="allowContinuousPay">设置是否允许连接充值,true表示在一次充值完成后在充值界面中可以继续下一笔充值,false表示只能进行一笔充值即返回游戏。</param>
 /// <param name="amount">充值金额。默认为0,如果不设或设为0,充值时用户从充值界面中选择或输入金额;如果设为大于0的值,表示固定充值金额,不允许用户选择或输入其它金额。</param>
 /// <param name="serverId">当前充值的游戏服务器(分区)标识,此标识即UC分配的游戏服务器ID</param>
 /// <param name="roleId">当前充值用户在游戏中的角色标识</param>
 /// <param name="roleName">当前充值用户在游戏中的角色名称</param>
 /// <param name="grade">当前充值用户在游戏中的角色等级</param>
 /// <param name="customInfo">
 /// 充值自定义信息,此信息作为充值订单的附加信息,充值过程中不作任何处理,仅用于游戏设置自助信息,比如游戏自身产生的订单号、玩家角色、游戏模式等。
 /// 如果设置了自定义信息,UC在完成充值后,调用充值结果回调接口向游戏服务器发送充值结果时将会附带此信息,游戏服务器需自行解析自定义信息。
 /// 如果不需设置自定义信息,将此参数置为空字符串即可。
 /// </param>
 public static void pay(bool allowContinuousPay,
                        float amount,
                        int serverId,
                        string roleId,
                        string roleName,
                        string grade,
                        string customInfo)
 {
     HelpUtil.AndroidNativeCallStatic(SDK_JAVA_CLASS, "pay", allowContinuousPay, amount, serverId, roleId, roleName, grade, customInfo);
 }
예제 #14
0
    private void DisplayHua(int Chapter)
    {
        NGUITools.SetActive(ButtonBack.gameObject, true);
        HelpUtil.DelListInfo(uiGrid.transform);

        mChapterDic[Chapter].Sort();

        mChapterDic[Chapter].Reverse();
        int i = 0;

        foreach (int Hua in mChapterDic[Chapter])
        {
            GameObject CGObj = GameObject.Instantiate(CGItemPrefab) as GameObject;
            Task_Play.Task_PlayObject Data = mTaskConfig.GetObjByID(Hua);
            UILabel TitleLabel             = CGObj.transform.Find("TitleLabel").GetComponent <UILabel>();


            CGObj.transform.parent        = uiGrid.transform;
            CGObj.transform.localScale    = Vector3.one;
            CGObj.transform.localPosition = new Vector3(0, 0, -5);
            UIToggle checbox = CGObj.GetComponent <UIToggle>();


            if (Hua == mNoteHua)
            {
                UILabel DisableTitleLabel = CGObj.transform.Find("DisableTitleLabel").GetComponent <UILabel>();
                NGUITools.SetActive(DisableTitleLabel.gameObject, true);
                NGUITools.SetActive(TitleLabel.gameObject, false);
                DisableTitleLabel.text = "Next" + Data.Task_Title;
                checbox.enabled        = false;
            }
            else
            {
                TitleLabel.text = Data.Task_Title;
                checbox.Data    = Data;
                UIEventListener.Get(checbox.gameObject).onClick += delegate(GameObject Obj)
                {
                    UIToggle check = CGObj.GetComponent <UIToggle>();
                    Task_Play.Task_PlayObject DataIn = mTaskConfig.GetObjByID(Hua);
                    Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>(delegate(GUITaskTalkView gui)
                    {
                        NGUITools.SetActive(this.gameObject, false);
                        gui.ClentTask = true;
                        gui.UpdateData(Data.Task_IDList[0], delegate(){
                            gui.DestroyThisGUI();
                            NGUITools.SetActive(this.gameObject, true);
                        });
                    });
                };
            }

            ++i;
        }
        uiGrid.repositionNow = true;
    }
예제 #15
0
    public void ShowAgainChallengeInformation(sg.GS2C_Challenge_Again_Info_Res res)
    {
        NGUITools.SetActive(MemoryInformation, false);
        NGUITools.SetActive(ChallengeInformation, true);

        FreeNum.text = res.againNum.ToString();

        int playerTotalScore = 0;

        HelpUtil.DelListInfo(ChallengeUIGrid.transform);

        foreach (sg.GS2C_Challenge_Again_Info_Res.TaskCompleteInfo info in res.taskCompleteInfo)
        {
            GameObject item = GameObject.Instantiate(ChallengeTaskItem) as GameObject;
            item.transform.parent        = ChallengeUIGrid.transform;
            item.transform.localScale    = Vector3.one;
            item.transform.localPosition = Vector3.zero;

            item.name = "ChallengeTaskItem" + info.taskId;
            UISprite gradeSprite  = item.transform.Find("GradeSprite").GetComponent <UISprite>();
            UILabel  taskName     = item.transform.Find("TaskName").GetComponent <UILabel>();
            UILabel  totalScore   = item.transform.Find("TotalScore").GetComponent <UILabel>();
            UIButton challengeBtn = item.transform.Find("ChallengeBtn").GetComponent <UIButton>();

            GameObject star  = item.transform.Find("Star").gameObject;
            string[]   str   = { "PurpSprite", "YelloSprite" };
            string[]   strbg = { "PurpBgSprite", "YelloBgSprite" };
            for (int i = 1; i <= FinalEvaluation(info.grade); i++)
            {
                UISprite bg     = star.transform.Find(strbg[i - 1]).GetComponent <UISprite>();
                UISprite sprite = star.transform.Find(str[i - 1]).GetComponent <UISprite>();
                NGUITools.SetActive(bg.gameObject, false);
                NGUITools.SetActive(sprite.gameObject, true);
            }
            playerTotalScore      += info.totalScore;
            gradeSprite.spriteName = HangyeDengji[FinalEvaluation(info.grade)];
            totalScore.text        = info.totalScore.ToString();
            TaskConfig.TaskObject element = null;
            bool ishas = taskConfig.GetTaskObject(info.taskId, out element);
            if (!ishas)
            {
                return;
            }
            taskName.text     = element.Name;
            challengeBtn.Data = info.taskId;
            UIEventListener.Get(challengeBtn.gameObject).onClick += OnClickChallengeBtn;
        }

        ChallengeUIGrid.sorting       = UIGrid.Sorting.Custom;
        ChallengeUIGrid.repositionNow = true;
        ChallengeUIGrid.Reposition();

        CheckpointLabel.text = res.taskCompleteInfo.Count.ToString();
        ScoreLabel.text      = playerTotalScore.ToString();
    }
예제 #16
0
    public void ShowMemoryInfor()
    {
        NGUITools.SetActive(BaseInformation, true);
        NGUITools.SetActive(MemoryInformation, true);
        NGUITools.SetActive(ChallengeInformation, false);
        GameEndConfig gameEndConfig = Globals.Instance.MDataTableManager.GetConfig <GameEndConfig>();
        Dictionary <int, GameEndConfig.GameEndElement> _mGameEndElementList = gameEndConfig.GetGameEndElementList();

        MemoryUIGrid.maxPerLine = ((_mGameEndElementList.Count % 2) == 0) ? (_mGameEndElementList.Count / 2):(_mGameEndElementList.Count / 2 + 1);
        HelpUtil.DelListInfo(MemoryUIGrid.transform);
        int i = 0;

        foreach (KeyValuePair <int, GameEndConfig.GameEndElement> mPair in _mGameEndElementList)
        {
            GameObject memoryItem = GameObject.Instantiate(MemoryItem) as GameObject;
            memoryItem.transform.parent        = MemoryUIGrid.transform;
            memoryItem.transform.localScale    = Vector3.one;
            memoryItem.transform.localPosition = Vector3.zero;
            UITexture iconTexture = memoryItem.transform.Find("IconTexture").GetComponent <UITexture>();
            UITexture unlocked    = memoryItem.transform.Find("Unlocked").GetComponent <UITexture>();
            iconTexture.mainTexture = Resources.Load("Icon/EndingIcon/" + mPair.Value.End_Pic, typeof(Texture2D)) as Texture2D;
            int taskid = GetGameEndingState(mPair.Value.Get_Task);
            if (taskid > 0)
            {
                ProgressNum++;
                NGUITools.SetActive(unlocked.gameObject, false);

                memoryItem.name = "AAMemoryItem" + i;
            }
            else
            {
                NGUITools.SetActive(unlocked.gameObject, true);
                memoryItem.name = "BBMemoryItem" + i;
            }

            UIToggle btn = memoryItem.transform.GetComponent <UIToggle>();
            btn.Data = taskid;

            if (i == 0)
            {
                btn.startsActive = true;
            }

            UIEventListener.Get(btn.gameObject).onClick += OnClickGameEndBtn;

            i++;
        }

        MemoryUIGrid.sorting       = UIGrid.Sorting.Custom;
        MemoryUIGrid.repositionNow = true;
        MemoryUIScrollView.ResetPosition();


        ProgressLabel.text = ProgressNum.ToString() + "/" + _mGameEndElementList.Count.ToString();
    }
예제 #17
0
        /// <summary>
        /// Replace place holders within script.
        /// </summary>
        /// <param name="tenant">Tenant authentication data.</param>
        /// <param name="script">PowerShell script with place holders.</param>
        /// <returns>Returns PowerShell script without place holders.</returns>
        private static string ReplacePlaceHolders(TenantAuthentication tenant, string script)
        {
            script = ReplacePlaceHolder(script, PLACEHOLDER_CURRENT_DIRECTORY, Environment.CurrentDirectory);
            script = ReplacePlaceHolder(script, PLACEHOLDER_TENANT_URL, tenant.AdminUrl.ToString());
            script = ReplacePlaceHolder(script, PLACEHOLDER_LOGIN_NAME, tenant.UserName);
            script = ReplacePlaceHolder(script, PLACEHOLDER_AUTHENTICATION, AUTHENTICATION_TENANT);
            script = ReplacePlaceHolder(script, PLACEHOLDER_CLIENT_SDK, HelpUtil.GetSDKDownloadTitle());
            script = ReplacePlaceHolder(script, PLACEHOLDER_CLIENT_SDK_URL, HelpUtil.GetSDKDownloadUrl());
            script = ReplacePlaceHolder(script, PLACEHOLDER_CLIENT_SDK_VERSION, HelpUtil.GetSDKMajorVersion());

            return(script);
        }
예제 #18
0
    public static bool IsGuestLogined()
    {
        // status
        // 0: not login
        // 1: account logined
        // 2: geust logined
        //
        int status = HelpUtil.AndroidNativeCallStatic <int>(JavaClassUnity2NdSDK, "ndGetLoginStatus");

        Debug.Log("ndGetLoginStatus == " + status);
        return(status == 2);
    }
예제 #19
0
    void Update()
    {
        bool tPlayDone = HelpUtil.GetButtonState(false);

        // some tap event to stop cutscene
        if (tPlayDone && m_currCameraAnimControl != null)
        {
            m_currCameraAnimControl.Stop(true);
            Destroy(m_currCameraAnimControl);
            m_currCameraAnimControl = null;
        }
    }
예제 #20
0
    public void ShowSuperFansInfor()
    {
        WarshipConfig warshipConfig        = Globals.Instance.MDataTableManager.GetConfig <WarshipConfig>();
        List <int>    _mWarshipElementList = Globals.Instance.MGameDataManager.MActorData.WarshipList;
        Dictionary <int, WarshipConfig.WarshipObject> warshipDic = warshipConfig.getWarshipDic();

        int warshipCount = 5;

        if (_mWarshipElementList.Count >= 5)
        {
            warshipCount = _mWarshipElementList.Count + 1;
        }

        SuperFansLabel.text = "[1f961f]" + _mWarshipElementList.Count + "[-][000000]/" + warshipDic.Count + "[-]";
        HelpUtil.DelListInfo(SuperFansUIGrid.transform);
        for (int i = 0; i < warshipCount; i++)
        {
            GameObject superFansItem = GameObject.Instantiate(SuperFansItem) as GameObject;
            superFansItem.transform.parent        = SuperFansUIGrid.transform;
            superFansItem.transform.localScale    = Vector3.one;
            superFansItem.transform.localPosition = Vector3.zero;

            UITexture  iconTexture   = superFansItem.transform.Find("IconTexture").GetComponent <UITexture>();
            GameObject fansInfo      = superFansItem.transform.Find("FansInfo").gameObject;
            UILabel    nameLabel     = fansInfo.transform.Find("NameLabel").GetComponent <UILabel>();
            UILabel    describeLabel = fansInfo.transform.Find("DescribeLabel").GetComponent <UILabel>();
            UILabel    fansSayLabel  = fansInfo.transform.Find("FansSayLabel").GetComponent <UILabel>();
            UILabel    unKnownLabel  = superFansItem.transform.Find("UnKnownLabel").GetComponent <UILabel>();

            WarshipConfig.WarshipObject mPair = null;
            if (_mWarshipElementList[i] != null && _mWarshipElementList.Count > i && warshipDic.TryGetValue(_mWarshipElementList[i], out mPair))
            {
                iconTexture.mainTexture = Resources.Load("Icon/FansIcon/" + mPair.Fans_Icon, typeof(Texture2D)) as Texture2D;
                nameLabel.text          = mPair.Name;
                describeLabel.text      = mPair.Art_Describe;
                fansSayLabel.text       = mPair.Fans_Say;
                superFansItem.name      = "AAItem" + i;
                NGUITools.SetActive(unKnownLabel.gameObject, false);
                NGUITools.SetActive(fansInfo, true);
            }
            else
            {
                iconTexture.mainTexture = Resources.Load("Icon/FansIcon/UnKnown", typeof(Texture2D)) as Texture2D;
                NGUITools.SetActive(unKnownLabel.gameObject, true);
                NGUITools.SetActive(fansInfo, false);
                superFansItem.name = "BBItem" + i;
            }
        }
        SuperFansUIGrid.sorting       = UIGrid.Sorting.Custom;
        SuperFansUIGrid.repositionNow = true;
        SuperFansUIScrollView.ResetPosition();
    }
        public static bool IsCustom(this SPClient.Feature feature)
        {
            Feature f = HelpUtil.GetFeature(feature.DefinitionId);

            if (f == null)
            {
                return(false);
            }
            else
            {
                return(f.IsCustomDefinition);
            }
        }
예제 #22
0
        private void LoadSite()
        {
            try
            {
                // Validate input
                Regex regex = new Regex(@"((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)");
                if (!regex.IsMatch(tbSiteUrl.Text.Trim()) || tbSiteUrl.Text.Contains("_layouts"))
                {
                    MessageBox.Show("Please enter a valid site collection URL, like https://company.sharepoint.com or https://company.sharepoint.com/sites/teamsite.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                // Add new site collection
                AuthenticationMode authentication = (AuthenticationMode)cbAuthentication.SelectedIndex;
                SiteAuthentication site           = Globals.Sites.Add(new Uri(tbSiteUrl.Text), tbUsername.Text.Trim(), tbPassword.Text.Trim(), authentication);

                // Warning on mismatch SPCB and server build version
                Server server = null;
                if (!ProductUtil.DoesServerBuildVersionMatchThisRelease(site.BuildVersion, out server))
                {
                    if (MessageBox.Show($"The site you added is incompatible with this release of SharePoint Client Browser.\n\nThe site seems to be hosted on {server.ProductFullname} ({server.BuildVersion}) which is compatible with '{server.CompatibleRelease}', you can download this from {Constants.CODEPLEX_PROJECT_URL}.\n\nDo you want to download the '{server.CompatibleRelease}' release now?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start(Constants.CODEPLEX_PROJECT_URL);
                    }
                }

                // Close dialog
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (System.IO.FileNotFoundException ex)
            {
                // Handle the file not found exception "The specified module could not be found. (Exception from HRESULT: 0x8007007E)",
                // caused by not having installed the SharePoint Client Components
                string message = string.Format(Resources.ErrorMissingAssemblySDK, ex.Message, HelpUtil.GetSDKDownloadTitle(), Application.ProductName);

                ToggleButtons(true);
                if (MessageBox.Show(message, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(HelpUtil.GetSDKDownloadUrl());
                }

                LogUtil.LogException(ex);
            }
            catch (Exception ex)
            {
                ToggleButtons(true);
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                LogUtil.LogException(ex);
            }
        }
예제 #23
0
    public void ShowRankingInfo(sg.GS2C_Ranking_List_Info_Res res)
    {
        NGUITools.SetActive(BaseInformation, false);
        NGUITools.SetActive(RankingInformation, true);
        HelpUtil.DelListInfo(RankingUIGrid.transform);

        foreach (sg.GS2C_Ranking_List_Info_Res.RankingList info in res.rankingList)
        {
            GameObject item = GameObject.Instantiate(RankingItem) as GameObject;
            item.transform.parent        = RankingUIGrid.transform;
            item.transform.localScale    = Vector3.one;
            item.transform.localPosition = Vector3.zero;

            item.name = "Item" + getNumOrString(info.ranking);
            UILabel  rankingNum    = item.transform.Find("RankingNum").GetComponent <UILabel>();
            UILabel  playerName    = item.transform.Find("PlayerName").GetComponent <UILabel>();
            UILabel  totalScore    = item.transform.Find("TotalScore").GetComponent <UILabel>();
            UILabel  checkpointNum = item.transform.Find("CheckpointNum").GetComponent <UILabel>();
            UISprite kingSprite    = item.transform.Find("KingSprite").GetComponent <UISprite>();

            rankingNum.text    = info.ranking.ToString();
            playerName.text    = info.name;
            totalScore.text    = info.totalScore.ToString();
            checkpointNum.text = info.checkpointsNum.ToString();
            if (info.ranking < 4)
            {
                kingSprite.spriteName = "King" + info.ranking.ToString();
                NGUITools.SetActive(kingSprite.gameObject, true);
            }
            else
            {
                NGUITools.SetActive(kingSprite.gameObject, false);
            }
            UIButton btn = item.transform.GetComponent <UIButton>();
            btn.Data = info;
            UIEventListener.Get(btn.gameObject).onClick += OnClickRankingDetailBtn;
        }

        RankingUIGrid.sorting       = UIGrid.Sorting.Custom;
        RankingUIGrid.repositionNow = true;
        RankingUIGrid.Reposition();

        if (res.myRanking > 0)
        {
            RankingNum.text = res.myRanking.ToString();
        }
        PlayerName.text    = Globals.Instance.MGameDataManager.MActorData.BasicData.Name;
        TotalScore.text    = res.myTotalScore.ToString();
        CheckpointNum.text = res.myCheckpointsNum.ToString();
    }
예제 #24
0
    private void OnClickSeleteServerBtn(GameObject obj)
    {
        NGUITools.SetActive(SeleteServerBtn.gameObject, false);
        NGUITools.SetActive(XueJiZhuCeFrame, false);
        NGUITools.SetActive(ZhucePanel, false);
//		NGUITools.SetActive(SeleteServerFrame,true);
//		welcomPanel.gameObject.SetActiveRecursively(false);
        NGUITools.SetActive(welcomPanel.gameObject, false);
        HelpUtil.DelListInfo(ServerScrollList.transform);
        ServerScrollList.repositionNow = true;
        int        i            = 0;
        GameObject serverObject = null;
        UILabel    label;
        UIButton   imageButton = null;

        foreach (sg.LS2C_Login_Get_Server_Res.LoginGameServer gameServer in Globals.Instance.MLSNetManager.AllGameServers)
        {
            serverObject = GameObject.Instantiate(ServerObj) as GameObject;
            serverObject.transform.parent        = ServerScrollList.transform;
            serverObject.transform.localPosition = new Vector3(0, 0, -25.0f);
            serverObject.name = "ServerBtn" + i.ToString();

            label            = serverObject.transform.Find("Label").GetComponent <UILabel>();
            label.text       = gameServer.name;
            imageButton      = serverObject.transform.GetComponent <UIButton>();
            imageButton.Data = gameServer;

            UISprite hotSprite = serverObject.transform.Find("HotSprit").GetComponent <UISprite>();
            NGUITools.SetActive(hotSprite.gameObject, gameServer.recommendState == 2);

            UISprite newSprite = serverObject.transform.Find("NewSprit").GetComponent <UISprite>();
            NGUITools.SetActive(newSprite.gameObject, gameServer.recommendState == 1);


            UIEventListener.Get(imageButton.gameObject).onClick += OnClickImageServerBtn;
            //serverObject.transform.localPosition = new Vector3(0,0, -10);
            serverObject.transform.localScale = Vector3.one;
            ++i;
        }
//	    TweenPosition tw = TweenPosition.Begin(SeleteServerFrame,0.8f,new Vector3(0,0,0));

        ResentlyServerLabel.text       = Globals.Instance.MLSNetManager.CurrGameServer.name;
        SeleteServerLabel.text         = Globals.Instance.MLSNetManager.CurrGameServer.name;
        ServerScrollList.repositionNow = true;
        NGUITools.SetTweenActive(SeleteServerFrame, true, delegate {
        });
        //gsScrollListPanelItem.ResetPosition();
    }
예제 #25
0
    void OnApplicationPause(bool pause)
    {
        //Debug.Log("OnApplicationPause    !!!!!!!" + pause.ToString());
        long timeSpan = 0;

        if (pause)
        {
            lt      = System.DateTime.Now;
            isPause = true;
        }
        else
        {
            if (lt == null)
            {
                lt = System.DateTime.Now;
            }
            timeSpan = HelpUtil.GetTimeSpan(lt);
            if (timeSpan < 0)
            {
                timeSpan = 0;
            }


            if (isPause)
            {
                isPause = false;

                Debug.Log("OnApplicationPause    !!!!!!!" + timeSpan);
                Debug.Log("Application is back form pause!!!!!!!");
                Debug.Log("ThirdPartyPlatform.mIs360Logining is :" + ThirdPartyPlatform.mIs360Logining);
                //if (!ThirdPartyPlatform.mIs360Logining)
                //{
                //	if (timeSpan > 4 * 60 * 1000)
                //	{
                //		ThirdPartyPlatform.CloseSDK();
                //		Globals.Instance.IsStarterRestart = true;
                //		StartCoroutine(InvokeStaterRestartDelegate());
                //		return ;
                //	}
                //	else if (timeSpan > 60 * 1000)
                //	{
                //		Globals.Instance.MGSNetManager.clearPendingQueueAndReconnect();
                //	}
                //}
            }
        }
        publisher.NotifyMonoPause(pause, timeSpan);
    }
    public void showTaskLables(sg.GS2C_Task_GetLabels_Res res)
    {
        NGUITools.SetActive(npcIcon.transform.parent.gameObject, false);
        string atlasPath = "UIAtlas/" + "Home1";

        textureBackgroundScene.mainTexture = Resources.Load(atlasPath, typeof(Texture2D)) as Texture2D;

        NGUITools.SetActive(SkipBtnAll.gameObject, false);

        Task_Label taskLabelConfig = Globals.Instance.MDataTableManager.GetConfig <Task_Label>();

//		NGUITools.SetActive(TaskDialogGameObject , false);
        NGUITools.SetActive(TaskLabelGameObject, true);

        cacheFatherTaskId = res.fatherTaskId;

        HelpUtil.DelListInfo(TaskLabelGameObject.transform);
        for (int i = 0; i < res.tasks.Count; i++)
        {
            int taskLabelID = res.tasks[i];

            GameObject taskLabelItem = GameObject.Instantiate(taksLableItemPrefab) as GameObject;
            taskLabelItem.transform.parent        = TaskLabelGameObject.transform;
            taskLabelItem.transform.localPosition = LabelItem_Positon[i];
            taskLabelItem.transform.localScale    = Vector3.one;


            UILabel  taskLabel  = taskLabelItem.transform.Find("TaskLabel").GetComponent <UILabel>();
            UISprite needSprite = taskLabelItem.transform.Find("NeedSprite").GetComponent <UISprite>();
            UILabel  needLabel  = needSprite.transform.Find("NeedLabel").GetComponent <UILabel>();

            Task_Label.TaskLabelElement element = taskLabelConfig.GetTaskLabelElement(taskLabelID);
            if (element == null)
            {
                return;
            }
            taskLabel.text = element.Title;
            NGUITools.SetActive(needSprite.gameObject, false);

            UIButton btn = taskLabelItem.transform.GetComponent <UIButton>();
            btn.Data = taskLabelID;
            UIEventListener.Get(btn.gameObject).onClick += OnClickTaskLabelItemBtn;
        }

        GUIGuoChang.Hide();
    }
예제 #27
0
    //init ui data
    void InitUIData(PlayerData playerData)
    {
        TextRoleName.text = playerData.BasicData.Name + "";
        FansLabel.text    = HelpUtil.GetMoneyFormattedText(playerData.starData.nRoleFenSi);

        SuperFsanLabel.text = Globals.Instance.MGameDataManager.MActorData.WarshipList.Count.ToString();
        TimeNumLabel.text   = "X" + playerData.WealthData.Oil.ToString();

//		if(Globals.Instance.MTaskManager.urlTexture!=null)
//		{
//			AvatarIconTexture.mainTexture = Globals.Instance.MTaskManager.urlTexture.URLTexture;
//		}
//		else
//		{
//			AvatarIconTexture.mainTexture = Resources.Load("Icon/AvatarIcon/GirlAvatar03",typeof(Texture2D)) as Texture2D;
//		}
    }
예제 #28
0
    void AddFormationCell(string grid, List <FormationCell> list)
    {
        int x, z;

        HelpUtil.CalculateGrid(grid, out x, out z);

        if (-1 == x || -1 == z)
        {
            return;
        }

        FormationCell cell;

        cell.x = x;
        cell.z = z;
        list.Add(cell);
    }
예제 #29
0
    // Use this for initialization
    protected void Awake()
    {
        publisher.NotifyMonoAwake();
        // Don't destroy this script when loading.
        DontDestroyOnLoad(this.gameObject);

        GameObject tStaticRes = GameObject.Find("StaticRes");

        if (tStaticRes != null)
        {
            DontDestroyOnLoad(tStaticRes);
        }

        // Start time
        mDataTime      = new System.DateTime();
        mDataTime      = System.DateTime.Now;
        mLastFrameTime = mDataTime;

        Input.imeCompositionMode = IMECompositionMode.On;
        //-------------------
        // Set random seed.
        UnityEngine.Random.seed = (int)System.DateTime.Now.Ticks;
        phoneImei = SystemInfo.deviceUniqueIdentifier;
        //-------------


        Debug.Log("Application.persistentDataPath : " + Application.persistentDataPath);

        // 2012.05.22 LiHaojie Adjust the targetFrameRate is 35 fps
        Application.targetFrameRate = 35;
        Application.runInBackground = true;

        Globals.Instance.Awake();

        GameSystemInfo.CollectSystemInfo();
        //TalkingDataGA.SessionStarted("01BD57E566CD46FF3889ED4A4D547BD4", "gfan");

        if (!GameDefines.ToastEnabled)
        {
            HelpUtil.DestroyObject(textShow.gameObject);
            textShow = null;
        }


//		AdaptiveUI ();
    }
    public void DestroyThisGUI()
    {
        GameObject skyGameObj = GameObject.Find("PortSky");

        if (skyGameObj != null)
        {
            GameObject.Destroy(skyGameObj);
        }

        GameObject priorGameObj = Globals.Instance.MSceneManager.mTaskCamera.transform.Find("SpriteScenePreground").gameObject;

        if (priorGameObj != null)
        {
            Destroy(priorGameObj.GetComponent <TweenAlpha>());
            NGUITools.SetActive(priorGameObj, false);
        }

        HelpUtil.DelListInfo(textureBackgroundScene.transform);
        if (null != textureBackgroundScene)
        {
            GameObject.DestroyImmediate(textureBackgroundScene.gameObject);
        }



        GameObject.Destroy(mCharacterCustomizeOne.gameObject);
        GameObject.Destroy(mCharacterCustomizeNPC.gameObject);

        mCharacterCustomizeCurrent = null;

        Globals.Instance.MSceneManager.ChangeCameraActiveState(SceneManager.CameraActiveState.MAINCAMERA);


        if (CurTask != null && CurTask.Task_Category != (int)TaskManager.TaskCategory.EXPLORE)
        {
            string sceneName = Globals.Instance.MSceneManager.GetSceneName();
            Globals.Instance.MSoundManager.PlaySceneSound(sceneName);
        }

        base.Close();
        OnDestroy();

        Resources.UnloadUnusedAssets();
        System.GC.Collect();
    }