Inheritance: MonoBehaviour
Beispiel #1
0
    public override void Hide()
    {
        base.Hide();

        CameraManager.instance.mainCamera.gameObject.SetActive(true);

        //List<NetData._ItemData> itemList = NetData.instance.GetUserInfo().GetTypeItemList(eItemType.USE);
        //for (int i = 0; i < itemList.Count; i++)
        //{
        //    if (!itemList[i].IsNewItem)
        //        continue;

        //    itemList[i].IsNewItem = false;//나갈때 다 꺼져
        //}

        SceneManager.instance.SetAlram(AlramIconType.CATEGORY, false);

        if (ReOpenPanel != null)
        {
            ReOpenPanel.Show(ReOpenPanel.GetParams());
        }
        else
        {
            Debug.LogWarning("ReOpenPanel is Null");
            UIMgr.OpenTown();
        }
    }
    public int m_iAreaInfoID;       //该观察点表示的场景Info

    void Awake()
    {
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;

        //启动后隐藏 由UI生成标识
        GetComponent<SpriteRenderer>().enabled = false;
    }
Beispiel #3
0
 protected override void RegisterUIEvent()
 {
     BtnReturn.AddCallback(() =>
     {
         UIMgr.Push <LevelPanel>();
     });
 }
Beispiel #4
0
 public void Close( )
 {
     //
     gameObject.SetActive(false);
     _Openning = false;
     UIMgr.CloseWnd(this);
 }
Beispiel #5
0
        /// <summary>
        /// 处理点击确认创建馆
        /// </summary>
        void HandleBtnSureCreatParlor()
        {
            GameData gd = GameData.Instance;

            //如果玩家不满足开馆条件,直接拦截
            if ((gd.PlayerNodeDef.iCoin) <= 0 && gd.PlayerNodeDef.byCreateParlorCert == 0)
            {
                UIMgr.GetInstance().GetUIMessageView().Show("您的金币数量不足,无法开馆");
                return;
            }

            //发送创建麻将馆之前,初始化面板数据
            if (UIMainView.Instance.ParlorShowPanel.ParlorName.text.Length < 2)
            {
                UIMgr.GetInstance().GetUIMessageView().Show("您的麻将馆名字长度不足");
                return;
            }

            SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData;

            Network.Message.NetMsg.ClientCreateParlorReq msg = new Network.Message.NetMsg.ClientCreateParlorReq();
            msg.iUserId     = gd.PlayerNodeDef.iUserId;
            msg.iCityId     = sapd.iCityId;
            msg.iCountyId   = sapd.iCountyId;
            msg.cParlorName = UIMainView.Instance.ParlorShowPanel.ParlorName.text;
            Network.NetworkMgr.Instance.LobbyServer.SendCreateParlorReq(msg);
        }
Beispiel #6
0
        public override void start()
        {
            GameObject objLayer = UIMgr.CreateLayer(layerNo);

            if (objLayer == null)
            {
                return;
            }

            objLayer.transform.parent.gameObject.SetActive(true);
            objLayer.SetActive(true);

            Object2D   info   = UIMgr.GetItemInfo(itemID);
            GameObject objPic = null;

            if (info != null)
            {
                objPic = info.gameObject;
            }
            else
            {
                objPic      = UIMgr.CreatePic(objLayer);
                objPic.name = itemID;
            }

            Object2D picShow = objPic.GetComponent <Object2D>();

            picShow.AddAction(this);

            this.isEnd = true;
        }
