예제 #1
0
 protected void SendEvent(GameEngine.Event e)
 {
     if (m_owner != null)
     {
         m_owner.SendEvent(e);
     }
 }
예제 #2
0
    void OnPlayerMove(GameEngine.Event evt)
    {
        GameProtos.common.Move move = (evt as PlayerActionEvent).moveData;
        int myID = proxyMgr.GetProxy <AccountProxy>().ID;

        if (myID != move.Id && players.ContainsKey(move.Id))
        {
            players[move.Id].SyncPosition(new Vector3(move.X, move.Y, move.Z));
        }
    }
예제 #3
0
    void OnJoinSucess(GameEngine.Event evt)
    {
        GameProtos.common.NewUser newUser = (evt as RoomEvent).newUser;
        Debug.Log("new user: " + newUser.Name);
        GameProtos.common.NewUser playerData = (evt as RoomEvent).newUser;
        if (players.ContainsKey(playerData.Uid))
        {
            return;
        }
        Player player = Instantiate(playerPrefab).GetComponent <Player>();
        int    myID   = proxyMgr.GetProxy <AccountProxy>().ID;

        player.Init(playerData.Uid, playerData.Name, newUser.Uid == myID);
        players.Add(newUser.Uid, player);
    }
예제 #4
0
    void OnAllMembers(GameEngine.Event evt)
    {
        var members = (evt as RoomEvent).allMembers.Members;
        int myID    = proxyMgr.GetProxy <AccountProxy>().ID;

        for (int i = 0; i < members.Count; i++)
        {
            int uid = int.Parse(members[i]);
            if (players.ContainsKey(uid))
            {
                continue;
            }
            Player player = Instantiate(playerPrefab).GetComponent <Player>();
            player.Init(uid, members[i], myID == uid);
            players.Add(uid, player);
        }
    }
예제 #5
0
 void OnJoinSucess(GameEngine.Event loginEvent)
 {
     btnJoin.SetActive(false);
 }
예제 #6
0
 void OnLoginSucess(GameEngine.Event loginEvent)
 {
     SceneManager.LoadScene("Game");
 }
예제 #7
0
 public void SendEvent(GameEngine.Event e)
 {
     ProxyMgr.Instance.EventManager.SendEvent(e);
 }
예제 #8
0
 public void SendEvent(GameEngine.Event e)
 {
     EventManager.SendEvent(e);
 }