Exemplo n.º 1
0
 private static void HandleTableValueChanged(object sender, ValueChangedEventArgs args)
 {
     if (args.DatabaseError != null)
     {
         Debug.LogError(args.DatabaseError.Message);
         return;
     }
     RPCDicObserver.Notify(args.Snapshot);
 }
Exemplo n.º 2
0
 public override void OnEndPhase()
 {
     RPCDicObserver.RemoveObserver(AnswerIndicatorController.Instance);
     if (questionSelect.activeInHierarchy)
     {
         questionSelect.SetActive(false);
     }
     CancelInvoke("StartTimer");
 }
Exemplo n.º 3
0
    public void SearchRoom(Action <bool> onResult)
    {
        searchingRoom = true;
        RPCDicObserver.AddObserver(this);
        RPCQueryObserver.AddObserver(this);
        //Order first to search fast
        FDFacade.Instance.QueryTable("SearchRoom", roomReference.OrderByChild(MyConst.GAMEROOM_STATUS).EqualTo("0"));

        onSuccessMatchMake = onResult;
    }
Exemplo n.º 4
0
    public override void OnStartPhase()
    {
        FindObjectOfType <PhaseSkillController> ().ShowAutoActivateButtons(true);
        Debug.Log("Starting Answer Phase");
        RPCDicObserver.AddObserver(AnswerIndicatorController.Instance);
        hasAnswered = false;

        timeLeft  = 5;
        stoptimer = true;
        InvokeRepeating("StartTimer", 0, 1);
        questionSelect.SetActive(true);
    }
 public override void OnStartPhase()
 {
     FindObjectOfType <PhaseSkillController> ().ShowAutoActivateButtons(false);
     Debug.Log("Starting attack phase");
     AnswerIndicatorController.Instance.ResetAnswer();
     RPCDicObserver.AddObserver(BattleLogic.Instance);
     GameTimerView.Instance.ToggleTimer(false);
     stoptimer = true;
     timeLeft  = 20;
     InvokeRepeating("StartTimer", 0, 1);
     Attack();
 }
Exemplo n.º 6
0
 private void GoToGameRoom()
 {
     AudioController.Instance.PlayAudio(AudioEnum.Bgm);
     lobbyRoom.SetActive(false);
     roomViews.SetActive(false);
     gameRoomUI.SetActive(true);
     gameRoomAssets.SetActive(true);
     ScreenController.Instance.StopLoadingScreen();
     StartPreTimer();
     CameraWorksController.Instance.StartIntroCamera();
     RPCDicObserver.AddObserver(GestureController.Instance);
     RPCDicObserver.AddObserver(BattleStatusManager.Instance);
     RPCDicObserver.AddObserver(SkillActivator.Instance);
 }
Exemplo n.º 7
0
 public void CancelRoomSearch()
 {
     if (!isMatchMakeSuccess)
     {
         if (GameData.Instance.isHost)
         {
             DeleteRoom();
             GameData.Instance.isHost = false;
             //return;
         }
     }
     RPCDicObserver.RemoveObserver(this);
     RPCQueryObserver.RemoveObserver(this);
     gameRoomKey   = null;
     searchingRoom = false;
     onSuccessMatchMake(false);
     FDFacade.Instance.RemoveQuery("SearchRoom");
     FDFacade.Instance.RemoveReference("InitialStateListener");
     FDFacade.Instance.RemoveReference("BattleStatusValueChanged");
     FDFacade.Instance.RemoveReference("BattleStatusChildAdded");
     FDFacade.Instance.RemoveReference("RPCListener");
 }
 public void OnEndPhase()
 {
     RPCDicObserver.RemoveObserver(PartAnswerIndicatorController.Instance);
     //show character selection
 }
    public void OnStartPhase()
    {
        RPCDicObserver.AddObserver(PartAnswerIndicatorController.Instance);

        Invoke("StartQuestion", 2.0f);
    }
Exemplo n.º 10
0
 public void Init()
 {
     RPCDicObserver.AddObserver(this);
 }
Exemplo n.º 11
0
 public void ReceiveRPC(Firebase.Database.DataSnapshot dataSnapShot)
 {
     RPCDicObserver.Notify(dataSnapShot);
 }
 public override void OnEndPhase()
 {
     FindObjectOfType <PhaseSkillController> ().ShowAutoActivateButtons(true);
     RPCDicObserver.RemoveObserver(BattleLogic.Instance);
     CancelInvoke("StartTimer");
 }
Exemplo n.º 13
0
 private void Init()
 {
     RPCDicObserver.AddObserver(this);
 }