Ejemplo n.º 1
0
    private void Awake()
    {
        Ins                     = this;
        Log                     = new Log();
        ActiveState             = new List <PersistState>();
        GameOverlay             = new GameOverlayDialogState();
        FightState              = new FightState();
        ReplayState             = new ReplayState();
        NickNameDialogState     = new NickNameDialogState();
        BattleStatusDialogState = new BattleStatusDialogState();
        PlayerDialogState       = new PlayerDialogState();
        ChatDialogState         = new ChatDialogState();
        PsdEditDialogState      = new PsdEditDialogState();
        RoomChatDialogState     = new RoomChatDialogState();
        LoadingEx               = new LoadingEXDialogState();
        ItemInfoDialogState     = new ItemInfoDialogState();
        GunShootDialogStatus    = new GunShootDialogStatus();
        //面板管理器.
        DialogStateManager = new MainDialogStateManager();
        //顺序排队弹出框.
        PopupStateManager = new MainPopupStateManager();
        //各类游戏数据.
        GameStateMgr    = new GameStateMgr();
        UpdateHelper    = new UpdateHelper();
        AppInfo         = new AppInfo();
        CombatData      = new CombatData();
        GameNotice      = new GameNotice();
        MeteorManager   = new MeteorManager();
        ScriptMng       = new ScriptMng();
        SFXLoader       = new SFXLoader();
        ActionInterrupt = new ActionInterrupt();

        BuffMng         = new BuffMng();
        EventBus        = new EventBus();
        NetWorkBattle   = new NetWorkBattle();
        SceneMng        = new SceneMng();
        FrameSync       = new FrameSync();
        MeteorBehaviour = new MeteorBehaviour();
        DropMng         = new DropMng();
        //原版相关资源的加载器.
        MenuResLoader    = new MenuResLoader();
        SkcLoader        = new SkcLoader();
        BncLoader        = new BncLoader();
        FMCLoader        = new FMCLoader();
        GMBLoader        = new GMBLoader();
        GMCLoader        = new GMCLoader();
        DesLoader        = new DesLoader();
        FMCPoseLoader    = new FMCPoseLoader();
        DataMgr          = new DataMgr();
        SfxMeshGenerator = new SfxMeshGenerator();
        RoomMng          = new RoomMng();
        SoundManager     = new SoundManager();
        ResMng           = new ResMng();
        DlcMng           = new DlcMng();

        DontDestroyOnLoad(gameObject);
        Log.WriteError(string.Format("GameStart AppVersion:{0}", Main.Ins.AppInfo.AppVersion()));
    }
Ejemplo n.º 2
0
 public void Init()
 {
     ActiveState             = new List <PersistState>();
     ReconnectDialogState    = new ReconnectDialogState();
     GameOverlay             = new GameOverlayDialogState();
     FightState              = new FightState();
     ReplayState             = new ReplayState();
     NickNameDialogState     = new NickNameDialogState();
     BattleStatusDialogState = new BattleStatusDialogState();
     ConnectServerState      = new ConnectServerDialogState();
     PlayerDialogState       = new PlayerDialogState();
     ChatDialogState         = new ChatDialogState();
     PsdEditDialogState      = new PsdEditDialogState();
     RoomChatDialogState     = new RoomChatDialogState();
     LoadingEx              = new LoadingEXDialogState();
     ItemInfoDialogState    = new ItemInfoDialogState();
     GunShootDialogState    = new GunShootDialogState();
     TipDialogState         = new TipDialogState();
     WaitDialogState        = new WaitDialogState();
     RecordSelectState      = new RecordSelectState();
     ScriptInputDialogState = new ScriptInputDialogState();
 }
Ejemplo n.º 3
0
 void Init()
 {
     inputChat = Control("ChatText", WndObject).GetComponent <InputField>();
     Control("SendShortMsg", WndObject).GetComponent <Button>().onClick.AddListener(() =>
     {
         if (U3D.IsMultiplyPlayer())
         {
             string chatMessage = inputChat.text;
             if (string.IsNullOrEmpty(inputChat.text))
             {
                 U3D.PopupTip("无法发送内容为空的语句");
                 return;
             }
             TcpClientProxy.Ins.SendChatMessage(chatMessage);
             OnBackPress();
         }
     });
     Control("CloseQuickMsg", WndObject).GetComponent <Button>().onClick.AddListener(() =>
     {
         OnBackPress();
     });
     Control("CloseShortMsg", WndObject).GetComponent <Button>().onClick.AddListener(() =>
     {
         OnBackPress();
     });
     Control("CloseHistoryMsg", WndObject).GetComponent <Button>().onClick.AddListener(() => {
         OnBackPress();
     });
     Control("CloseAudioMsg", WndObject).GetComponent <Button>().onClick.AddListener(() =>
     {
         OnBackPress();
     });
     if (jsData == null)
     {
         TextAsset text = Resources.Load("MsgTable") as TextAsset;
         jsData = LitJson.JsonMapper.ToObject(text.text);
     }
     for (int i = 0; i < jsData["Msg"].Count; i++)
     {
         string strQuick = jsData["Msg"][i].ToString();
         Control(i.ToString(), WndObject).GetComponentInChildren <Text>().text = strQuick;
         int j = i;
         Control(i.ToString(), WndObject).GetComponent <Button>().onClick.AddListener(() => { SendQuickMsg(j); });
     }
     //Control("Record", WndObject).GetComponent<Button>().onClick.AddListener(() => { Record(); });
     //Control("SendAudio", WndObject).GetComponent<Button>().onClick.AddListener(() => { SendAudioMsg(); });
     //GameObject objListen = Control("Listen", WndObject);
     //source = objListen.GetComponent<AudioSource>();
     //Listen = objListen.GetComponent<Button>();
     //Listen.onClick.AddListener(() =>
     //{
     //    if (MicChat.clip != null) {
     //        SoundManager.Ins.Mute(true);
     //        source.PlayOneShot(MicChat.clip);
     //        Debug.Log("play clip");
     //        if (checkSound != null) {
     //            checkSound.Stop();
     //        }
     //            checkSound = Timer.loop(0.5f, CheckSound);
     //    }
     //});
     if (RoomChatDialogState.Exist())
     {
         string msg = RoomChatDialogState.Instance.GetHistoryMsg();
         Add(msg);
     }
     //CountDown = Control("CountDown", WndObject);
 }