コード例 #1
0
    public static WGGuideHelpView CreateGuideView()
    {
        Object obj = Resources.Load("pbWGGuideHelpView");

        if (obj != null)
        {
            GameObject      go  = Instantiate(obj) as GameObject;
            WGGuideHelpView ghv = go.GetComponent <WGGuideHelpView>();
            return(ghv);
        }
        return(null);
    }
コード例 #2
0
ファイル: WGHelpManager.cs プロジェクト: linbozhang/ThrowCoin
    public void ShowHelpView(EMHelpStates hs)
    {
        bViewShow = true;

        curGuideView = WGGuideHelpView.CreateGuideView();
        curGuideView.showNextPrefabs((int)hs);
        StatesEnd(hs);

        int p = 0;

        for (int i = 0; i < max; i++)
        {
            if (dp.dicHelp.ContainsKey(i) && dp.dicHelp[i] == 1)
            {
                p++;
            }
        }
        if (p == max)
        {
            dp.mHelpEnd  = 1;
            this.enabled = false;
        }
        string missionName = WGStrings.getText(8100 + (int)hs);

        //Debug.Log("==============="+missionName);
                #if TalkingData
        TDGAMission.OnBegin(missionName);
                #endif
#if Umeng
        var dict = new Dictionary <string, string>();
        dict.Add("states", hs.ToString());

        Umeng.GA.Event(UmengKey.UserHelp, dict);
#endif
        SDK.AddChild(curGuideView.gameObject, go2DRoot);
        curGuideView.ESetActive(true);
        curGuideView.showView();
        if (hs == EMHelpStates.Use_Item)
        {
            curGuideView.hideBtnOK();
            UIEventListener.Get(WGGameUIView.Instance.mMainMenuView.btnGuide).onClick = (GameObject obj) => curGuideView.OnBtnOk();
            WGGameUIView.Instance.mMainMenuView.hightLightBtnSkill4();
        }
        if (hs == EMHelpStates.Use_Weapon)
        {
            curGuideView.hideBtnOK();
            UIEventListener.Get(WGGameUIView.Instance.mMainMenuView.btnGuide).onClick = (GameObject obj) => curGuideView.OnBtnOk();
            //curGuideView.setBtnOKPos(WGGameUIView.Instance.mMainMenuView.btnAdd.transform.position);
            WGGameUIView.Instance.mMainMenuView.hightLightBtnAdd();
        }
        curGuideView.alertViewBehavriour = (ab, view) => {
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                if (hs == EMHelpStates.Free10_Skill)
                {
                    dp.guDingTime    = 10 * 60;
                    dp.releaseGuding = 1;
                    WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_GuDing30);
                    WGAlertViewController.Self.showAlertView(1068).alertViewBehavriour = (ab1, view1) => {
                        switch (ab1)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                            view1.hiddenView();

                            //TDGAMission.OnBegin(WGStrings.getText(8110));
                            break;

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.destroyAlertView(view1);

                            //TDGAMission.OnCompleted(WGStrings.getText(8110));

                            break;
                        }
                    };
                }
                if (hs == EMHelpStates.Use_Item)
                {
                    WGGameUIView.Instance.mMainMenuView.unLightBtnSkill4();
                    WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_FangYu4);
                }
                if (hs == EMHelpStates.Use_Weapon)
                {
                    WGGameUIView.Instance.mMainMenuView.unLightBtnAdd();
                    WGBearManage.Instance.csThrow.ChangeWeaponAdd();
                    //WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_GuDing30);
                }
                view.hiddenView();
                //Debug.Log("Completed ========"+missionName);
                //TDGAMission.OnCompleted(missionName);
                break;

            case MDAlertBehaviour.DID_SHOW:
                Time.timeScale = 0;
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                Time.timeScale = 1;
                Destroy(curGuideView.gameObject);
                curGuideView = null;
                StartCoroutine(resetViewShow());
                break;
            }
        };
    }