Exemple #1
0
    // Use this for initialization
    void Start()
    {
        shareButtonAtHall  = transform.Find("/Game_UI/One_UI/ShareOne_Btn").GetComponent <Button>();
        GameInfo.isYuanQue = 0;
        _ArrayAudioSources = GameObject.Find("Audio Source").GetComponent <AudioSource>();///
        allBtnVoiceObj();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        if (GameInfo.cs.serverType == ServerType.GameServer)
        {
            GameInfo.cs.Closed();
            GameInfo.cs.serverType = ServerType.ListServer;
        }
        Invoke("Timer", 5.0f);
        userTip.text  = null;
        nickName.text = GameInfo.NickName;
        ID.text       = "ID:" + GameInfo.userID;
        SendGetRoomCard();
        RoomCardNum.text = GameInfo.userRoomCard + "";
        LoadImage.Instance.LoadPicture(headimg, headImage);
        StartCoroutine(Show_NoticeInfo());
        GameInfo.isAllreadyStart = false;
        Recon_Pel = transform.Find("/Game_UI/Two_UI/Recon_Pel").gameObject;
        //==========================脚本单例==========================//
        music        = gameObject.GetComponent <Manager_Hall>();
        managerAudio = GameObject.Find("Main Camera").GetComponent <Manager_HallAudio>();
        shareButtonAtHall.onClick.AddListener(OnShareButtonAtHallClick);

        FICWaringPanel._instance.Hide();
    }
Exemple #2
0
 void Start()
 {
     PengYQ_Btn = GetComponent <Button>();
     PengYQ_Btn.onClick.AddListener(delegate { SendGroupInfo(); });
     Two_UI = transform.parent.parent.Find("Two_UI");
     //我的朋友圈
     PengYQMain_Pel = Two_UI.Find("PengYQMain_Pel").gameObject;
     //朋友圈大厅
     PengYQLobby_Pel = Two_UI.Find("PengYQLobby_Pel").gameObject;
     //用户管理
     PengYQUserManager_Pel = Two_UI.Find("PengYQUserManager_Pel").gameObject;
     //用户申请记录
     PengYQApply_Pel = Two_UI.Find("PengYQApply_Pel").gameObject;
     //圈子申请记录
     PengYQApplyRecord_Pel = Two_UI.Find("PengYQApplyRecord_Pel").gameObject;
     //加入
     PengYQJoin_Pel = Two_UI.Find("PengYQJoin_Pel").gameObject;
     //创建房间记录
     PengYQCreateRommRecord_Pel = Two_UI.Find("PengYQCreateRommRecord_Pel").gameObject;
     //朋友圈信息
     PengYQInfo_Pel = Two_UI.Find("PengYQInfo_Pel").gameObject;
     //朋友圈战绩
     PengYQUserExploits_Pel = Two_UI.Find("PengYQUserExploits_Pel").gameObject;
     //加入房间的代码
     enterRoom = transform.Find("/Game_UI/Two_UI/Join_Pel").GetComponent <FICEnterRoom>();
     hall      = transform.Find("/Main Camera").GetComponent <Manager_Hall>();
     AddButtonEvent();
 }
    private GameObject _Pathset;                    ///申明设置窗体加载路径

    void Start()
    {
        //=================保存游戏中音量=======================//
        _ConMusic.value = PlayerPrefs.GetFloat("musicVoice", 1);
        _ConSound.value = PlayerPrefs.GetFloat("soundVoice", 1);

        _audioMusic.Play();                                                   //游戏开始播放背景音乐
        music = GameObject.Find("Main Camera").GetComponent <Manager_Hall>(); //获取播放音源的对象
    }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        //房卡图片
        longOrFang = transform.Find("/Game_UI/One_UI/gold").GetComponent <Image>();
        //根据当前的登录类型(龙宝or房卡(?微信)),改变计费单位的图片
        ChangeLongOrFang();
        //设置场景标签为主界面
        GameInfo.sceneWhich = SceneID.Hall;
        //分享按钮
        shareButtonAtHall = transform.Find("/Game_UI/One_UI/ShareOne_Btn").GetComponent <Button>();
        shareButtonAtHall.onClick.AddListener(OnShareButtonAtHallClick);
        //
        GameInfo.isYuanQue = 0;
        //获取音乐播放器
        _ArrayAudioSources = GameObject.Find("Audio Source").GetComponent <AudioSource>();
        //给所有按键绑定音乐播放方法
        allBtnVoiceObj();
        //禁止休眠
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        //如果服务器类型是游戏,则变为列表服务器
        if (GameInfo.cs.serverType == ServerType.GameServer)
        {
            GameInfo.cs.Closed();
            GameInfo.cs.serverType = ServerType.ListServer;
        }
        //5秒后开始发送心跳包
        Invoke("Timer", 5.0f);

        userTip.text  = null;
        nickName.text = GameInfo.NickName;
        ID.text       = "ID:" + GameInfo.userID;
        SendGetRoomCard();

        RoomCardNum.text = GameInfo.userRoomCard + "";
        //加载网络头像,heading是Url,headImage是报错时的预备图片
//2018.3.21为了测试而注释------------------------------------------------------
        LoadImage.Instance.LoadPicture(headimg, headImage);
        //
        StartCoroutine(Show_NoticeInfo());
        //是否已经开始游戏
        GameInfo.isAllreadyStart = false;
        //重连提示
        Recon_Pel = transform.Find("/Game_UI/Two_UI/Recon_Pel").gameObject;
        //==========================脚本单例==========================//

        music        = gameObject.GetComponent <Manager_Hall>();
        managerAudio = GameObject.Find("Main Camera").GetComponent <Manager_HallAudio>();
        //关闭登录的按钮
//2018.3.21为了测试而注释------------------------------------------------------
        FICWaringPanel._instance.Hide();
    }
//===========================================================================

    void Start()
    {
        hall     = GetComponent <Manager_Hall>();
        News_Btn = transform.Find("/Game_UI/One_UI/News_Btn").GetComponent <Button>();
        News_Btn.onClick.AddListener(delegate { OnSendGetUserRecord(); });
//==========================================================================================================================
        News_Pel         = transform.Find("/Game_UI/Two_UI/News_Pel").gameObject;
        News_Pel_Content = News_Pel.transform.Find("Scroll View/Viewport/Content");
        Info_FrameTemp   = News_Pel_Content.GetChild(0).gameObject;
        News_Pel_bgLogo  = News_Pel.transform.Find("bgLogo").gameObject;
//==========================================================================================================================
        Newss_Pel             = transform.Find("/Game_UI/Two_UI/Newss_Pel").gameObject;
        Newss_Pel_Content     = Newss_Pel.transform.Find("Scroll View/Viewport/Content");
        Info_FrameDetailsTemp = Newss_Pel_Content.GetChild(0).gameObject;
        timeTxt          = Newss_Pel.transform.Find("info/time").GetComponent <Text>();
        rule             = Newss_Pel.transform.Find("info/rule").GetComponent <Text>();
        Newss_Pel_bgLogo = Newss_Pel.transform.Find("bgLogo").gameObject;
//==========================================================================================================================
    }