Beispiel #7
0
    static int GetLayer(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <int>(L, 2))
            {
                UIMgr obj  = (UIMgr)ToLua.CheckObject <UIMgr>(L, 1);
                int   arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                UnityEngine.Transform o = obj.GetLayer(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <UILayer>(L, 2))
            {
                UIMgr   obj             = (UIMgr)ToLua.CheckObject <UIMgr>(L, 1);
                UILayer arg0            = (UILayer)ToLua.ToObject(L, 2);
                UnityEngine.Transform o = obj.GetLayer(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIMgr.GetLayer"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            UIMgr uiMgr = target as UIMgr;

            if (uiMgr.uiDic != null)
            {
                EditorGUILayout.LabelField("ui dic", uiMgr.uiDic.Count.ToString());
                int i = 0;
                foreach (var kv in uiMgr.uiDic)
                {
                    EditorGUILayout.LabelField((++i).ToString(), kv.Key);
                    EditorGUILayout.LabelField("layer:", ((Enums.LayerType)kv.Value.gameObject.layer).ToString());
                    EditorGUILayout.LabelField("sort:", kv.Value.canvas.planeDistance.ToString());
                }
            }

            if (uiMgr.uiDepthDic != null)
            {
                EditorGUILayout.LabelField("ui depth dic", uiMgr.uiDepthDic.Count.ToString());
                int i = 0;
                foreach (var kv in uiMgr.uiDepthDic)
                {
                    EditorGUILayout.LabelField((++i).ToString(), kv.Key);
                    EditorGUILayout.LabelField("depth:", kv.Value.ToString());
                }
            }
        }
Beispiel #9
0
    static void SetTriggerEvent(Collider existCol, Unit _Caster, float affectValue, AbilityData _ability)
    {
        //< 있을경우는 삭제
        ForwardTriggerEvent OrgtriggerEvt = existCol.gameObject.GetComponent <ForwardTriggerEvent>();

        if (OrgtriggerEvt != null)
        {
            UIMgr.Destroy(OrgtriggerEvt);
        }

        existCol.isTrigger = false;
        existCol.isTrigger = true;
        ForwardTriggerEvent triggerEvt = existCol.gameObject.AddComponent <ForwardTriggerEvent>();

        triggerEvt.Setup(_Caster, _ability);
        triggerEvt.TriggerEnter_Unit = (target, ForwardTriggerEvent) =>
        {
            if (target != null)
            {
                //< 대미지
                target.TakeDamage(_Caster, 1.0f, affectValue, 0, eAttackType.All, true, null);


                //황비홍 프로젝트에 맞게 수정 버프스킬은 일단 무시

                /*
                 * //< 버프 호출이있을시 버프호출
                 * if (_ability.callBuffIdx != 0 && target.BuffCtlr != null)
                 *  //황비홍 프로젝트에 맞게 수정
                 *  target.BuffCtlr.AttachBuff(_Caster, target, _Caster.SkillCtlr._SkillGroupInfo.GetBuff(_ability.callBuffIdx, _ability.unitIdx, _ability.skillIdx, _Caster.UnitType == UnitType.Unit ? (_Caster as Pc).syncData.SkillLvDatas : null), _ability);
                 */
            }
        };
    }
Beispiel #10
0
 void RotateSelectHeroEnd()
 {
     NetData.instance.GetUserInfo().ClearData();
     //캐릭터 선택 패널 띄우기
     UIMgr.Open("UIPanel/SelectHeroPanel", true);
     //선택페널에서 캐릭터 선택이 이뤄지면
 }
Beispiel #11
0
    public override int TakeDamage(Unit attacker, float damageRatio, float damage, float AddDamage, eAttackType atkType, bool isSkillDamage, AbilityData _ability, bool through = false, bool projecttile = false)
    {
        if (G_GameInfo.GameMode == GAME_MODE.SINGLE && !IsPartner)//플레이어만 체크
        {
            int count = SingleGameState.StageQuestList.Count;
            for (int i = 0; i < count; i++)
            {
                if (SingleGameState.StageQuestList[i].CheckCondition(ClearQuestType.MINIMUM_HIT, 1))
                {
                    if (!SingleGameState.StageQuestList[i].IsClear)//다 맞았음 (망했음)
                    {
                        UIBasePanel panel = UIMgr.GetHUDBasePanel();
                        if (panel != null)
                        {
                            (panel as InGameHUDPanel).SetQuestStringColor(i, false);
                        }
                    }
                    break;//횟수 증가함 더이상 조건문 돌지않는다.
                }
            }
        }

        int val = base.TakeDamage(attacker, damageRatio, damage, AddDamage, atkType, isSkillDamage, _ability, through, projecttile);

        return(val);
    }
Beispiel #12
0
 /**
  * type 0baby, 1用户
  */
 private void ChoosePic(ChoosePhotoAction mAction)
 {
     UIMgr.OpenPanel <ChoosePhotoPanel>(new ChoosePhotoPanelData()
     {
         action = mAction
     });
 }
        protected void NewDataRefresh(PlayerData data)
        {
            PlayerData CurrentPlayerdata = data != null ? data : new PlayerData()
            {
                ID = -1,
                injury_position = "手",
                protector_shape = 0,
                position        = 0,
                title           = "",
                description     = "",
                note            = ""
            };

            //currentillnessID = CurrentPlayerdata.ID;
            injury_positionDropdown.value = Tool.InjuryPosition.IndexOf(CurrentPlayerdata.injury_position);
            protector_shapeDropdown.value = (int)CurrentPlayerdata.protector_shape;
            directionDropdown.value       = (int)CurrentPlayerdata.position;
            TitleInputField.text          = CurrentPlayerdata.title;
            descriptioninputfiled.text    = CurrentPlayerdata.description;
            noteinputfiled.text           = CurrentPlayerdata.note;


            //点击确定发送请求到服务器
            CommitButton.onClick.RemoveAllListeners();
            if (null == mData.playerdata)
            {
                CommitButton.onClick.AddListener(AddIllNess);
                mData.playerdata = CurrentPlayerdata;
            }
            else
            {
                CommitButton.onClick.AddListener(() =>
                {
                    string url = Tool.refreshillnessdatasimplepath + CurrentPlayerdata.ID.ToString();

                    string json = JsonHelper.MergPlayerdataJson(CurrentPlayerdata);

                    QMsg msg = new WebMsg
                    {
                        EventID  = (int)Web_E.PUT,
                        url      = url,
                        message  = json,
                        callback = (success, str) =>
                        {
                            if (success)
                            {
                                UIMgr.OpenPanel <UICreateIllnessPopup>(canvasLevel: UILevel.PopUI, prefabName: "Resources/UIFirstPage");
                                CloseSelf();
                            }
                            else
                            {
                                Log.E(url + "  <----createIllnessPopUp-->> " + str + "   " + json);
                                //ShowPage<UINotice>(Tool.FaleToConnect);
                            }
                        }
                    };
                    SendMsg(msg);
                });
            }
        }
Beispiel #14
0
    private void Awake()
    {
        _instance = this;
        uiNames   = new List <string>();
        //把UI下面的子物体全部找到
        for (int i = 0; i < transform.childCount; i++)
        {
            uiNames.Add(transform.GetChild(i).name);
        }

        //Type type = Type.GetType("WeaponPanel");
        texts = new TextsOfUI();
        texts = JsonUtility.FromJson <TextsOfUI>(LanguageMgr.GetInstance.GetLanguageData());



        //for (int i = 0; i < myClass.GetType().GetFields().Length; i++)
        //{
        //    string fieldName = myClass.GetType().GetFields()[i].Name;
        //    myClass.GetType().GetField(fieldName).SetValue(myClass, texts.WeaponPanel.GetType().GetField(fieldName).GetValue(texts.WeaponPanel).ToString());
        //}
        ////myClass.GetType().GetField("WeaponIcon_text").SetValue(myClass, "wangwangwang");
        ////string str = (string)myClass.GetType().GetField("WeaponIcon_text").GetValue(myClass);
        ////Debug.Log(str);
        //for (int i = 0; i < myClass.GetType().GetFields().Length; i++)
        //{
        //    string fieldName = myClass.GetType().GetFields()[i].Name;
        //    string str = (string)myClass.GetType().GetField(fieldName).GetValue(myClass);
        //    Debug.Log(fieldName + "---------" + str);
        //}
    }
Beispiel #15
0
        void StartResquestForDoRegister()
        {
            BtnConfirm.enabled = false;
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("mobile", InputPhone.text);
            paramDict.Add("passwd", InputPwd.text);
            HttpUtil.PostWithSign <UserInfoModel>(UrlConst.DoRegister, paramDict)
            .Subscribe(response =>
            {
                BtnConfirm.enabled = true;
                PlayerPrefsUtil.SetPhone(InputPhone.text);
                PlayerPrefsUtil.SetPwd(InputPwd.text);
                PlayerPrefsUtil.UserInfo = response;
                UIMgr.OpenPanel <BaByInfoPanel>(new BaByInfoPanelData(), UITransitionType.CIRCLE, this);
            }
                       , e =>
            {
                BtnConfirm.enabled = true;
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
    public override void Close()
    {
        // call here?
        CameraManager.instance.mainCamera.gameObject.SetActive(true);

        if (!IsCreateGuild)
        {
            for (int i = Popup.Length - 1; 0 <= i; i--)
            {
                if (!Popup[i].activeSelf)
                {
                    continue;
                }

                Popup[i].SetActive(false);
                if (i == 1)
                {
                    uiMgr.SetTopMenuTitleName(215);
                }

                return;
            }

            UIMgr.OpenTown();
        }

        base.Close();
    }
Beispiel #17
0
        /// <summary>
        /// 处理点击会员中心按钮
        /// </summary>
        void HandleProductGene(int status)
        {
            GameData gd = GameData.Instance;

            //游客登录,不要使用认证方式,进入游戏之后,会改为3
            if (gd.PlayerNodeDef.byUserSource == 1)
            {
                UIMgr.GetInstance().GetUIMessageView().Show("请使用微信登录后,点击进入会员中心");
                return;
            }

            if (status == 1)
            {
                NewPlayerGuide.Instance.HideIndexGuide(NewPlayerGuide.Guide.Promote);
            }
            StringBuilder str = new StringBuilder();

            str.Append(LobbyContants.URL_MEMBERCENTER);
            str.Append("uid=");
            str.Append(gd.PlayerNodeDef.iUserId);
            str.Append("&t=");
            str.Append(status);
            str.Append("&token=");
            Debug.LogWarning("gd.PlayerNodeDef.szAccessToken:" + gd.PlayerNodeDef.szAccessToken);
            str.Append(gd.PlayerNodeDef.userDef.szAccessToken);
            Application.OpenURL(str.ToString());
        }
Beispiel #18
0
        public override void start()
        {
            //Debug.Log("Run Action : " + actID + " " + this.name);

            GameObject objLayer = UIMgr.CreateLayer(layer);

            if (objLayer == null)
            {
                return;
            }
            objLayer.SetActive(true);

            if (string.IsNullOrEmpty(assetID))
            {
                return;
            }

            Object2D   info   = UIMgr.GetItemInfo(itemID);
            GameObject objPic = null;

            if (info != null)
            {
                objPic = info.gameObject;
            }
            else
            {
                objPic      = UIMgr.CreatePic(objLayer);
                objPic.name = itemID;
            }

            info.AddAction(this);

            this.isEnd = true;
        }
Beispiel #19
0
    /*
     * public Quest.QuestInfo GetCureentQuest()
     * {
     *  var enumerator = QuestList.GetEnumerator();
     *  while (enumerator.MoveNext())
     *  {
     *
     *
     *      return _LowDataMgr.instance.GetLowDataQuestData(enumerator.Current.Value.unTaskId);
     *  }
     * }
     */

    //퀘스트 완료후 처리해야할것들 -
    public void QuestCompleteAfterProcess(uint questID, bool success = false)
    {
        Quest.QuestInfo questInfo = _LowDataMgr.instance.GetLowDataQuestData(questID);
        if (questInfo != null)
        {
            if (questInfo.QuestType == (byte)QuestSubType.NPCTALK)
            {
                //아무일없다
            }
            else if (questInfo.QuestType == (byte)QuestSubType.SINGLEGAMEPLAY)
            {
                //게임 시작 처리를 이어서 한다
                (G_GameInfo._GameInfo as SingleGameInfo).OverrideGameStart(questID);
            }
            else if (questInfo.QuestType == (byte)QuestSubType.SINGLEGAMECLEAR)
            {
                if (TownState.TownActive) //소탕으로 클리어 후
                {                         //토크씬이 나왔었다면 챕터페널이 닫혀있을것이다. 다시 열어준다.
                    UIBasePanel chapterPanel = UIMgr.GetUIBasePanel("UIPanel/ChapterPanel");
                    if (chapterPanel != null)
                    {
                        UIMgr.OpenChapter(null);
                    }
                }
                else
                {
                    if (0 < (G_GameInfo.GameInfo as SingleGameInfo).QuestTalkId)
                    {
                        UIMgr.Open("UIPanel/ResultRewardStarPanel", true);//무조건 승리겠지?? 아니면 어떻게하지
                    }
                }
            }
        }
        //퀘스트가 없으면 그냥 리턴
    }
Beispiel #20
0
        protected override void RegisterUIEvent()
        {
            mSaveBtn.AddCallback(new UnityEngine.Events.UnityAction(() =>
            {
                mSetSqlite.UpdateTable(mInputSettings, "Type");
                if (GlobalManager.Instance.Character != null)
                {
                    if (GlobalManager.Instance.Character.GetComponent <CharacterFSM>() != null)
                    {
                        GlobalManager.Instance.Character.GetComponent <CharacterFSM>().ReloadInputKey();
                    }
                }
            }));

            mCancelBtn.AddCallback(new UnityEngine.Events.UnityAction(() =>
            {
                mInputSettings = mSetSqlite.SelectTable <InputSetting>();
                _InitItems();
            }));

            mReturnBtn.AddCallback(new UnityEngine.Events.UnityAction(() =>
            {
                UIMgr.ClosePanel <InputSetList>();
            }));
        }
 // Start is called before the first frame update
 void Start()
 {
     if (uiMgr == null)
     {
         uiMgr = FindObjectOfType <UIMgr>();
     }
 }
Beispiel #22
0
 public void OnMMEvent(CorgiEngineEvent eventType)
 {
     if (eventType.EventType == CorgiEngineEventTypes.PlayerDeath)
     {
         mData.DeathCount++;
         // 更新UI
         TxtDeathCount.text = string.Format("Death Count : {0}", mData.DeathCount);
         // 播放死亡的声音
         this.SendMsg(new AudioSoundMsg(QAssetBundle.Sounds.HIT));
     }
     else if (eventType.EventType == CorgiEngineEventTypes.Pause)
     {
         var pausePanel = UIMgr.GetPanel <UIGamePausePanel>();
         if (pausePanel)
         {
             UIMgr.ClosePanel <UIGamePausePanel>();
         }
         else
         {
             UIMgr.OpenPanel <UIGamePausePanel>(UILevel.PopUI);
         }
     }
     else if (eventType.EventType == CorgiEngineEventTypes.UnPause)
     {
         UIMgr.ClosePanel <UIGamePausePanel>();
     }
 }
Beispiel #23
0
    /// <summary> 원래라면 아이디 비밀번호로 로그인 프로토콜 태우고 로그인 아이디 형식이 맞는지 선체크 </summary>
    void CheckLogin()
    {
        string id = IdInput.value;

        if (id.Contains(" ") || string.IsNullOrEmpty(id) || DefaultID.CompareTo(id) == 0)
        {
            //UIMgr.instance.AddPopup(9, id, null, null, null);
            uiMgr.AddPopup(141, 110, 117);
            return;
        }

        if (SelectServerInfo.Id == 0)
        {//서버 목록을 받아오지 못하였다.
            Debug.LogError("server list error");
            uiMgr.AddPopup(141, 293, 117, 75, 0, () => {
                UIMgr.ClearUI();
                TempCoroutine.instance.NextFrame(() => {
                    UIMgr.Open("UIPanel/LoginPanel", false);
                });
            }, () => {//종료
                Application.Quit();
            }, null);
            return;
        }

        ConnectLoginServer(id);
    }
    private static int iToolsNum;   // 工具个数

    void Awake()
    {
        Debug.Log("ListTools Awake");

        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;
        toolMgr = Singleton.GetInstance("ToolMgr") as ToolMgr;
    }
    private float m_iDistToHide;   //面板隐藏移动的距离

    void Awake()
    {
        //Managers
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;

        PanelInit();
    }
Beispiel #26
0
 public void PreInitialize(BattleMgr bMgr, UIMgr uMgr, Entity nActor, AttackTracker aTracker)
 {
     uiMgr         = uMgr;
     battleMgr     = bMgr;
     nowActor      = nActor;
     attackTracker = aTracker;
 }
Beispiel #27
0
        protected override void RegisterUIEvent()
        {
            BasicInfo.onClick.AddListener((() =>
            {
                BasicInfoPanel.Show();
                HisGradePanel.Hide();
                AddPalPanel.Hide();
            }));

            HisGrade.onClick.AddListener((() =>
            {
                HisGradePanel.Show();
                AddPalPanel.Hide();
                BasicInfoPanel.Hide();
            }));

            AddPal.onClick.AddListener((() =>
            {
                AddPalPanel.Show();
                BasicInfoPanel.Hide();
                HisGradePanel.Hide();
            }));

            Btn_QuitPanel.onClick.AddListener((() =>
            {
                UIMgr.OpenPanel <UIPlayerMainMenu>();
                CloseSelf();
            }));
        }
Beispiel #28
0
        protected override void RegisterUIEvent()
        {
            BtnPause.OnClickAsObservable().Subscribe(_ =>
            {
                Debug.Log("BtnPause clicked!");

                Transform.Find("Characters").gameObject.SetActive(false);
                Transform.Find("Emenys").gameObject.SetActive(false);
                UIMgr.OpenPanel <UIGamePausePanel>();
            });

            BtnProps.OnClickAsObservable().Subscribe(_ =>
            {
                Debug.Log("BtnProps clicked!");
            });

            BtnAuto.OnClickAsObservable().Subscribe(_ =>
            {
                Debug.Log("BtnAuto clicked!");
            });

            Btn2Speed.OnClickAsObservable().Subscribe(_ =>
            {
                Debug.Log("Btn2Speed clicked!");
            });
        }
Beispiel #29
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
        IEnumerator TestAuth(string auth)
        {
            var             url        = string.Format("https://gate.mongomath.com:8443/admin-course/courses");
            UnityWebRequest webRequest = UnityWebRequest.Get(url);

            webRequest.SetRequestHeader("Authorization", auth);
            webRequest.SetRequestHeader("Content-Type", "application/json");
            yield return(webRequest.SendWebRequest());

            if (webRequest.isNetworkError)
            {
                Debug.Log(": Error: " + webRequest.error);
            }
            else
            {
                Debug.Log("kecheng" + webRequest.downloadHandler.text);
                var res = webRequest.downloadHandler.text;
                if (res.IndexOf("·Ç·¨·ÃÎÊ") > -1)
                {
                }
                else
                {
                    UIMgr.OpenPanel("UIActivityPanel", UILevel.Common);
                    UIMgr.ClosePanel("UILoginPanel");
                }
            }
        }
 /// <summary>
 /// 更新状态条上的数据
 /// </summary>
 public void UpdateTopStautsValue()
 {
     // 更新本页数据
     UITopStatus.ShowValueChaged();
     // 更新首页数据
     UIMgr.GetPanel <UIHomePanel>().UpdateTopStautsValue();
 }
Beispiel #32
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        Time.timeScale = 0.0f;
        loader         = GameObject.Find("Loader");
        if (loader != null)
        {
            lMgrScript = loader.GetComponent <LoaderMgr>();

            if (lMgrScript.restartPressed)
            {
                enableHudUI();
                lMgrScript.restartPressed = false;
            }
            else
            {
                enableStartUI();
            }
        }
        foreach (GameObject obj in panels)
        {
            EndPanelLogic epl = obj.GetComponent <EndPanelLogic> ();
            if (epl != null)
            {
                myEpl = epl;
            }
        }
    }
Beispiel #33
0
        void OnSceneLoaded(Scene scene, LoadSceneMode mode)
        {
            if (scene.name == "GameWin")
            {
                CloseSelf();
                UIMgr.OpenPanel <UIGameOverPanel>(new UIGameOverPanelData());
            }
            else if (scene.name.StartsWith("Level"))
            {
                TxtLevelName.text = scene.name;

                if (scene.name == "Level1")
                {
                    if (GameData.FirstTimeEnterLevel1)
                    {
                        ShowTxtKeyboardHelp();
                        GameData.FirstTimeEnterLevel1 = false;
                    }
                }
            }
            else
            {
                TxtLevelName.text = string.Empty;
            }
        }
    private int m_iIndex;          //当前图片序号

    void Awake()
    {
        //Get Managers
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;
        itemsInfoMgr = Singleton.GetInstance("ItemsInfoMgr") as ItemsInfoMgr;

        GetButtons();
        img_photo = transform.FindChild("Img_Photo").GetComponent<Image>();

    }
 //生成
 //bname:ボタンのテキストに入れる文字列
 //name:MyButtonの参照すべきラベルの名前or参照するファイルのパス
 public GameObject Create(string bname, string name, Vector3 pos, UIMgr.ButtonState bstate, string common)
 {
     GameObject g = (GameObject)Instantiate(mButtonPrefab, pos, Quaternion.identity);
     //g.transform.parent = this.transform;
     g.transform.SetParent(this.transform, false);
     g.gameObject.GetComponentInChildren<Text>().text = bname;
     g.GetComponent<MyButton>().SetStringName(name);
     g.GetComponent<MyButton>().SetButtonState(bstate);
     g.GetComponent<MyButton>().mToCommonLabelName = common;
     return g;
 }
    void Awake()
    {
        if (Instance != this)
        {
            Destroy(gameObject);
            Debug.Log("DestroyedObjectPersist");
        }
        else
        {
            DontDestroyOnLoad(gameObject);
        }

        audioMgr = GetComponent<AudioMgr>();
        itemsInfoMgr = GetComponent<ItemsInfoMgr>();
        networkMgr = GetComponent<NetworkMgr>();
        toolMgr = GetComponent<ToolMgr>();
        uiMgr = GetComponent<UIMgr>();
    }
    int[] m_iInputNum = new int[m_iMethodsNum];  //各Method的需求答案个数

    void Awake()
    {
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;
        toolMgr = Singleton.GetInstance("ToolMgr") as ToolMgr;

        Methods[0] = transform.FindChild("Method00");

        m_iInputNum[0] = 1;

        for (int i = 0; i < m_iMethodsNum; i++)
        {
            Btns_Confirm[i] = Methods[i].GetComponentInChildren<Button>();

            int a = i;
            Btns_Confirm[i].onClick.AddListener(delegate ()
            {
                Confirm(a);
            });
        }
    }
    //===========

    void Awake()
    {
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;

        // On Awake, we want to ensure the master server is empty, and a placeholder username is chosen
        MasterServer.ClearHostList();
        pre_character = Resources.Load("Prefabs/Character") as GameObject;

        //如果有服务器则加入 不然创建
        MasterServer.RequestHostList(advancedSettings.gameName);
        if (hostList != null)
        {
            //加入第一个服务器
            JoinServer(0);
        }
        else
        {
            StartServer();
        }
    }
Beispiel #39
0
 void Awake()
 {
     UIROOT = this.transform.FindChild("UIRoot");
     mInstance = this;
     DontDestroyOnLoad(this.gameObject);
 }
 void Awake()
 {
     uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;
     itemsInfoMgr = Singleton.GetInstance("ItemsInfoMgr") as ItemsInfoMgr;
 }
Beispiel #41
0
    /// <summary>
    /// 各种初始化
    /// </summary>
    void Awake()
    {
        m_instance = this;

        m_panelsList_DynamicLoading = new List<StruUncommonPrefab>();
        //时间间隔,用来判断动态加载的面板是否可以销毁
        m_nTimeInterval = 0;
        //倒计时总数,600秒
        m_nSeconds = 600;
        m_nShownPanelCount = 0;
        m_priorPanelID = EUIPanelID.Null;
        m_priorPanelParam = null;
        m_morePriorPanelID = EUIPanelID.Null;
        m_morePriorPanelParam = null;
        m_shownPanelIDArr = new EUIPanelID[10];
        m_bUseMainPanelArr = new bool[(int)EUIPanelID.AllPanelsEnd];

        m_eventMgrScript = new EventMgr();

        InitCommonPanels();

        for (int i = 0; i < m_bUseMainPanelArr.Length; ++i)
        {
            m_bUseMainPanelArr[i] = true;
        }
        m_hintObj = Resources.Load("Prefabs/Tooltip") as GameObject;
    }
 public void SetButtonState(UIMgr.ButtonState bs)
 {
     mButtonState = bs;
 }
    public List<Inventory_Item> list_InventoryItem = new List<Inventory_Item>();    //存储背包物品

    void Awake()
    {
        Debug.Log("Inventory Awake");
        uiMgr = Singleton.GetInstance("UIMgr") as UIMgr;
    }