Exemplo n.º 1
0
    public void InitView(GameObject gameObject)
    {
        //templet
        m_mediator = new PVP02PanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        InitUIBinder(gameObject);
        m_modelClick.pvp02Panel = this;

        m_piece.SetActive(false);
        m_ready.onClick.AddListener(OnReadyClick);
        m_P.onClick.AddListener(OnPClick);
        m_N.onClick.AddListener(OnNClick);
        m_R.onClick.AddListener(OnRClick);
        m_B.onClick.AddListener(OnBClick);
        m_Q.onClick.AddListener(OnQClick);
        m_SelectCloce.onClick.AddListener(OnSelectCloseClick);
        m_Item1.onClick.AddListener(OnItem1Click);
        m_Item2.onClick.AddListener(OnItem2Click);
        m_Item3.onClick.AddListener(OnItem3Click);
        m_Item4.onClick.AddListener(OnItem4Click);
        m_SelfSay.onClick.AddListener(OnSayClick);
        m_EndTurn.onClick.AddListener(OnEndTurnClick);
        m_BottomToggle.onValueChanged.AddListener(OnBottomToggleClick);

        App.Facade.RegisterCommand(NotificationConstant.NewEndTurn, () => new NewEndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerReady, () => new PlayerReadyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerActive, () => new PlayerActiveCommand());
        App.Facade.RegisterCommand(NotificationConstant.EndTurn, () => new EndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutually, () => new PlayerMutuallyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutuallyFeedback, () => new PlayerMutuallyFeedbackCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerChat, () => new PlayerChatCommand());

        App.NetworkManager.RegisterPushCall(Config.PushMessage.NewServerBattleMesPush, ShowOtherActive);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.OnePlayerReady, OnOnePlayerReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerNotReady, OnPlayerNotReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerReadyFinish, OnReadyFinish);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayNext, OnNextPlay);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerEnd, OnGameOver);

        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerCanNextPush, OnCanNextPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerCanPaintingPush, OnOtherEndTurnPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerPaintingOverPush, OnRoundStartPush);

        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerChatPush, OnPlayerChatPush);
    }
Exemplo n.º 2
0
    public void InitView(GameObject gameObject, Piece pieceData, int roundNum, bool pve = false)
    {
        isPVE        = pve;
        m_gameObject = gameObject;
        m_roundNum   = roundNum;
        //m_gameObject.transform.localRotation = Quaternion.Euler(0, 180, 0);
        m_Attack    = gameObject.transform.Find("m_Attack").gameObject;
        m_UserProxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy  = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        selfColor   = m_pvpProxy.GetSelfColor();
        m_type      = pieceData.type;
        pieceColor  = pieceData.color;
        InitPieceShow(pieceData);
        m_name     = m_X + "_" + m_Z + "_" + m_roundNum;
        m_mediator = new PieceItem02Mediator(this, m_name);
        App.Facade.RegisterMediator(m_mediator);
        m_mediator.InitPieceData(pieceData);

        OpenView();
    }
Exemplo n.º 3
0
    public void InitView(GameObject gameObject)
    {
        Debug.Log("Lobby Panel Inited");
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new LobbyPanelMediator(this);
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        if (m_pvpProxy == null)
        {
            m_pvpProxy = new PVPProxy();
            App.Facade.RegisterProxy(m_pvpProxy);
        }
        m_pvp02Proxy = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        if (m_pvp02Proxy == null)
        {
            m_pvp02Proxy = new PVP02Proxy();
            App.Facade.RegisterProxy(m_pvp02Proxy);
        }

        m_pveProxy = App.Facade.RetrieveProxy("PVEProxy") as PVEProxy;
        if (m_pveProxy == null)
        {
            m_pveProxy = new PVEProxy();
            App.Facade.RegisterProxy(m_pveProxy);
        }

        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;

        m_PVP.onClick.AddListener(OnPVPClick);
        m_PVE.onClick.AddListener(OnPVEClick);
        m_PVP02.onClick.AddListener(OnPVP02Click);
        m_PVP02Local.onClick.AddListener(OnPVP02LocalClick);
        m_Easy.onClick.AddListener(OnEasyClick);
        m_Hard.onClick.AddListener(OnHardClick);
        m_Normal.onClick.AddListener(OnNormalClick);
        m_cancel.onClick.AddListener(OnCancelClick);
        App.Facade.RegisterCommand(NotificationConstant.Match, () => new MatchCommand());
        App.Facade.RegisterCommand(NotificationConstant.CancelMatch, () => new CancelMatchCommand());
        App.NetworkManager.RegisterPushCall(Config.PushMessage.MatchSuccess, OnMatchSuccess);
    }