示例#1
0
    public void InitView(GameObject gameObject)
    {
        //templet
        m_mediator = new PVPPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        InitUIBinder(gameObject);

        m_piece.SetActive(false);
        m_ready.onClick.AddListener(OnReadyClick);
        m_test.onClick.AddListener(OnRoundStart);
        m_Undo.onClick.AddListener(OnUndoClick);
        App.Facade.RegisterCommand(NotificationConstant.PlayerReady, () => new PlayerReadyCommand());
        App.Facade.RegisterCommand(NotificationConstant.DoMove, () => new DoMoveCommand());
        App.Facade.RegisterCommand(NotificationConstant.EndTurn, () => new EndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutually, () => new PlayerMutuallyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutuallyFeedback, () => new PlayerMutuallyFeedbackCommand());

        App.NetworkManager.RegisterPushCall(Config.PushMessage.OtherMove, ShowOtherMove);
        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.PlayerUndoPush, OnPlayerUndoPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerUndoInfoPush, OnPlayerUndoInfoPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerNotAgreePush, OnPlayerNotAgreePush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayUndoNextPush, OnPlayUndoNextPush);
    }
示例#2
0
    public void InitView(GameObject gameObject)
    {
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new RankListPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        m_Close.onClick.AddListener(OnCloseButtonClick);

        App.Facade.RegisterCommand(NotificationConstant.ShowRankList, () => new ShowRankListCommand());
    }
示例#3
0
    public void InitView(GameObject gameObject)
    {
        InitUIBinder(gameObject);
        m_BottomButton.onClick.AddListener(OnConfirmClick);
        m_N.onClick.AddListener(OnNClick);
        m_R.onClick.AddListener(OnRClick);
        m_B.onClick.AddListener(OnBClick);
        m_Q.onClick.AddListener(OnQClick);

        m_object   = gameObject;
        m_mediator = new TypeSelectPanelMediator(this);
        m_pvpProxy = new PVPProxy();
        m_pveProxy = new PVEProxy();
        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
    }
示例#4
0
    public void InitView(GameObject gameObject, Piece pieceData, bool pve = false)
    {
        isPVE        = pve;
        m_gameObject = gameObject;
        //m_gameObject.transform.localRotation = Quaternion.Euler(0, 180, 0);
        m_Attack   = gameObject.transform.Find("m_Attack").gameObject;
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        selfColor  = m_pvpProxy.GetSelfColor();
        m_type     = pieceData.type;
        pieceColor = pieceData.color;
        InitPieceShow(pieceData);
        m_name     = m_X + "_" + m_Z;
        m_mediator = new PieceItemMediator(this, m_name);
        App.Facade.RegisterMediator(m_mediator);
        m_mediator.InitPieceData(pieceData);

        OpenView();
    }
示例#5
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);
    }
示例#6
0
 public override void OnRegister()
 {
     base.OnRegister();
     pvpProxy = Facade.RetrieveProxy("PVPProxy") as PVPProxy;
 }
示例#7
0
 public override void Execute(INotification notification)
 {
     Request();
     m_pvpProxy  = Facade.RetrieveProxy("PVPProxy") as PVPProxy;
     m_userProxy = Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
 }